mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]

Instructions for building and installing the Automatically Tune Linear Algebra Software (ATLAS)

Note
As of 2017-Sep-1 I am finding ATLAS to be difficult to install on the latest Intel CPUs, because it is difficult to turn off frequency scaling. I have switched to using the Intel MKL.

Folow these steps to build an ATLAS based BLAS and Lapack library.

  1. download, but do not unpack, the latest LAPACK library from http://www.netlib.org/lapack/
  2. download ATLAS (http://math-atlas.sourceforge.net/), unpack. It's a good idea to rename it to ATLASX.XX.XX. In the ATLASX.XX.XX directory, make a 'LINUX' directory, or whatever seems like a good name for your system.
  3. Turn off frequency scaling:
    • Ubuntu:
      1. cpufreq-info --> note that it references the ondemand governor
      2. sudo vi /etc/default/cpufrequtils --> create if this file doesn't exist
        • add: GOVERNOR="performance"
      3. sudo /etc/init.d/cpufrequtils restart
      4. cpufreq-info --> where before it referenced the ondemand governor, now it says performance
    • CentOS:
      1. edit /etc/sysconfig/cpuspeed, setting GOVERNOR=performance
      2. restart cpuspeed: /etc/init.d/cpuspeed restart
      3. output should say "enabling performance cpu frequency scaling"
  4. Build Atlas:
    • In the 'LINUX' directory, run configure:

      ../configure -b 64 --with-netlib-lapack-tarfile=/path/to/lapack-X.Y.Z.tgz -D c -DPentiumCPS=2800 -Fa alg -fPIC --shared
      constexpr units::realT c()
      The speed of light.
      Definition: constants.hpp:60
      Note
      modify the path to the lapack tarball appropriately
      -fPIC may not be necessary along with –shared
      the -D c -DPentiumCPS=2800 flag tells ATLAS to use the highest accuracy clock, and the '2800' corresponds to processor speed in MHz. This can be found in cpufreq-info on ubuntu, or with lscpu.
    • In interfaces/lapack/C2F/src/Make.inc add -frecursive to:

      F77FLAGS = -O2 -mavx -fPIC -m64 -fPIC -frecursive
      Note
      this is possibly necessary to make dyevr thread safe, maybe syevr too.
    • Now make

      1. make build
      2. make check
      3. make time
      4. make shared
      Note
      there should be no non-ignored errors at each of these steps
    • Now install
      1. sudo make install