Computing Services

Classroom Services & Room Scheduling Unit

Web Services

E-Learning & Instructional Technology

Distance Education

Related Sites

Accessibility Statement. Privacy Statement.

symbol for authentication required denotes that authentication is required.

NAG Numerical Libraries

Important Note: This document is based on the current state of installation of the NAG products. The installation might be changed to improve ease-of-use as based on feedback from the SPH user community. This document would be updated to reflect changes in the installation. If you have problems for this or any other reason, please write a full description of that problem (include all relevant info including the location of your source file, the command line you used to compile the file or invoke the Makefile, and all error messages). Your feedback will be helpful in improving the NAG libraries usage.

Overview

All NAG products are installed within the /usr/sph/nag directory.

All installed libraries should be accessible in the /usr/sph/nag/lib directory. See the examples below for specification of the library directory during command line compilation.

Include files for the C libraries should be accessible in the /usr/sph/nag/include directory. See the examples below.

Installed Versions

Numerical Libraries v4 for Gcc 2.7.2
Numerical Libraries v17 for Sun f77 v3.0.1 or later
Numerical Libraries v2 for NAG f90 v2.2 (GNU C version) and gcc 2.6.2 or later *

Reading the Documentation

NAG provides a complete hypertext-based manual set for each of its numerical library packages. UNIX man pages are also available for each of these products. Only UNIX man pages are available for the NAG f90 compiler.

The nagdoc command should bring up all documentation when installation is complete. At present, it only brings up the "f77 library" document set.

For now, the "C library" documentation can be accessed by running the nagdoc_c command. The "f90 library" documentation can be read by running the nagdoc_f90 command. I know this isn't an ideal.

The UNIX manual pages:

   Man page on f77 libs: man nag_fl_un
   Man page on c libs: lots, try man nag_c and man nag_c_contents
   Man page on the f90 libs: several, try nag_fn_contents

To print any documentation from inside the NAG help viewer application, choose "Print" from the file menu when viewing the desired page. The only viewer application is configured with one printer labeled "default". When printing to this printer, all output is send to the printer named in the user's PRINTER environment variable. Most regular SPH UNIX users have this environment variable defined with a line in their ~/.cshrc file, e.g.,

   setenv PRINTER student_lp

At this time, the only way to print to a different printer is to change the PRINTER environment variable before starting the "nagdoc" application. For example, a command similar to that shown above could be entered at the command prompt for a new printer and then the "nagdoc" program could be started at the same prompt.

Equations appearing in the printed pages from the NAG viewer application are printed so small that some people may have trouble reading them. This seems to be a problem with the way that the NAG help viewer renders the page before printing; it doesn't appear to be anything that we can fix. Printed manuals can be ordered directly from NAG. Please send mail to sph.help@umich.edu for more details.

Example Usage

Compiling:

Using the Sun f77 compiler:

f77 somefile.f -L/usr/sph/nag/lib -lnag

Using the GNU c:

gcc somefile.c -I/usr/sph/nag/include -L/usr/sph/nag/lib -lnagc

Using the Sun f90 compiler:

Not supported as indicated by the NAG documentation. You could try the same method used with f77. You may with to try this before trying the NAG f90 compiler since we don't support or recommend the NAG f90 compiler.

Using the NAG f90* compiler (gcc version) to compile f90 code:

/usr/sph/nag/bin/f90 somefile.??? -L/usr/sph/nag/lib -lnagfl90

* SPH Computing Services does not support nor guarantee the operation of the NAG f90 compiler. At this time, it can only be invoked by specifying the full path of /usr/sph/nag/bin/f90 on the command line. We won't be able to solve problems associated with its use. SPH Computing Services does not recommend producing any critical work- or school-related projects based on the NAG fortran 90 compiler that would break it were to be removed without warning. It could be removed by SPH Computing Services at any time without warning -- if this is a problem for you, please indicate this in a message to sph.help@umich.edu. Use it at your own risk.

Revised 8 June 2000, JDA
To contact SPH Computing Services for network and computing support, send email to sph.help@umich.edu or phone 936-1247