Compilers in TCM
TCM offers a wide variety of different compilers for Fortran, C and C++. Different compilers differ in the usefulness of their warning and error messages when faced with buggy code, their degree of standards compliance, their degree of optimisation, and their own level of bugginess.
In general one can freely mix C compilers when building programs, but not Fortran compilers. This is because all C compilers will be compatible with the system C libraries, and thus use the same calling conventions. There are no system Fortran libraries, so compilers are free to invent their own ways of storing and passing Fortran's data structures. They do, in an incompatible fashion.
This has unfortunate consequences: one needs to ensure that libraries such as MPI are built with the same Fortran compiler that one uses for the rest of one's code, and a single system Fortran MPI library is unlikely to cope with all installed compilers, so we need to install our own local versions of MPI. Similar arguments hold for other Fortran libraries (save that Fortran 77 libraries are quite likely to be more portable).
GCC
Gnu Compiler Collection: gcc, g++ gfortran, and, for MPI, mpgcc, mpg++, mpgfortran. Free and GPLed.
Lapack: -llapack -lblas
(actually OpenBLAS, defaults to
threaded, specify OMP_NUM_THREADS=1
at run-time for
serial version).
Debugger: gdb
.
The default version of this compiler will be whatever the default is on the version of Ubuntu installed on any given TCM computer. Other versions may be available by adding suffixes to the name, eg gcc-10, g++-10 and gfortran-10.
LLVM
As provided by Ubuntu: clang, clang++. Free, GPLed, and hight gcc-compatible.
Currently one needs to use AOCC (see below) for a Fortran LLVM-based compiler.
The default version of this compiler will be whatever the default is on the version of Ubuntu installed on any given TCM computer. Other versions may be available by adding suffixes to the name, eg clang-10 and clang++-10.
Intel
Intel's compilers: icc, icpc, ifort, and, for MPI, mpicc, mpicpc, mpifort. Not free for academic use, but we purchase an annual licence.
Lapack: -mkl
(threaded
version), -mkl=sequential
(serial version). (N.B. this
bizarre option should be placed where one usually places libraries,
i.e. after source files on the command line.)
Debugger: gdb
or gdb-ia
.
Many different versions of this suite are installed in TCM, and one can switch at compile time by setting TCM_INTEL_VER, e.g.
$ export TCM_INTEL_VER=18.0.2 $ make
(My interpretation of Intel's free licence for students and "classroom educators" is that it probably applies to undergraduates, probably does not to research students, particularly if in receipt of a grant, and certainly does not apply to the research of postdocs, lecturers, etc.)
Intel oneAPI
At the time of writing (January 2021), Intel's oneAPI product includes the above compilers (with much broader qualification for a free licence which you probably meet), and also a set of new, LLVM-based, compilers, icx, icpx, ifx and dpcpp. These are installed, but are described as being of "beta" quality, and rough edges are certainly easy to find. The Fortran compiler, ifx, is object and module file compatible with ifort, but its command line options differ. MKL is still linked as above though.
Note that oneAPI also causes a change to the numbering of Intel's more mature compilers. So 19.1 is followed by 2021.1.
NAG
NAG's Fortran compiler: nagfor and, for MPI, mpnagfor.
Lapack: -lacml
.
Debugger: gdb
or dbx90
.
The NAG compiler is intended solely as a debugging aid. The code it produces runs very slowly, as it "compiles" to C, and then feeds the result to gcc. However, under the terms of the current site-wide NAG licence, it is free, even to undergraduates. There is no corresponding C or C++ compiler.
PGI / Nvidia
Portland Group: pgcc, pgc++ and pgf90 or pgfortran.
After take-over by Nvidia: nvc, nvc++ and nvfortran, but currently the old names are also supported.
Lapack: -llapack -lblas
Debugger: gdb
(old versions, pgdbg
)
We currently have installed the free Community Edition of PGI's compiler suite.
AOCC
AMD Optimising C/C++ Compiler: clang-amd, clang++-amd and flang-amd (so Fortran is included).
Lapack: -lflame -lblis -laoclutils
(serial), -lflame
-lblis-mt -laoclutils
(threaded, number of threads controlled by
BLIS_NUM_THREADS.)
The addition of -laoclutils
is needed for AOCC 4.2 and later.
Failure to add it leads to libaoclutils not being found at run-time.
Debugger: gdb
One can switch between versions of this compiler suite in TCM by setting the environment variable TCM_AOCC_VER in a similar fashion to TCM_INTEL_VER.
This compiler is distributed under an odd no-cost licence: "[you may] use the Software solely in conjunction with AMD product-based systems or AMD components, as applicable." Clearly we may use it on our machines with AMD CPUs. May we on our machines with Intel CPUs and the x86_64, also known as AMD64, instruction set invented by AMD? Unclear, although AMD could very easily have prevented this had it so wished, and it has not.
Others
We used to have PathScale (now dead), Open64 (now dead) and
Sun/Oracle
(not very alive: suncc, sunCC and sunf95, lapack
is -library=sunperf
, and debugger
is sundbx
).
MPI
In general we name our MPI compilers by prefixing "mp" to the standard compiler's name. Others may be available than those listed above, and availablility may depend on which version of MPI one uses.