Hippu User's Guide > Program development > Compilers
Tehdyt toimenpiteet

Compilers

This section gives an introduction to using the compilers on Hippu.

The default Fortran and C/C++ compilers used on Hippu are Portland Group (PGI) compilers: Fortran 77 and 90/95, C and C++.

Also, the Qlogic PathScale Compiler Suite (EKOPath) compilers for Fortran 77 and 90/95, C and C++ are also installed.

In addition, the GNU Compiler Collection (GCC) is installed on Hippu. The Gnu compilers are gcc, g++ and  gfortran (Fortran 90/95).

Finally, also the Intel Compilers Professional Edition suite for Fortran 90/95, C and C++ is available.

There may be older and newer versions of these compiler packages. You can see these using the commands module avail, module avail PrgEnv, module avail pgi, module avail pathscale, module avail gcc, and module avail intel.


The compiler package in use is selected by the module system, see the section Module environment. You can also check and load older (non-default) versions of the compiler suites with the module system. The default compiler package is the PGI set.


This section contains the following subsections:

  1. Fortran
  2. C and C++

For compiling serial codes, one can use either the explicit compiler commands, e.g., pgf95, pathf95 or gfortran, or the generic aliases such as f90 which refer to the compiler of the loaded programming environment. The generic compiler commands available are f77, f90, f95, cc, c89, c99, and CC.

The following table lists the different compilers in the PGI set:

Languageq
Compiler
File suffix
Fortran 90/95 pgf90, pgf95
.f90, .f95, .F90, .F95
FORTRAN 77
pgf77
.f, .F, .FOR
High Performance Fortran
pghpf
.hpf
ANSI/ISO C89/C99
pgcc .c, .i
ANSI/ISO C++
pgCC
.C, .cc, .i

The following table lists the different compilers in the PathScale Compiler Suite:

Language Compiler File suffix
Fortran 90/95 pathf90, pathf95 .f90, .f95, .F90, .F95
FORTRAN 77 pathf90, pathf95 .f, .F
ANSI/ISO C99 pathcc .c, .i
ANSI/ISO C++ pathCC .C, .cc, .c++, .C++, .ii, ...

The available compilers in the GNU Compiler Collection are:

Language
Compiler
File suffix
Fortran 90/95 (v. 4.X only)
gfortran
.f90, .f95, .f, .F90, .F95, .F
FORTRAN 77 (v. 3.X only)
g77
.f, .F
C (option -std specifies standard) gcc .c, .i
C++ (option -std specifies standard) g++ .C, .cc, .ii, ...


The following table lists the different compilers in the Intel compiler suite:

Language
Compiler
File suffix
Fortran 90/95
ifort
.f90, .f95, .f, .F90, .F95, .F
FORTRAN 77
ifort
.f, .F
C (option -std specifies standard) icc .c, .i
C++ (option -std specifies standard) icc .C, .cc, .ii, ...


For more information, see the subsections on appropriate compilers.

In addition, Hippu has several versions of Java and Python available via modules.


Options

The options available for the PGI, PathScale, GCC, and Intel compiler suites can be found from their man pages: man pgf90, man pgcc, man pathf95, man pathcc, man eko or man ekopath (the complete list of options and flags for the PathScale Compiler Suite), man gcc, man gfortran, man ifort, or man icc, for example, when the corresponding programming environment is loaded: PrgEnv-pgi, PrgEnv-pathscale, PrgEnv-gnu, or PrgEnv-intel. You can also refer to the PGI, PathScale, GCC, Intel(fortran), Intel(C/C++)  on the Web.

The following table shows some options that are common for all the compilers:

Option Description
-c Compiles only, produces unlinked object filename.o
-o filename Gives the name filename for the executable. Default: a.out
-g Produces symbolic debug information
-Idirname Searches directory dirname for include files or module files
-Ldirname Searches directory dirname for for library files specified by -l
-llibname Searches the specified library file with the name liblibname.a
-pg Writes profiling information for gprof
-O[level] Specifies whether to optimize or not and at which level level
-Wl,-M Generates a loader map to stdout


Compilation examples

For examples on how to use the compiler commands, see the appropriate compiler section.