next up previous
Next: Compiling / Using make Up: IMSL Numerical Library Previous: IMSL C Matrix Multiplication

Calling IMSL C library functions from C++ under Linux

// include either or both header files as appropriate 
#include <imsl.h> // math library 
#include <imsls.h> // stat library 
// no need to declare the functions in advance 
// in code, here's an example of how you would call the linear solution function: 
// you need to include a 0 as the last argument 
// {d,f} delineates double vs. float version 
// {,s} - make sure to include the ``s'' if routine is from stat library rather than math library, otherwise it's just imsl_{d,f}

Compilation on the CMU Statistics machines (in other environments, you'll have to set up the necessary arguments to the compiler):
source /usr/statlocal/vni/CTT2.1/ctt/bin/cttsetup.csh 
g++ filename.C $CFLAGS $LINK_CNL -lm -L/usr/statlocal/lib

Chris Paciorek 2012-01-21