next up previous contents
Next: Sampling From Statistical Distributions Up: Monte-Carlo Simulation with MCS-libre Previous: Getting MCS-libre   Contents

Compiling and Linking with MCS-libre

When compiling your programs, be sure that the location of the MCS-libre header files is known to the compiler. For GNU g++, this is accomplished as follows:

g++ -c some_program_using_mcsLibre.cpp -I/usr/local/include

where

 /usr/local/include
is the location of the MCS-libre header files. If these files are installed somewhere else, be sure to change the directory specified by the ``-I'' option to the proper location. In many cases, if the header files are in a standard include directory, the ``-I'' option and directory specification is unnecessary due to compiler settings.

To link programs using MCS-libre, the location and name of the required library must be given. For GNU g++, this is accomplished as follows:

g++ -o some_program_using_mcsLibre some_program_using_mcsLibre.o -L/usr/local/lib -lmcsLibre

Similar to the above case,

 /usr/local/lib
is the location of the MCS-libre library. Change this location if necessary. The
 -lmcsLibre
argument tells the linker the name of the library to use. Often, the ``-L'' argument and directory name can be omitted if MCS-libre is installed in a standard library directory and the linker is set to look in that directory.


next up previous contents
Next: Sampling From Statistical Distributions Up: Monte-Carlo Simulation with MCS-libre Previous: Getting MCS-libre   Contents
Hydroponics 2002-06-08