GAMGI Installation: Tips

Installation Tips
Sometimes things do not run as expected. Usually problems fall in one of the following categories:

### Compilation problems

1) Check carefully PATH_GTKGL_H, PATH_MESA_H, PATH_GTK_H, PATH_ATK_H, PATH_PANGO_H, PATH_CAIRO_H, PATH_GLIB_H, PATH_X_H, PATH_FREETYPE_H, PATH_EXPAT_H, in the file:

    $GAMGI/gamgi_version/src/make_local

to see if the paths to the header files are correct. These paths tell the compiler where to search for files included with statements such as #include <expat.h>. In statements as for example #include <gtk/gtk.h>, the path should point to the directory containing gtk, not to gtk.h itself. The external headers in GAMGI that need to be found are:

    #include <glib.h>
    #include <glibconfig.h>
    #include <gtk/gtk.h>
    #include <gdkconfig.h>
    #include <gtk/gtkgl.h>
    #include <gdkglext-config.h>
    #include <GL/gl.h>
    #include <GL/glu.h>
    #include <expat.h>
    #include <ft2build.h>

2) Check whether GAMGI compiles as root. Perhaps the missing library or its containing directory is giving reading permition only to root.

### Linking problems

1) Check carefully PATH_GTKGL_L, PATH_MESA_L, PATH_GTK_L, PATH_ATK_L, PATH_PANGO_L, PATH_CAIRO_L, PATH_GLIB_L, PATH_X_L, PATH_FREETYPE_L, PATH_EXPAT_L, in the file:

    $GAMGI/gamgi_version/src/make_local

to see if the paths to your library files are correct. These paths should point to the directory where are the .so (dynamic) or .a (static) library files.

2) Add a soft link to the missing library in /usr/local/lib, one of the paths that are usually scanned when the system is looking for a library. For example:

    ln -s /usr/local/lib/libGL.so /opt/gtk/lib/libGL.so

3) Add this line to .bash_profile or equivalent:

    export LD_LIBRARY_PATH=/usr/lib64/gtk-2.0

4) Check the order of the libraries in the linking command. The linking command, in the file $GAMGI/src/make_rules, should be:

    LIBS = -lgtkglext-x11-1.0 -lgdkglext-x11-1.0 -lGLU -lGL -lgtk-x11-2.0 \
    	-lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lpangocairo-1.0 -lpango-1.0 \
    	-lcairo -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lXext -lX11 \
    	-lXi -lXmu -lfreetype -lexpat -lm -ldl

The linker reads from end to start and lower-level libraries should be red first, so -lGLU should come before -lGL, etc. Usually this is only a problem in compilations with static libraries, because dynamic linkers can detect missing libraries, if they are upstream.

### Running problems

1) Check the paths of the libraries used to run the executable, typing:

    cd $GAMGI/gamgi_version/src
    ldd gamgi

Perhaps GAMGI was compiled and linked against a different version of some missing library than the one used at run time.

2) Add the library path to the file /etc/ld.so.conf and run the command /sbin/ldconfig. For example, as root:

    edit file: /etc/ld.so.conf
    insert line: /home/carlos/gamgi/mesa/mesa/lib
    run command: /sbin/ldconfig

3) Check whether GAMGI runs as root. Perhaps GAMGI or some missing library (or its parent directory) are giving execution permition only to root.
Home