Improving the treatment of external libraries

From Einstein Toolkit Documentation
Revision as of 20:19, 12 November 2012 by Hinder (talk | contribs)
Jump to: navigation, search

Sometimes Cactus code needs to call code in libraries external to Cactus. In order to ensure that these libraries are available to Cactus, each is represented by a Cactus thorn. These thorns perform the following functions:

 - Provide configuration variables for the user to use in their option lists to specify the location of the library on the machine.  Sometimes this is as simple as <lib>_DIR = /path/to/lib, but sometimes additional options need to be set, for example if the lib and include directories are in nonstandard locations in relation to the base library path.  The external library thorn translates the user's settings for these variables into compiler and linker options which are then used by Cactus when compiling and linking.
 - In the case that the user doesn't specify the location of the library, the thorn attempts to locate the library in some standard locations.
 - As a last resort, or if requested by the user, the thorn will build a version of the library and install it in the configuration directory.  For this reason, the thorn usually contains a distribution tarball of the library which is extracted and compiled during the Cactus configuration (CST) stage.  Sometimes there is also a patch which is applied to the source of the library. Having the libraries built as part of the configuration ensures that all the libraries needed are always available even if they have not been installed on the machine, but adds a significant overhead to compilation time.

At present, the logic for performing all of the above is implemented in configure.sh scripts in each library thorn.