Department of Mathematics - University of Utah

HomeComputingCourse SchedulesCSMECurrent PositionsFAQ (Computing)FormsGraduateHigh SchoolLecture VideosMailbox AccessMath BiologyMath EducationNewsletterPeopleResearchRTG GrantsSeminars

Using the NAG Fortran libraries at the University of Utah Mathematics Department

Last update: Tue Nov 19 18:04:47 2002

Comments, and reports of errata or bugs, are welcome via e-mail to the author, Nelson H. F. Beebe <beebe@math.utah.edu>. In your report, please supply the full document URL, and the title and Last update time stamp recorded near the top of the document.

The NAG Fortran library is always available as files /usr/local/lib/libnag.{a,so,sl}; these are symbolic links into the NAG installation tree. This makes it possible to refer uniformly to the library with compiler switches -L/usr/local/lib -lnag.

On some architectures, there may be additional versions of the NAG libraries that have been compiled for specific CPU architectures or memory models, and depending on your processor, they may offer higher performance. Of necessity, the default installations include only the libraries that match the least-common denominator of architectures and memory models. If this applies to you, then you need to read the NAG installation notes; look for the topics beginning NAG Fortran Library in that long list.

The little test program, nagtest.f, used below is available for your inspection. Each system section below contains a pointer to a large collection of more than 900 NAG-supplied sample files.


Compaq/DEC Alpha OSF/1 4.0 (also known as Tru64)

f77     -o nagtest nagtest.f -lnag
f90     -o nagtest nagtest.f -lnag
f95     -o nagtest nagtest.f -lnag
g77     -o nagtest nagtest.f -lnag
nagf90  -o nagtest nagtest.f -lnag
nagf95  -o nagtest nagtest.f -lnag

Further examples are available.


HP HP-UX 10.01

f77                   -o nagtest nagtest.f \
                      -L/usr/local/lib -lnag
g77 -fno-underscoring -o nagtest nagtest.f -lnag

The -fno-underscoring switch tells g77 not to add a final underscore after external names. The HP and IBM Fortran compilers do not do this, and there is no NAG Fortran library supplied for this system that has been compiled with g77. That switch then makes external names the same as those produced by the native HP Fortran compiler, allowing the same NAG library to be used with both compilers.

Further examples are available.


Intel GNU/Linux

f77     -o nagtest nagtest.f -lnag
g77     -o nagtest nagtest.f -lnag
nagf90  -o nagtest nagtest.f -lnag
nagf95  -o nagtest nagtest.f -lnag
pgf77   -o nagtest nagtest.f -lnag
pgf90   -o nagtest nagtest.f -lnag
pghpf   -o nagtest nagtest.f -lnag

Further examples are available.


SGI IRIX 5.3

f77     -o nagtest nagtest.f -lnag
g77     -o nagtest nagtest.f -lnag -lftn
nagf90  -o nagtest nagtest.f -lnag
nagf95  -o nagtest nagtest.f -lnag

Further examples are available.


SGI IRIX 6.5

f77        -o nagtest nagtest.f -L /usr/local/lib -lnag
f77 -64    -o nagtest nagtest.f -lnag
f77 -n32   -o nagtest nagtest.f -lnag
f77 -o32   -o nagtest nagtest.f -lnag16
f90        -o nagtest nagtest.f -L /usr/local/lib -lnag
f90 -64    -o nagtest nagtest.f -lnag
f90 -n32   -o nagtest nagtest.f -lnag
g77        -o nagtest nagtest.f -lnag
nagf90 -64 -o nagtest nagtest.f -lnag
nagf95 -64 -o nagtest nagtest.f -lnag

lcc does not work with the NAG library: it produces -o32 memory-model object files, and there are none in the NAG C libraries.

Further examples are available.


Sun Solaris 2.x

f77     -o nagtest nagtest.f -lnag
f90     -o nagtest nagtest.f -lnag -lF77
g77     -o nagtest nagtest.f -lnag \
        -L/opt/SUNWspro/SC5.0/lib -lnag -lF77 -lsunmath
nagf90  -o nagtest nagtest.f -lnag
nagf95  -o nagtest nagtest.f -lnag
nagf95  -o nagtest nagtest.f -lnag

The nasty vendor-release-dependent library switch for g77 is regrettably necessary, because NAG does not supply a NAG Fortran library that has been compiled with g77. Thus, the library makes references to symbols in the Sun Fortran libraries, and those additional switches tell g77 how to find them.

Further examples are available.


Dept Info Outreach College of Science Newsletter

Department of Mathematics
University of Utah
155 South 1400 East, JWB 233
Salt Lake City, Utah 84112-0090
Tel: 801 581 6851, Fax: 801 581 4148
Webmaster


Entire Web                     Only http://www.math.utah.edu/