Indiana University
University Information Technology Services
  
What are archived documents?
Login>>
Login

Login is for authorized groups (e.g., UITS, OVPIT, and TCC) that need access to specialized Knowledge Base documents. Otherwise, simply use the Knowledge Base without logging in.

Close

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

Note: UITS will retire Libra in spring 2009. Accounts are available on Quarry, a general-purpose Unix computing environment. For more, see ARCHIVED: About the Libra retirement.

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 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:

This is document achd in domain all.
Last modified on June 30, 2009.

Comments/Questions/Corrections

Use this form to offer suggestions, corrections, and additions to the Knowledge Base. We welcome your input!

If you are affiliated with Indiana University and would like assistance with a specific computing problem, please use the Ask a Consultant form, or contact your campus Support Center.

Contact Information

Note: We will reply to your comment at this address. If your message concerns a problem receiving email, please enter an alternate email address.