The libMoM library uses the GNU autotools suite (autoconf, automake, and libtool) for its development build system. The build system will be familiar to users of Unix and Linux systems.
To build the ablation library starting from a release distribution, untar the distribution and enter the top-level directory.
> tar xvfz libMoM-0.11.tar.gz > cd libMoM-0.11/
The libMoM library has the following software requirements in order to build successfully:
The configuration step will look for available compilers in the user environment. The default is g++ but this choice can be overridden by setting CC
and CXX
appropriately.
GSL Directory: Use the --with-gsl
option to specify the location of the local GSL installation. Examples shown below assume that GSL has been installed in the user's ~/usr/local/gsl directory.
GLPK Directory: Use the --with-glpk
option to specify the location of the local GLPK installation. Examples shown below assume that GLPK has been installed in the user's ~/usr/local/glpk directory.
Installation Directory: Use the --prefix
option to specify your desired top-level installation directory for libMoM. The examples below all configure the ablation library to be installed in the user's ~/usr/local/libMoM-0.11 directory.
Configure Example:
> ./configure --with-gsl=/usr/local/gsl --with-glpk=/usr/local/glpk --prefix=/usr/local/libMoM-0.1
Once configured, type make
to build the software. If successful, this will build the libMoM library (static and dynamic versions).
> make
To check proper installation type make check
. This will carry out a number of tests to check if everything is installed properly.
> make check
If all tests pass then type make install
. This will install the libraries at the chosen location specified in the prefix command. The default is /usr/local.
> make install
To generate the documentation of the code with Doxygen, type make install
.
> make doc
This will create the folder /docs. The reference manual is created in both html and Latex. The manual in html can be opened in docs/html/index.html. To generate the manual in Latex, go to docs/latex then type make
. The manual will be contained in the file refman.pdf
Once installed set the dynamic libraries to the path.
export DYLD_LIBRARY_PATH=/usr/local/libMoM-0.1/lib
A typical Makefile is as follows:
LIBMOM_DIR = /usr/local/libMoM-0.1 GSL_DIR = /usr/local/gsl GLPK_DIR = /usr/local/glpk INC_PATHS = \ -I. \ -I$(LIBMOM_DIR)/include \ -I$(GSL_DIR)/include \ -I$(GLPK_DIR)/include LIBS = \ -L$(LIBMOM_DIR)/lib \ -lMoM \ -L$(GSL_DIR)/lib \ -lgsl \ -L$(GLPK_DIR)/lib \ -lglpk \ -Wl,-rpath,$(LIBMOM_DIR)/lib -Wl,-rpath,$(GSL_DIR)/lib -Wl,-rpath,$(GLPK_DIR)/lib CXX = g++ CXXFLAGS += -O3 -Wall -c default: all .SUFFIXES: .o .c all: example clean: rm -f *~ rm -f *.o rm -f example example: main.o inputs.o user_defined_functions.o $(CXX) main.o \ inputs.o \ user_defined_functions.o \ -o example $(LIBS) %.o: %.c $(CXX) $(INC_PATHS) $(CXXFLAGS) $<
Examples of user supplied programs can be found in the Example Problems section.