Table of Contents

Use a third-party library (FFTW, Vigra, Blitz, etc.)
 

Including and linking a third-party, external library is easy in RPSL. Generally
it is best to put external libraries in a directory "external" in the top level
of one of the RPSL trees and install them to that tree's target location.  This
isn't required as long as a pc file is written for the library and put in the 
pkgconfig search path. Good external libraries could be installed in the RPSL_HOME
global sandbox and shared among projects, say, for example, FFTW.

If possible, a good way to incorporate a third-party library is to make it an
RPSL/autotools tree if it is not already an autotools distribution. All that is
really needed, however, is a pc file in the PKG_CONFIG_PATH that specifies how
to include and link library objects.

So:

STEP 1.
-------
Configure the external library build to install in a particular location. If
a shared object is generated, this location must be in the LD_LIBRARY_PATH.

STEP 2.
-------
Make and install the library.

STEP 3.
-------
Edit a file called libname.pc and place it in one of the usr/local/lib/pkgconfig
directories in the PKG_CONFIG_PATH locations.  This defines how to include and 
link the library.

A pc file for FFTW might look like:


$RPSL_HOME/usr/local/lib/pkgconfig/fftw.pc:

prefix=/home/username/external/fftw-2.1.5
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: fftw
Description: FFTW v2.1.5 library.
Version: 2.1.5
Libs: -L${libdir} -lfftw -lrfftw
Cflags: -I${includedir}


STEP 4.
-------
In a dependent module, add the library dependency in the the rpslParams file:

rpslParams:
...
fftw >= 0.0.0

And it's include and object files will be found and linked via the pkg-config 
macros associated with configure.

top


Table of Contents
William Snyder
Last modified: Thu May 26 11:16:42 EDT 2005