CHPC actively supports several different compilers. The GNU Compiler Suite includes ANSI C, C++ and Fortran 77 compilers. In addition to GNU compilers, we offer two commercial compiler suites. The Intel compilers generally provide superior performance on the Intel CPUs. They include C, C++ and Fortran 77/90/95. We also have a license for the PGI compilers. All three compiler have OpenMP support (supported OpenMP version varies with the compiler). The Portland Group Compiler Suite also supports OpenACC for GPU programming.
All three C compilers interoperate with each other. Interoperation with Fortran is
more difficult, separate libraries can be linked if one also links the apropriate
compiler Fortran runtime library (e.g.
-lgfortran for gfortran), but on the module level the compilers are not compatible. Therefore
we recommend to stick to a single Fortran compiler for the whole code if possible.
We also may have other compilers, such as LLVM, though, we don't actively update them. If you need an update, please let us know at firstname.lastname@example.org.
To enable each compiler, and the software stack that was built with this compiler, one needs to load the compiler module as described below. When using the compiler, you may need to modify or set flags for makefiles or other build tools (e.g. CMake) provided by third party developers.
For help with compiler issues, please contact the CHPC help desk at email@example.com.
The current version is 4.8.5, that is shipped with CentOS 7 that is run on our systems.
For those needing newer version, run
module spider gcc to get a list of available versions. Note that different versions may have different
software stack built with them. In general, we build most of the dependencies with
the stock gcc 4.8.5 and provide limited stack for the higher versions based on demand.
CentOS 7 ships with version 4.8.5, however, some advanced compiler features, such as C++11 standard, are supported only from 4.9 series, therefore a number of third party software is built with gcc 4.9.2 on CentOS 7.
The system GNU distribution is located in the default areas: /usr/bin, /usr/lib or /usr/lib64 for libraries, /usr/include for headers, etc. The user should not need to do anything else than to invoke the compiler by its name, e.g.:
gcc source.c -o executable
gfortran source.f -o executable
But to make available libraries and binaries built with gcc 4.8.5, one does need to
load the (default) module:
module load gcc (or module load gcc/4.8.5)
To e.g. use newer gcc 4.9.2, load the following module, or put to your .custom.sh
shell init file:
module load gcc/4.9.2
Documentation on the GNU compilers can be found at the GCC site.
Multiple versions of the Intel C and Fortran compiler suite are located at /uufs/chpc.utah.edu/sys/installdir/intel.
To find the default compiler version, use the -v flag (ie, icc -v, ifort -v, or icpc -v). Older version can be obtained by loading the particular module, run
module spider intel to find what versions are available.
In order to use the compiler, users have to load the module that defines paths and some other environment variables.
module load intel
The compilers are invoked as icc, icpc and ifort for C, C++ and F90, respectively. For list of available flags, use the man pages
We generally recommend flag -fast for superior performance, however, some of the optimizations using this flag may
lose precision for floating-point divides. Also note that one can build optimized
executable that runs multiple CPU architectures, for CHPC clusters use
-axCORE-AVX512,CORE-AVX2,AVX. See our Single Executable page for details. This option runs but does not generate vectorized code for the
Ember and some Lonepeak nodes. As of version 18 we have seen issues with compiling
more complex code with the wider encompassing
-axCORE-AVX512,CORE-AVX2,AVX,SSE4.2 option which does vectorize on Ember. Therefore our recommendation is to try to
compile including the
SSE4.2 option and if there are problems, remove it. The code will still run on Ember, but
utilize the generic x86 code path which is included whenver the
-ax option is used.
For more information on the compilers,visit the Intel compiler site.
Documentation including user's guide, language reference, etc. can be found in the Intel Software Documentation Library.
The latest version of Portland Group compilers are located at: /uufs/chpc.utah.edu/sys/installdir/pgi.
To find the compiler version, use flag -V, i.e. pgcc -V.
In order to use the compiler, users have to load the module that defines paths and some other environment variables. The default usually points to the latest version.
module load pgi
The compilers are invoked as pgcc, pgCC, pgf77 and pgf90 for C, C++, F77 and F90, respectively. For list of available flags, use the man pages (e.g. man pgcc).
We generally recommend flag -fastsse for good performance.
For more information on the compiler, visit Portland Group website.
Documentation including user's guide, language reference, etc. can be found here.