Compiling on the Brazos Cluster
The GNU and Intel C, C++, and FORTRAN compilers are available on the Brazos cluster.
The lines below may be split in your browser window. Each command should be on a single line when you enter it into your command shell.
For the GNU compilers load the appropriate environment into your shell using
module load gcc
This will load a version of GCC (4.8.2 as of this writing) that is considerably newer than that shipped with CentOS 6.
|C||gcc -O3 myfile.c -o myfile -lm -s|
|C++||g++ -O3 myfile.cc -o myfile -lm -s|
|FORTRAN 77||gfortran -O3 myfile.f -o myfile -s|
|FORTRAN 90||gfortran -O3 myfile.f90 -o myfile -s|
Other useful GNU compiler options: -fomit-frame-pointer -funroll-loops
For the Intel compilers load the appropriate environment into your shell using
module load intel
|C||icc myfile.c -o myfile -s|
|C++||icpc myfile.cc -o myfile -s|
|FORTRAN 77||ifort myfile.f -o myfile -s|
|FORTRAN 90||ifort myfile.f90 -o myfile -s|
You can use the -fast option to the Intel compiler, but be careful. This option may affect floating-point accuracy. Check the man pages and online documentation for this and additional optimization flags.
The -s option will cause the final executable to be stripped of its symbol information, resulting in a smaller executable file.
Note, by default the compilers will produce 64-bit executables.
We have discontinued support for the PGI compilers as of the EL6 upgrade to the Brazos cluster. If you really need the PGI compilers, please e-mail brazos-help //AT// listserv.tamu.edu.