4.7) GNU: Loading And Using The Compiler
As mentioned before the Intel compilers are loaded by default on ARC2, to switch to the GNU compilers use the module command, e.g.:
$ module switch intel gnu/4.8.1
This will add the specified GNU compilers to your environment.
Basic compilation follows in an identical way to the Intel compilers, using gfortran
and g77
for Fortran 90/77, gcc
for C and g++
for C++.
E.g. for Fortran 90
$ gfortran –o hello hello.f90
As with the Intel compilers, various levels of optimisation are available through the –O0, -O1, -O2 and -O3 flags. The default is –O0, no optimisation. See man pages for compiler options and their description.