Fortran, C and C++ compilers produced by the GNU Project.
Availability and Restrictions
Versions
The GNU Compiler Collection (GCC) are available on all our clusters. These are the versions currently available:
| Version | Pitzer | Ascend | Cardinal | Notes |
|---|---|---|---|---|
| 11.4.1 | X# | X# | X# | |
| 12.3.0 | X | X | X* | |
| 13.2.0 | X | X | X |
# System version
Modules
You can use module spider gcc to view available modules for a given machine. Feel free to contact OSC Help if you need other versions for your work.
To find out what version of gcc you are using, type gcc --version.
Access
The GNU compilers are available to all OSC users. If you have any questions, please contact OSC Help.
Publisher/Vendor/Repository and License Type
https://www.gnu.org/software/gcc/, Open source
Usage
Usage on Pitzer
Set-up
module load gcc/version. For example, use module load gnu/8.1.0 to load GNU 8.1.0.How to Compile
Once the module is loaded, follow the guides below for compile commands:
| LANGUAGE | NON-MPI | MPI |
|---|---|---|
| Fortran 90 or 95 | gfortran |
mpif90 |
| Fortran 77 | gfortran |
mpif77 |
| c | gcc |
mpicc |
| c++ | g++ |
mpicxx |
Building Options
The GNU compilers recognize the following command line options :
| COMPILER OPTION | PURPOSE |
|---|---|
-fopenmp |
Enables compiler recognition of OpenMP directives (except mpif77) |
-o FILENAME |
Specifies the name of the object file |
-O0 or no -O option |
Disable optimization |
-O1 or -O |
Ligh optimization |
-O2 |
Heavy optimization |
-O3 |
Most expensive optimization (Recommended) |
There are numerous flags that can be used. For more information run man <compiler binary name>.