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 trial 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_npw3271na.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 (npl6a71na_amd64.tgz); (npla871na_arm64linux.tgz); cd to the directory where the file is located and extract the installation materials using the following command:

tar zxf npl6a71na_amd64.tgz
tar zxf npla871na_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 (npmi671na_macx64.dmg); (npma871na_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 - Including a Trial Licence

After downloading your NAG® Compiler version, simply complete the linked form below to receive your trial licence direct to your inbox.

Windows version trial licence key form Linux x64 version trial licence key form Linux ARM64 version trial licence key form Apple Intel Mac version trial licence key form Apple Arm Mac version trial licence key form

Alternatively, request a trial licence key 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. Note your key is not sent automatically via this route.

Install the Licence

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

<PRODUCT_CODE> TRIAL <EXPIRY_DATE> "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 NPW3270NA 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, the compiler library directory, 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 /usr/local/lib/NAG_Fortran/my.licence
in the Bourne shell or bash, type:
export NAG_KUSARI_FILE=/usr/local/lib/NAG_Fortran/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, copy the source file to your working directory 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.

 

Further Reading

The following documentation is recommended to guide your next steps:

The NAG® Fortran Compiler Manual.

Technical Support Service

Even with a trial licence, you have full access to our Technical Support Service. If you experience any difficulty, we are ready to help you. Contact us using the on-page chat facility or via the Technical Support Service.