Changing the compilers and flags that ATLAS uses for the build

ATLAS defines eight different compilers and associated flag macros in its Make.inc which are used to compile various files during the install process. ATLAS's configure provides flags for changing both the compiler and flags for each of these macros. In the following list, the macro name is given first, and the configure flag abbreviation is in parentheses:

  1. XCC (xc): C compiler used to compile ATLAS's build harness routines (these never appear in any user-callable library)
  2. GOODGCC (gc): gcc with any required architectural flags (eg. -m64), which will be used to assemble cpp-enabled assembly and to compile certain multiple implementation routines that specifically request gcc
  3. F77 (if): FORTRAN compiler used to compile ATLAS's FORTRAN77 API interface routines.
  4. ICC (ic): C compiler used to compile ATLAS's C API interface routines.
  5. DMC (dm): C compiler used to compile ATLAS's generated double precision (real and complex) matmul kernels
  6. SMC (sm): C compiler used to compile ATLAS's generated single precision (real and complex) matmul kernels
  7. DKC (dk): C compiler used to compile all other double precision routines (mainly used for other kernels, thus the K)
  8. SKC (sk): C compiler used to compile all other single precision routines (mainly used for other kernels, thus the K)

It is almost never a good idea to change DMC or SMC, and it is only very rarely a good idea to change DKC or SKC. In most cases, switching these compilers will get you worse performance and accuracy, even when you are absolutely sure it is a better compiler and flag combination! For the open source version of clang, gcc was always faster on all machines we had access to. Apple's proprietary clang seems to be a good deal faster, so OS X user's may want to try a search with both clang and gcc to see which is the fastest if both are available. See Section [*] for how to force clang to be used. Intel's icc was not tried for this release since it is a non-free compiler, but even worse, from the documentation icc does not seem to have any firm IEEE floating point compliance unless you want to run so slow that you could compute it by hand faster. This means that whenever icc achieves reasonable performance, I have no idea if the error will be bounded or not.

There is almost never a need to change XCC, since it doesn't affect the output libraries in any way, and we have seen that changing the kernel compilers is a bad idea. Under Unix, most compilers interoperate with the GNU compilers, and so you can build ATLAS with the GNU compilers, and then simply link to the resulting libs with the compiler of your choice.

On Windows, if you want to build ATLAS for linking with native libraries such as MSVC++, then you can build ATLAS with the MinGW compilers, which are GNU compilers that are made to natively interoprate with native Windows compilers. See Section [*] for more information.

For those who insist on monkeying with other compilers, Section [*] gives some guidance. Finally installing ATLAS without a FORTRAN compiler is discussed in Section [*].



Subsections
R. Clint Whaley 2016-07-28