Penn State EMS Environment Institute
Environmental Computing Facility


Program Compiling and Linking

How do I link to the IMSL libraries?

To link to the IMSL F90 MP Libraries, you first need to define some environment variables used by the IMSL libs. Use the command:

source /opt/local/imsl/f90setup.csh

to define the necessary variables. You need only source this setup file once after you log in, but before starting to work with code you want to link to the IMSL libs.

After sourcing the file to define the IMSL environment variables you may link to the IMSL libs while by including some environment variables in your compile or link commands:

f90 $F90FLAGS -o myprog myprog.f90 $LINK_F90

will compile "myprog.f90" and link it to the IMSL libs. By default your code will link to a dynamic copy of the IMSL code; if you prefer to have your code statically linked with the IMSL libraries, use the environment variable $LINK_F90_STATIC in place of $LINK_F90.

Note that when you run a program linked to the IMSL libraries, you will also need to define the IMSL environment variables by sourcing the f90setup.csh script.



Back to the index