I did this on a cluster using Intel Xeon CPUs and CentOS 5.4(equivalent to Red Hat Enterprise Linux 5.4). I think this note also works for other Linux distributions, if you wanna compile ATLAS from scratch. You may do so to prepare other software that needs ATLAS, such as numpy.
Step 1: download and prepare files
1.1 Get to ATLAS project homepage to download ATLAS. The version I downloaded was ATLAS 3.9 http://math-atlas.sourceforge.net/
1.2 Get LAPACK from LAPACK project homepage http://www.netlib.org/lapack/ The version I downloaded was 3.2.1. The file name is lapack.tgz.
1.3 Make sure to place LAPACK and ATLAS source package (in either tar.gz or tar.bz2 balls)
1.4 Extract ATLAS source package. A folder named ATLAS should be created.
Step 2: Compile ATLAS into static library (with LAPACK)2.1
cd ATLAS2.2 Create a folder. I called it
mkdir DONEFrom now on, everything remaining is done under the folder DONE, either under
../configure -Fa alg -fPIC --with-netlib-lapack-tarfile=../../lapack.tgz2.3
Step 3: Compile ATLAS static library into dynamic library (optional, but you need this step mostly)
cd ../lib(lib under DONE)
F77SYSLIBvariable from Intel Fortran library into your gcc Fortran library (Optional. On my computer, Intel and GNU environmental variables are messed up coz my system administrator installed Intel C Compiler with Intel C Library whereas I always go GNU.)
On my computer, I change the line
F77SYSLIB = -L/opt/intel/Compiler/11.1/056/lib/intel64 -lgfortraninto
F77SYSLIB = -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -lgfortran
On my computer, after step 3.2, I change the line
F77SYSLIB = -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -lgfortraninto
F77SYSLIB = -L/usr/lib/gcc/x86_64-redhat-linux/4.1.2 -lgfortranbegin
Makefile. Change the
DESTDIRlibrary if your installation destination is not
/usr/local/atlas. This variable is not set accordingly if you use
On my computer, I manually set it to the directory of compiled ATLAS library. Thus, change line
3.5 Make into dynamic library.
Step 4: Set environmental variables
4.1 Set a variable
ATLAS, pointing to the
libfolder under DONE. On my computer, I add this line into my
On my computer, I add this line into my
4.3 Activate new environmental variables
You can either source
~/.bashrcor simply log out and re-login in.
Step 5: Test ATLAS
ATLAS source package comes with several examples. You can run them to test.
cd ../bin make xdlutst_dyn ./xdlutst_dyn
If you run into the error like
./xdlutst_dyn: error while loading shared libraries: /usr/local/atlas/lib/libf77blas.so: cannot open shared object file: No such file or directory, go back to step 3.5. Delete
make shared. Then come back to step 5.