The **NAG Fortran Library** is a *comprehensive *mathematical
and statistical software* *library. In addition to
numerical
linear algebra, it contains *mathematical software* for root
finding
and nonlinear systems, Fast Fourier Transforms, quadrature, ordinary
and
partial differential equations, interpolation, curve and surface
fitting,
and optimization. It also contains *statistical software*,
including
regression analysis, multivariate statistical analysis, analysis of
variance,
nonparametric statistics, contingency tables, and time series.
The
**NAG
**Library
is a commercial package, developed by the Numerical
Algorithms Group. A very old version (**Mark 14**,
1990) is installed on some machines on our network.

Current
releases of the NAG software
library are available (for legitimate educational and/or research use)
through the Ohio Supercomputer Center's (OSC)
"Statewide Software License" program. A
portion of the NAG Library is
also accessible from inside the Maple
computer algebra system, which also is installed on our network.
For information on accessing Maple
on our network, see here.

Compiled library archives, for both **LAPACK** and **NAG**,
are
installed on the main servers on our Math/CS network:

- HP:
`trident`,`aegis`

- Linux: excalibur

- HP:

`% cc -c lapack_driver.c`

`% f90 lapack_driver.o -L/local/opt/fortran/lib -llapack -lblas``
`

`% CC -L/local/opt/fortran/lib -L/opt/fortran/lib
lapack_driver.cpp
-llapack -lblas`

`% f90 nag_driver.f -L/local/opt/fortran/lib -lnag`

`% cc -c nag_driver.c`

`% f90 nag_driver.o -L/local/opt/fortran/lib -lnag``
`

`% CC -L/local/opt/fortran/lib nag_driver.cpp -lnag`

- Linux:

`% cc -c lapack_driver.c`

`% f77 lapack_driver.o -llapack`` `

`% c++ -c lapack_driver.cpp`

`% f77 lapack_driver.o -llapack -lstdc++
`

`% c++ lapack_driver.cpp -llapack -lg2c
`

`% f77 nag_driver.f -lnag
`

`% f77 nag_driver.f /vol/nag/lib/linux/libnag.a
`

`% cc -c nag_driver.c`

`% f77 nag_driver.o -lnag
`

`% cc -c nag_driver.c
% f77 nag_driver.o /vol/nag/lib/linux/libnag.a
`

In calling Fortran programs from C programs, one needs to take into
account certain differences between the two languages, in particular,
all input and/or output *arguments*
in Fortran are passed *by reference*, and *arrays* in
Fortran
are stored in *column-major* order (whereas C stores arrays in *row-major*
order). Aspects of dealing with these differences are indicated
in
the test/example programs above.

For **LAPACK**, instead of using the pre-compiled libraries (as
described
above), one can also download (from the **LAPACK**
subdirectory at Netlib) the *Fortran source code* for the
routines
you need to use and simply compile them together with your driver
routine.
Since most of the **LAPACK** routines also call other (lower-level
or
auxiliary) routines, you should to be sure to click to download the
routines
"plus dependenices."

for general information.% man lapack

Other examples:

to obtain information (calling sequence, input/output argument list) for the% man ddot

for the% man cgesv

The **LAPACK** man pages on the HP machines are locally
installed.
For the `man` utility to find them, their location must be
properly
incorporated into the `MANPATH
`*environment variable*.
This should happen automatically if your `.cshrc` or `.login`
(or .bashrc or .bash_profile or ... ) script
sources in the file `/etc/MANPATH`. Alternately,
or
if you have problems, you can add the directory manually (or in your `.cshrc`
or `.login` or ... file) via (csh/tcsh syntax)

% export
MANPATH=${MANPATH}:/vol/lapack/man

See

The most complete information on the LAPACK Library is contained in
the *LAPACK
Users' Guide, 3rd Edition*, which is available in *hard copy*
(from SIAM Publications--you can probably borrow a copy from one of the
numerical analysts in our department) or in *on-line version* (at
the link above).

There are no on-line man pages for the **NAG** Library.
Usage
notes can be found in the subdirectory `/vol/nag/doc/` (see in
particular
the "Essential Introduction" `essint` and the "User's Note" `un`).
An extensive collection of examples is in `/vol/nag/examples/`.
The most complete documentation consists of the multi-volume hard-copy
set in our *Documentation Room*: **room 313A**, the last side
room
in the **Math/CS Library**. The library/mailroom key (which
is
issued to all Math/CS faculty and graduate students) will open this
room.
If you do not have one of these keys, then you will need to see a
secretary
in the **Math/CS** **Main Office (room 233)** to borrow
one.
The best place to start is the spiral-bound *NAG Fortran Library
Introductory
Guide - Mark 14*, which you can also borrow from one of the
numerical analysts.

Chuck Gartland / gartland@math.kent.edu June, 1999 (original version) July, 2004 (latest revision)