ProblemsWithSharedLibraries

Problems with Shared Libraries

Some TINA projects rely on external libraries for specific functionality. Most notably, the Geometric Morphometrics toolkit uses a library called Volpack to produce 3D rendered images of medical image volumes. On GNU/Linux systems, libraries can be compiled in one of two ways. Static libraries have the extension .a and are included in the executable files of applications that rely on them. Shared libraries have the extension .so and are not included in executable files; they are instead located and used at run time. This is obviously more efficient, particularly for commonly used libraries, since a single copy of the library can be used by multiple executables even though they run as separate operating system processes.

Applications must be able to locate the shared libraries they require, and arguably the most convenient way to ensure they do is to use the system-wide list of shared library locations contained in the file /etc/ld.so.conf. Therefore, if you are attempting to build a TINA toolkit that depends on an external library, or you run into problems with error messages that read "cannot find lib?????.so" when trying to run TINA, use the following procedure:

Compile and install the library; see the INSTALL or README file included with the library for details.

Locate the .so file; this will probably be installed to a standard location such as /usr/local/lib or /usr/local/lib64.

Open the /etc/ld.so.conf file in a text editor; you will have to be logged in as root to make any changes.

Check that ld.so.conf contains a line that specifies the location of your .so file. If this line is absent, add it.

Open a terminal and, as root, type:

ldconfig

This will update the system-wide list of shared libraries with the location of the newly installed library; any executables that need the library should then be able to find it.