Indiana University
University Information Technology Services
  
What are archived documents?

On Libra, how can I link a C job to the IMSL C Library and execute it?

Define environment variables

Before compiling, linking, and running a C program using the IMSL C/Stat or C/Math Library on the Libra Cluster at Indiana University, you must define several environment variables, as follows:

  • If you are using csh, enter the following at the Unix system prompt: source /software/libapps/imsl50/imsl.csh
  • If you are using ksh or bash, enter the following at the Unix system prompt: . /software/libapps/imsl50/imsl.sh

You can add these lines to your .login file (for csh users) or .profile file (for ksh or bash users) to automatically activate the environment variables every time you log in.

Link and run

To link and run your C program invoking a C function from the IMSL C/Library (Stat or Math), at the system prompt, enter:

$CC -o filename filename.c $IMSLC ./filename

Replace filename.c with the name of the file that contains your C code that invokes the IMSL C/Library. Replace filename with an appropriate name to store the compiled and executable programs. To run the program, enter the name of the executable program (i.e., filename). For example, if you have a file named imslcstat1.c which contains codes to invoke the IMSL C/Library, at the system prompt, enter:

$CC -o imslcstat1 imslcstat1.c $IMSLC ./imslcstat1

You will see the output on the screen. If you want to save the output to a file, replace the last line with the following:

./imslcstat1 > imslcstat1.out

Sample programs

The IMSL installation on Libra comes bundled with example programs. To try them, enter one of the following:

$CC $CFLAGS -o cmath /software/libapps/imsl50/CTT5.0/examples/rs6000/cnl/validate/cmath.c $LINK_CNL ./cmath $CC $CFLAGS -o cstat /software/libapps/imsl50/CTT5.0/examples/rs6000/cnl/validate/cstat.c $LINK_CNL ./cstat

The expected output is explained in /software/libapps/imsl50/CTT5.0/examples/rs6000/cnl/validate/README.

Note: For more details about the IMSL, NAG, and other subroutine libraries (including information about how to compile, link to, and run programs that invoke them), see the IU High Performance Applications subroutine library page.

For a list of research software available on UITS research computing systems, see:

Also see:

This is document achd in domain all.
Last modified on January 15, 2008.
Please tell us, did you find the answer to your question?