The CSF2 has been replaced by the CSF3 - please use that system! This documentation may be out of date. Please read the CSF3 documentation instead. To display this old CSF2 page click here. |
GNU Compilers
Overview
The GNU Compiler Collection supports a number of programming languages.
Several versions are available on the CSF – please see the table below.
Programming in Fortran or C is currently beyond the scope of this webpage. IT Services for Research run training courses which may be of interest.
Restrictions on use
Code may be compiled on the login node, but aside from ‘very’ short test runs (e.g., one minute on fewer than 4 cores), executables must always be run by submitting to the batch system, SGE.
Set up procedure
This depends on which version you require.
Version | Commands/compilers available | Module required | Additional Notes |
3.4.6 | gcc34, g++34 | None | |
4.4.7 | gcc, g++, gfortran | None | This is considered the system default |
4.6.2 | gcc, g++, gfortran | module load compilers/gcc/4.6.2 | |
4.7.0 | gcc, g++, gfortran | module load compilers/gcc/4.7.0 | |
4.8.2 | gcc, g++, gfortran | module load compilers/gcc/4.8.2 | |
4.9.0 | gcc, g++, gfortran | module load compilers/gcc/4.9.0 | |
6.3.0 | gcc, g++, gfortran | module load compilers/gcc/6.3.0 |
By loading/swapping modules, the correct LD_LIBRARY_PATH
will be set.
Running the application
Example Code Compilations
gcc hello_world.c -o hello # # ...produces executable binary called "hello"... # gfortran hello_fworld.f77 -o f77hello gfortran hello_fworld.f95 -o f95hello # # ...produce executable binary called "f77hello" or "f95hello"... #
Serial batch job submission
To submit a single core batch job to SGE:
- Make sure you have the correct module loaded if appropriate (see table above).
- An example SGE qsub script for use with a binary executable called myfortranprog compiled by using the GNU compilers:
## SGE stuff ### Use the current/submission directory as the working directory #$ -cwd ### Inherit the user environment settings from the login node (important so the job can find all commands) #$ -V ./myfortranprog
- To submit:
qsub jobscript # # where 'jobscript' is replaced with the name of your file #
Parallel batch job submission
Your code, and thus the resulting executable, must use either OpenMP and/or MPI in order to run in parallel. Please follow these links to find out how to submit batch of these types to SGE:
Further info
- Online manuals available from the command line:
man gcc # for the C/C++ compiler man gfortran # for the fortran compiler
- GNU Compiler Collection website
- Training Courses run by IT Services for Research.
- If you require advice on programming matters, for example how to debug a code, or how to use MKL, please email its-ri-team@manchester.ac.uk
Updates
During the August 2012 OS upgrade 4.1.2 was replaced by 4.4.6 and 4.3.5 was replaced by 4.6.2 and 4.7.0.
April 2014 – Version 4.8.2 installed. June 2015 – 4.9.0 installed.