Revision as of 22:43, 22 April 2022 by Jayid07 (talk | contribs) (→‎Example use of the compiler)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

The NAGWare Fortran compiler is available under /opt/common/NAGWare_f95* on our supported RHEL7/Ubuntu hosts. You can either load the binaries into your environment using GNU Modules, reference the paths directly, else add them to your PATH.

Example use of the compiler

Here is a very basic compilation and execution example of Hello World using the NAGWare fortran compiler. This example will utilize a GNU Module available on all supported Linux hosts to quickly load the binaries and libraries into your environment.

First, in a working directory, create a file hello.f95 with the following contents:

PRINT *, "Hello World!" 

Then, load the NAGWare modules into your environment and verify that the compiler is in your path (libraries, MANpages, and license server information will be loaded as well):

-bash-4.2$  module load nagware
-bash-4.2$  which f95

Compile and then run the program:

-bash-4.2$  f95 -o hello hello.f95 
-bash-4.2$  ./hello 
 Hello World!

See Also