GCC¶
GNU Compiler Collection (GCC) is one of the most popular compilers for compiling C, C++ and Fortran programs.
In Triton we have various GCC versions installed, but only some of them are actively supported.
Basic usage¶
Hello world in C¶
Let’s consider the following Hello world-program
(hello.c
)
written in C.
#include <stdio.h>
int main()
{
printf("Hello world.\n");
return 0;
}
After downloading it to a folder, we can compile it with GCC.
First, let’s load up a GCC module:
module load gcc/8.4.0
Secondly, let’s compile the code:
gcc -o hello hello.c
Now we can run the program:
./hello
This outputs the expected Hello world-string.
Available installations¶
System compiler is installed only on the login node. Other versions of GCC are installed as modules.
GCC version |
Module name |
---|---|
4.8.5 |
none (on login node only) |
8.4.0 |
gcc/8.4.0 |
9.3.0 |
gcc/9.3.0 |
11.2.0 |
gcc/11.2.0 |
If you need a different version of GCC, please send a request through the issue tracker.
Old installations¶
These installations will work, but they are not actively updated.
GCC version |
Module name |
---|---|
6.5.0 |
gcc/6.5.0 |
9.2.0 |
gcc/9.2.0 |
9.2.0 with (CUDA offloading) |
gcc/9.2.0-cuda-nvptx |
Other old installations are not recommended.