NAGWareCompiler: Difference between revisions

From UMIACS
Jump to navigation Jump to search
No edit summary
No edit summary
 
(18 intermediate revisions by 4 users not shown)
Line 1: Line 1:
__NOTOC__
__NOTOC__


The NAGWare Fortran compiler is available under <tt>/opt/common/NAGWare_f95</tt>* on our supported RHEL6/RHEL7/Ubuntu hosts, and <tt>/opt/NAGWare_f95</tt>* on our supported RHEL5 hosts. You can either load the binaries into your environment with the [[Modules | GNU Module]] we created, reference the paths directly, else add them to your [[PATH | PATH]].
The NAGWare Fortran compiler is available under <tt>/opt/common/NAGWare_f95</tt>* on our supported [[RHEL | Red Hat Enterprise Linux (RHEL)]] and [[Ubuntu]] hosts. You can either load the binaries into your environment using [[Modules | GNU Modules]], reference the paths directly, or add them to your [[PATH]].


==Example use of the compiler==
==Example use of the compiler==


Here is a basic compilation an execution of Hello World using the NAGWare fortran compiler. This example will use the GNU Module we setup to quickly load the binaries into your environment.  
Here is a very basic compilation and execution example of [http://en.wikipedia.org/wiki/Hello_world_program 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 <tt>hello.f95</tt> with the following contents:
First, in a working directory, create a file <tt>hello.f95</tt> with the following contents:
Line 11: Line 11:
  PRINT *, "Hello World!"  
  PRINT *, "Hello World!"  
  END
  END
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
/opt/common/NAGWare_f95-5.1/bin/f95
Compile and then run the program:
-bash-4.2$  f95 -o hello hello.f95
-bash-4.2$  ./hello
  Hello World!
==See Also==
* [http://www.nag.com/nagware/np/doc_index.asp NAG Compiler Documentation Index]
* [http://www.nag.com/nagware/np.asp NAG Compiler Product Page]

Latest revision as of 13:55, 23 October 2024


The NAGWare Fortran compiler is available under /opt/common/NAGWare_f95* on our supported Red Hat Enterprise Linux (RHEL) and Ubuntu hosts. You can either load the binaries into your environment using GNU Modules, reference the paths directly, or 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!" 
END

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
/opt/common/NAGWare_f95-5.1/bin/f95

Compile and then run the program:

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

See Also