--- title: 'NAG Library' taxonomy: category: - docs published: true --- [toc] ## What is NAG Library?{#summary} NAG Library is a software library of high-reliability scientific computing and statistical computing, contains more than 1000 functions. The NAG Fortran SMP Library for SMP and the NAG Parallel Library for MPI distributed memory parallelization are both available. ## Environment Settings{#enviroment} ### Software Version and System Requirements{#version} Version | Module Filename | SystemA | System B/C | System G/Cloud --------------------------- | ------ | ----- | ----- | --- SMP version Mark 26 (default) | nag_fortran/26 | - | AU | - MPI version Release 3 (default) | nag_paralell/3 | - | AU | - AU : Available for academic users only \- : Unavailable ### Library Settings{#modules} If you want to use NAG Libraries, you need to use the Intel compiler. Please refer to [Intel compilers](/compilers/intel#modules) for setting up the environment. Execute the module command as follows to load the version of the module file you want to use. ```nohighlight ## When using the SMP version $ module load nag_fortran -- ## When using the MPI version $ module load nag_parallel ``` You can not set up the environment of the SMP version and the MPI version at the same time. Please refer to [Modules](/config/modules) for details on the module command. ## How to Use{#usage} The environment settings set the commands and options required for compilation as environment variables. Please use these environment variables to link the NAG library when translating. Type | Environment Variables | Notes -------- | --------- | ----- Compile Commands | $fcompile | Environment variables contain commands and compilation options required for compilation. Link options | $flink | Environment variables contain libraries required for a link. * **Example of Compilation & linking ** ```nohighlight $ $fcompile sample.f90a $flink ``` * **Example of Execution** ```nohighlight $ tssrun ./a.out ``` ## Sample Program{#sample} Sample programs are available for almost all routines in the NAG library. Please copy and use the files under the directories shown in the table. #### SMP version Sample files | File Paths --------- | --------------------------------------------------- Source Code | /opt/system/app/nag_fortran/26/fsl6i26dcl/examples/source Input data | /opt/system/app/nag_fortran/26/fsl6i26dcl/examples/data Results | /opt/system/app/nag_fortran/26/fsl6i26dcl/examples/results #### MPI version Sample files | File Paths --------- | ------------------------------------------------ Source Code | /opt/system/app/nag_parallel/3/fdl6i03dcl/examples/source Input data | /opt/system/app/nag_parallel/3/fdl6i03dcl/examples/data Results | /opt/system/app/nag_parallel/3/fdl6i03dcl/examples/results ## Manuals{#manual} ### SMP * [NAG Library Manual(MARK 26)](https://web.kudpc.kyoto-u.ac.jp/auth/manual/nag/nagdoc_fl26/index.html) ### MPI * [NAG Library Manual(Release 3)](https://web.kudpc.kyoto-u.ac.jp/auth/manual/nag/nagdoc_pl3/fd/html/genint/libconts_fd03.html) ## Links{#link} * [Numerical Algorithms Group(NAG)](http://www.nag-j.co.jp/index.htm)