The NAG Library is the largest commercially available collection of numerical and statistical algorithms in the world. With over 1,600 tried and tested routines that are both flexible and portable, it remains at the core of thousands of programs and applications spanning the globe.The NAG Library is so widely used and trusted because of its unrivalled quality, reliability and portability. Whether it is a single PC or a cluster of the world largest supercomputers, the NAG Library has the numerical capabilities to fit your model. The NAG Library is available for use with many programming languages and for many platforms and operating systems.

Version: mark27--binary

Availability: MARCONI

Target: all

Official web site:

Related Commands:

Two different libs are available, both for static and dynamic linking

  • nag_nag
  • nag_essl

For best performance, we recommend that you should use the variant of the NAG Fortran Library which is based on the Engineering and Scientific Subroutine Library (ESSL) V4.4 i.e. libnag_essl.a or However, if you use a version of the ESSL different from the version used in creating this implementation and you have problems when calling a NAG routine, we suggest that you use one of the self-contained libraries libnag_nag.a or

In order to link the NAG library to your code, you have to load the library in your environment:

 module load nag

Then you have to link the library to your Fortran or C code:

 mpxlf_r -q64 -o myexe.x myobj.o -L${NAG_LIB} -lnag_nag          myexe.f
mpxlf_r -q64 -o myexe.x myobj.o -L${NAG_LIB} -lnag_essl -lessl myexe.f
mpxlc_r -q64 -o myexe.x myobj.o -L${NAG_LIB} -lnag_essl -lessl myexe.c


Help and Documentation:

You can find documentation on the module, with the command

module help nag

The manual is on the web at the original home page (

CINECA consultants can be reached through the address: