Fortran

The users have at their disposal several versions of Fortran (77/90/95) compilers.

GNU Compiler

GNU developped Fortran (77/90/95) compilers delivered with the Linux system. Please follow the software loader syntax to list and activate the required compiler version.

g77 is the GNU compiler for Fortran77. To know the compiler options:

% man g77

Compiling syntax example:

% g77 -O -c test.f

If your program is using CERN libraries routines (CERNLIB), you should use the command cernlib in order to define the librairies names. Here is an example how to compile, create the executable module and execute the test program:

% g77 -O -o test  test.f  `cernlib` -lm
% ./test

Attention

You should use the backquotes with cernlib!

PGI compilers

CC-IN2P3 has some number of licences (via FlexLM) for the Fortran (77/90/95) compilers supplied by PGI (Portland group). In order to compile your program, follow the software loader syntax to list and activate the required compiler version.

You can use also the debuggers and the profiler: pgdbg and pgprof.

Please find here the offcial PGI documentation.

pgf77 is the PGI compiler for Fortran77 language. To see the compiler options use:

% man pgf77

Compiling syntax example:

% pgf77 -O -c test.f

If you need to edit the links (linker) and execute your program with the (CERNLIB), you should add the libg2c.a which is supplied with g77 compiler (the CERNlib compiler):

% set g2c = '-lg2c'
% pgf77 -O -o test test.f `cernlib` -lm ${g2c}
% ./test

Intel Compiler

CC-IN2P3 provides some number of licences (via FlexLM) for the compilers supplied by Intel .

This software contains the C/C++ and Fortran compilers with the interactive debug idb and with the libraries:

  • MKL (Math Kernel Library)

  • IPP (Integrted Performance Primitives)

  • Threading Building Blocks for Linux

In order to compile your program, follow the software loader syntax to list and activate the required compiler version. To see the compiler options use:

% man ifort

Please find here the offical Intel C++ documentation.

Compiling syntax example:

% ifort -O -c test.f

In Fortran 77, if you are using the CERNLIB, you should add the library libg2c.a available with g77 compiler. The same comment is true for any other library compiled with g77 (like NAG library, for example).

% set g2c = '-lg2c'
% ifort -O -o test  -nofor_main  test.f  `cernlib`  -lm  ${g2c}
% ./test

NAG Libraries

Please follow the software loader syntax to list and activate the required compiler version.

For a complete documentation, please refer to the provider’s site.

NAG Compiler

CC-IN2P3 has a number of licences for the Fortran 95 compiler supplied by NAG. To compile your source code with this compiler, load the f95 environment.