Getting Started with the NAG Fortran Compiler

Robust and highly tested Fortran Compiler, valued for its checking capabilities and detailed error reporting. Available on Linux, Microsoft Windows and macOS, including Apple Silicon Macs.

Follow the steps below to get started with the NAG Fortran Compiler including downloads for your chosen configuration, how to obtain a licence, product-specific documentation, and accessing technical support.

If you have any questions, contact us using the on-page chat facility or via the Technical Support Service.

To find and download your version of the NAG Fortran Compiler, select your operating system below.

Windows Linux x64 Linux Arm64 Intel Mac Arm Mac
 

Target platform

Microsoft Windows (x86/x86_64)

x86-64 Linux (AMD64 or Intel 64)

Arm64 Linux

Apple Intel macOS 64-bit

Apple Arm macOS 64-bit


Download the Software

Given your selection, your NAG Fortran Compiler download is:

the Windows version Download

the Linux x64 version Download

the Linux ARM64 version Download

the Apple Intel Mac Download

the Apple Arm Mac Download

Install the Software

After download, run the self-extracting executable (setup_npw3272na.exe) to start the NAG Fortran Builder installation.

A typical installation will be straightforward (follow the prompts on the Windows setup Wizard and press Next) or see the README file which has some additional information.

The NAG Fortran Compiler materials are downloaded from our website as a tar gzip file (npl6a72na_amd64.tgz); (npla872na_arm64linux.tgz); cd to the directory where the file is located and extract the installation materials using the following command:

tar zxf npl6a72na_amd64.tgz
tar zxf npla872na_arm64linux.tgz

You will need to log in to an administrator account, or use the sudo command, to carry out the installation.

The NAG Fortran Compiler materials are downloaded from our website as a Disk Image file (npmi672na_macx64.dmg); (npma872na_macarm64.dmg); double click on the file to mount the disk image.

Then, in a command prompt cd to the distribution directory and type

./install.sh

 

Then, from a Terminal window type the following commands:

cd /Volumes/NAG_Fortran-macx64

./INSTALL.sh

 

cd /Volumes/NAG_Fortran-macarm64

./INSTALL.sh

 

It is strongly recommended that the compiler libraries are installed to the default directory /usr/local/lib/NAG_Fortran. Failure to do so may result in problems in accessing the dynamic libraries; this may be alleviated by setting the LD_LIBRARY_PATHDYLD_LIBRARY_PATH environment variable to include the compiler library directory.

Obtain a Licence

The use of this product is controlled by the Kusari licence management system. A licence key may be requested and installed via the Kusari Licence Installer, accessible at the end of the software installation procedure. Click 'Request New Licence'. Complete the form and select 'Generate Licence Request'. Paste the generated information into your email client and send it to the NAG address given at the top of the generated information.

The use of this product is controlled by the Kusari licence management system. Before obtaining a full licence you need to know the Kusari hostid of the system on which you intend to use the NAG Fortran Compiler. Execute the command khostid on that system, and send the output of this command to our support team. The khostid command may be found in the compiler library directory (usually /usr/local/lib/NAG_Fortran).

The use of this product is controlled by the Kusari licence management system. Before obtaining a full licence you need to know the Kusari hostid of the system on which you intend to use the NAG Fortran Compiler. Execute the command khostid on that system, and send the output of this command to our support team. The khostid command may be found in the compiler library directory (usually /usr/local/lib/NAG_Fortran).

Install the Licence

You will receive your requested licence key by email containing one or more lines like the following:

<PRODUCT_CODE> FULL "p8dYLdvIeIQpRUkY1d3+ifXcyt"

Once you have obtained the above licence key, the Kusari Licence Installer can be used to install the key in the Windows Registry. Open the installer via the Start Menu or All apps shortcut NAG NPW3272NA Licence, Request or Install. Paste the key into the edit box on the main dialogue and click 'Install Licence Key'.

Once you have obtained the above licence key, the easiest way to install it is to store the text in a file,

$HOME/nag.key

or

/opt/NAG/nag.key

Setting the environment variable

If the key is installed in a file other than nag.key, nag.licence or nagware.licence in the directory specified in the HOME or HOMEPATH environment variable or the current working directory, you need to set the environment variable NAG_KUSARI_FILE to the full pathname of the licence file.

Use the Control Panel/System/Advanced system settings/Environment Variables dialogue to do this. The exact details of this process depend on the version of Windows installed.

This is not necessary if the licence key is installed in the Windows Registry.

If the key is installed in a file other than nag.key, nag.licence or nagware.licence in /opt/NAG, your home directory, or the current working directory, you need to set the environment variable NAG_KUSARI_FILE to the full pathname of the licence file.

For example, in the C-shell, type:

setenv NAG_KUSARI_FILE $HOME/my.licence
in the Bourne shell or bash, type:
export NAG_KUSARI_FILE=$HOME/my.licence

 

Testing

Following installation, the Fortran Builder can be invoked using the desktop icon or the Start Menu. The compiler can also be invoked from the command prompt created by the Start Menu item NAG Fortran Compiler Command Prompt.

The installation can be tested by creating a console project with the Hello World template, and running it.

The installation may be tested by compiling and running the utility program f90_util.f90, which is provided in the same directory as the compiler library files. To compile and link this program, connect to your home directory (“cd”), copy the source file to there (“cp /usr/local/lib/NAG_Fortran/f90_util.f90 .”), and type

nagfor -o f90_util f90_util.f90
(This assumes that the compiler binaries have been installed in a directory included in your PATH environment variable.) The program (f90_util) may now be run.

 

(Do not try to compile the program directly in the compiler library directory, as you almost certainly do not have write permission there.)

Further Reading

The following documentation is recommended to guide your next steps:

The NAG Fortran Compiler Manual.

Technical Support Service

If you experience any difficulty, we are ready to help you. Contact us via the Technical Support Service.