Difference between revisions of "ATLAS"

From CBLFS
Jump to navigationJump to search
m
 
(4 intermediate revisions by the same user not shown)
Line 4: Line 4:
 
|http://downloads.sourceforge.net/math-atlas/atlas{{ATLAS-Version}}.tar.bz2
 
|http://downloads.sourceforge.net/math-atlas/atlas{{ATLAS-Version}}.tar.bz2
 
|-
 
|-
!Download Patch:
 
|http://svn.cross-lfs.org/svn/repos/patches/atlas-{{ATLAS-Version}}/atlas-{{ATLAS-Version}}-shared-libs-1.patch
 
|-
 
!Download Patch:
 
|http://svn.cross-lfs.org/svn/repos/patches/atlas-{{ATLAS-Version}}/atlas-{{ATLAS-Version}}-decl-fix-1.patch
 
 
|}
 
|}
  
Line 14: Line 9:
  
 
{{Package-Introduction|BLAS are '''B'''asic '''L'''inear '''A'''lgebra '''S'''ubprograms written in Fortran.  There are Level 1 (scalar and vector operations), Level 2 (scalar-matrix operations) and Level 3 (matrix-matrix operations) subprograms.  ATLAS (Automatically Tuned Linear Algebra Software) will provide C and FORTRAN interfaces to a BLAS implementation optimized for a specific machine architecture.  The ideal source of BLAS and LAPACK libraries are those provided by the microprocesor vendor such as AMD's [[ACML]].  However, these are not provided under a license that allows re-distribution without written consent from the vendor.|http://www.netlib.org/blas/}}
 
{{Package-Introduction|BLAS are '''B'''asic '''L'''inear '''A'''lgebra '''S'''ubprograms written in Fortran.  There are Level 1 (scalar and vector operations), Level 2 (scalar-matrix operations) and Level 3 (matrix-matrix operations) subprograms.  ATLAS (Automatically Tuned Linear Algebra Software) will provide C and FORTRAN interfaces to a BLAS implementation optimized for a specific machine architecture.  The ideal source of BLAS and LAPACK libraries are those provided by the microprocesor vendor such as AMD's [[ACML]].  However, these are not provided under a license that allows re-distribution without written consent from the vendor.|http://www.netlib.org/blas/}}
 
== Configuration Information ==
 
 
Patch the package:
 
 
patch -Np1 -i ../atlas-{{ATLAS-Version}}-decl-fix-1.patch &&
 
patch -Np1 -i ../atlas-{{ATLAS-Version}}-shared-libs-1.patch
 
 
Create a wrapper script to assist in building the shared libraries:
 
 
export BUILD_DIR=CBLFS-build &&
 
mkdir -pv ${BUILD_DIR} &&
 
cd ${BUILD_DIR}
 
 
cat > war << "EOF"
 
#! /bin/bash
 
#
 
# war -- wrapper for the archiver
 
#
 
# Executed by ATLAS build as:
 
# full_path/war ARCHIVER ARFLAGS LIBNAME.a OBJS.lo
 
 
TOPDIR=$(echo $0 | sed 's/\(.*\)\/.*/\1/')
 
PWD=$(pwd)
 
 
ARCHIVER=$1
 
LIBRARY=$(echo $3 | sed 's/.*\/\(.*\)/\1/')
 
OBJ_DIR=${TOPDIR}/CBLFS/$LIBRARY
 
 
if [ ! -x $OBJ_DIR ]; then mkdir -p ${OBJ_DIR}/.libs; fi
 
 
$ARCHIVER $@
 
 
shift 3
 
for obj in $@ ; do
 
    lobj=$(echo $obj | sed 's/\.o/\.lo/')
 
    ln -sf ${PWD}/$obj ${OBJ_DIR}/$obj
 
    ln -sf ${PWD}/$lobj ${OBJ_DIR}/$lobj
 
    ln -sf ${PWD}/.libs/$obj ${OBJ_DIR}/.libs/$obj
 
done
 
EOF
 
 
Make the script executable:
 
 
chmod a+x war
 
  
 
== Non-Multilib ==
 
== Non-Multilib ==
  
{{Note|Either create a BUILD variable similar to the multiarch BUILD32, BUILDN32, and BUILD64 with compiler options or replace ${BUILD} in the configure flags below with your compiler options directly.}}
+
First, build the [[LAPACK]] libraries, then compile the package:
 
 
{{Note|Replace the <BITS> in the configure command below with 32 or 64 as appropriate for your non-multilib architecture.}}
 
  
{{Note|On some systems the make step fails. If this happens to you, try
+
  mkdir build &&
  sed -i "/RANLIB/s/echo/ranlib/" Make.inc
+
  cd build &&
after running configure, but before running make.}}
+
  ../configure --prefix=/usr \
   
+
--with-netlib-lapack=$PWD/../../lapack-{{Lapack-Version}}/lapack_LINUX.a \
Compile the package:
+
  -Fa alg -fPIC -b 32 &&
 
+
sed -i "/RANLIB/s/echo/ranlib/" Make.inc &&
  ../configure --cc=gcc --cflags="${BUILD}" --prefix=/usr --incdir=/usr/include/atlas \
 
-C ac gcc -F ac "${BUILD}" -C if gfortran -F if "${BUILD}" -Ss pmake "\make -j3" \
 
  -Si cputhrchk 0 -b <BITS> &&
 
 
  make &&
 
  make &&
  export RPATH=/usr/lib/blas/atlas &&
+
  cd lib &&
  make LIBDIR=/usr/lib RPATH="${RPATH}" shared
+
  make shared &&
 
+
  make ptshared &&
Timing tests are critical for optimizing the performance of the libraries for your machine.  Do not skip the tests.
+
  cd ..
 
 
  for i in F77 C; do
 
    cd interfaces/blas/${i}/testing
 
    make sanity_test
 
    if <nowiki>[[ -d CBLFS/libptf77blas.a ]]</nowiki>; then
 
      make ptsanity_test
 
    fi
 
done
 
  cd ../../../../
 
make time
 
  
 
Install the package:
 
Install the package:
  
mkdir -pv ${RPATH} &&
+
  make install &&
cd ./CBLFS/libs &&
+
  cp -v lib/*so /usr/lib
cp -vP libatlas* ${RPATH} &&
 
cp -vP *blas* ${RPATH} &&
 
mkdir -pv /usr/include/atlas &&
 
install -v ../../../include/cblas.h /usr/include/atlas &&
 
install -v ../../../include/atlas_misc.h /usr/include/atlas &&
 
install -v ../../../include/atlas_enum.h /usr/include/atlas &&
 
install -v ../../include/*.h /usr/include/atlas
 
  
 
== Multilib ==
 
== Multilib ==
Line 107: Line 35:
 
=== 32Bit ===
 
=== 32Bit ===
  
Compile the package:
+
First, build the [[LAPACK]] libraries, then compile the package:
  
  ../configure --cc=gcc --cflags="${BUILD32}" --prefix=/usr --libdir=/usr/lib64 --incdir=/usr/include/atlas \
+
  mkdir build &&
-C ac gcc -F ac "${BUILD32}" -C if gfortran -F if "${BUILD32}" -Ss pmake "\make -j3" -Si cputhrchk 0 -b 32 &&
+
cd build &&
 +
CC="gcc ${BUILD32}" ../configure --prefix=/usr \
 +
--with-netlib-lapack=$PWD/../../lapack-{{Lapack-Version}}/lapack_LINUX.a \
 +
-Fa alg -fPIC -b 32 &&
 +
sed -i "/RANLIB/s/echo/ranlib/" Make.inc &&
 
  make &&
 
  make &&
  export RPATH=/usr/lib/blas/atlas &&
+
  cd lib &&
  make LIBDIR=/usr/lib RPATH="${RPATH}" shared
+
  make shared &&
 
+
  make ptshared &&
Timing tests are critical for optimizing the performance of the libraries for your machine.  Do not skip the tests.
+
  cd ..
 
 
  for i in F77 C; do
 
    cd interfaces/blas/${i}/testing
 
    make sanity_test
 
    if <nowiki>[[ -d CBLFS/libptf77blas.a ]]</nowiki>; then
 
      make ptsanity_test
 
    fi
 
done
 
  cd ../../../../
 
make time
 
  
 
Install the package:
 
Install the package:
  
mkdir -pv ${RPATH} &&
+
  make install &&
cd ./CBLFS/libs &&
+
  cp -v lib/*so /usr/lib
cp -vP libatlas* ${RPATH} &&
 
cp -vP *blas* ${RPATH} &&
 
mkdir -pv /usr/include/atlas &&
 
install -v ../../../include/cblas.h /usr/include/atlas &&
 
install -v ../../../include/atlas_misc.h /usr/include/atlas &&
 
install -v ../../../include/atlas_enum.h /usr/include/atlas &&
 
install -v ../../include/*.h /usr/include/atlas
 
  
 
=== N32 ===
 
=== N32 ===
  
Compile the package:
+
First, build the [[LAPACK]] libraries, then compile the package:
  
  ../configure --cc=gcc --cflags="${BUILDN32}" --prefix=/usr --libdir=/usr/lib64 --incdir=/usr/include/atlas \
+
  mkdir build &&
  -C ac gcc -F ac "${BUILDN32}" -C if gfortran -F if "${BUILDN32}" -Ss pmake "\make -j3" -Si cputhrchk 0 -b 32 &&
+
cd build &&
 +
CC="gcc ${BUILDN32}" ../configure \
 +
--prefix=/usr --libdir=/usr/lib32 \
 +
--with-netlib-lapack=$PWD/../../lapack-{{Lapack-Version}}/lapack_LINUX.a \
 +
  -Fa alg -fPIC &&
 +
sed -i "/RANLIB/s/echo/ranlib/" Make.inc &&
 
  make &&
 
  make &&
  export RPATH=/usr/lib32/blas/atlas &&
+
  cd lib &&
  make LIBDIR=/usr/lib32 RPATH="${RPATH}" shared
+
  make shared &&
 
+
  make ptshared &&
Timing tests are critical for optimizing the performance of the libraries for your machine. Do not skip the tests.
+
  cd ..
 
 
for i in F77 C; do
 
    cd interfaces/blas/${i}/testing
 
    make sanity_test
 
    if <nowiki>[[ -d CBLFS/libptf77blas.a ]]</nowiki>; then
 
      make ptsanity_test
 
    fi
 
done
 
  cd ../../../../
 
make time
 
  
 
Install the package:
 
Install the package:
  
mkdir -pv ${RPATH} &&
+
  make install &&
cd ./CBLFS/libs &&
+
  cp -v lib/*so /usr/lib32
cp -vP libatlas* ${RPATH} &&
 
cp -vP *blas* ${RPATH} &&
 
mkdir -pv /usr/include/atlas &&
 
install -v ../../../include/cblas.h /usr/include/atlas &&
 
install -v ../../../include/atlas_misc.h /usr/include/atlas &&
 
install -v ../../../include/atlas_enum.h /usr/include/atlas &&
 
install -v ../../include/*.h /usr/include/atlas
 
  
 
=== 64Bit ===
 
=== 64Bit ===
  
Compile the package:
+
First, build the [[LAPACK]] libraries, then compile the package:
  
  ../configure --cc=gcc --cflags="${BUILD64}" --prefix=/usr --libdir=/usr/lib64 --incdir=/usr/include/atlas \
+
  mkdir build &&
-C ac gcc -F ac "${BUILD64}" -C if gfortran -F if "${BUILD64}" -Ss pmake "\make -j3" -Si cputhrchk 0 -b 64 &&
+
cd build &&
 +
CC="gcc ${BUILD64}" ../configure \
 +
--prefix=/usr --libdir=/usr/lib64 \
 +
--with-netlib-lapack=$PWD/../../lapack-{{Lapack-Version}}/lapack_LINUX.a \
 +
-Fa alg -fPIC -b 64 &&
 +
sed -i "/RANLIB/s/echo/ranlib/" Make.inc &&
 
  make &&
 
  make &&
  export RPATH=/usr/lib64/blas/atlas &&
+
  cd lib &&
  make LIBDIR=/usr/lib64 RPATH="${RPATH}" shared
+
  make shared &&
 +
make ptshared &&
 +
cd ..
  
Timing tests are critical for optimizing the performance of the libraries for your machine.  Do not skip the tests.
+
Install the package:
 
 
for i in F77 C; do
 
    cd interfaces/blas/${i}/testing
 
    make sanity_test
 
    if <nowiki>[[ -d CBLFS/libptf77blas.a ]]</nowiki>; then
 
      make ptsanity_test
 
    fi
 
done
 
cd ../../../../
 
make time
 
  
Install the package:
+
  make install &&
 +
  cp -v lib/*so /usr/lib64
  
mkdir -pv ${RPATH} &&
 
cd ./CBLFS/libs &&
 
cp -vP libatlas* ${RPATH} &&
 
  cp -vP *blas* ${RPATH} &&
 
mkdir -pv /usr/include/atlas &&
 
install -v ../../../include/cblas.h /usr/include/atlas &&
 
install -v ../../../include/atlas_misc.h /usr/include/atlas &&
 
install -v ../../../include/atlas_enum.h /usr/include/atlas &&
 
install -v ../../include/*.h /usr/include/atlas
 
 
 
== Configuration Information ==
 
== Configuration Information ==
  
Line 214: Line 105:
 
  prefix=/usr
 
  prefix=/usr
 
  exec_prefix=${prefix}
 
  exec_prefix=${prefix}
  libdir=/usr/<LIB>/blas/atlas
+
  libdir=/usr/<LIB>
 
  includedir=${prefix}/include
 
  includedir=${prefix}/include
 
   
 
   
Line 221: Line 112:
 
  Version: 3.8.0
 
  Version: 3.8.0
 
  URL: http://math-atlas.sourceforge.net/
 
  URL: http://math-atlas.sourceforge.net/
  Libs: -L${libdir} -lblas -latlas
+
  Libs: -L${libdir} -latlas -lcblas -lf77blas -lptcblas -lptf77cblas
 
  Libs.private: -lm -lgfortran
 
  Libs.private: -lm -lgfortran
 
  EOF
 
  EOF
+
 
  cat > cblas.pc.in << "EOF"
+
  cat > lapack.pc.in << "EOF"
 
  prefix=/usr
 
  prefix=/usr
 
  exec_prefix=${prefix}
 
  exec_prefix=${prefix}
  libdir=/usr/<LIB>/blas/atlas
+
  libdir=/usr/<LIB>
 
  includedir=${prefix}/include
 
  includedir=${prefix}/include
 
   
 
   
  Name: cblas
+
  Name: lapack
  Description: Automatically Tuned Linear Algebra Software C BLAS implementation
+
  Description: Linear Algebra PACKage
 
  Version: 3.8.0
 
  Version: 3.8.0
 
  URL: http://math-atlas.sourceforge.net/
 
  URL: http://math-atlas.sourceforge.net/
  Libs: -L${libdir} -lcblas -latlas
+
  Libs: -L${libdir} -latlas -llapack
 
  Libs.private: -lm -lgfortran
 
  Libs.private: -lm -lgfortran
 
  Cflags: -I${includedir}
 
  Cflags: -I${includedir}
Line 243: Line 134:
  
 
  sed -i 's/<LIB>/lib/' blas.pc.in &&
 
  sed -i 's/<LIB>/lib/' blas.pc.in &&
  sed -i 's/<LIB>/lib/' cblas.pc.in &&
+
  sed -i 's/<LIB>/lib/' lapack.pc.in &&
 
  cp -v blas.pc.in /usr/lib/pkgconfig/blas.pc &&
 
  cp -v blas.pc.in /usr/lib/pkgconfig/blas.pc &&
  cp -v cblas.pc.in /usr/lib/pkgconfig/cblas.pc
+
  cp -v lapack.pc.in /usr/lib/pkgconfig/lapack.pc
  
 
=== N32 ===
 
=== N32 ===
  
 
  sed -i 's/<LIB>/lib32/' blas.pc.in &&
 
  sed -i 's/<LIB>/lib32/' blas.pc.in &&
  sed -i 's/<LIB>/lib32/' cblas.pc.in &&
+
  sed -i 's/<LIB>/lib32/' lapack.pc.in &&
 
  cp -v blas.pc.in /usr/lib32/pkgconfig/blas.pc &&
 
  cp -v blas.pc.in /usr/lib32/pkgconfig/blas.pc &&
  cp -v cblas.pc.in /usr/lib32/pkgconfig/cblas.pc
+
  cp -v lapack.pc.in /usr/lib32/pkgconfig/lapack.pc
 
   
 
   
 
=== 64-Bit ===
 
=== 64-Bit ===
  
 
  sed -i 's/<LIB>/lib64/' blas.pc.in &&
 
  sed -i 's/<LIB>/lib64/' blas.pc.in &&
  sed -i 's/<LIB>/lib64/' cblas.pc.in &&
+
  sed -i 's/<LIB>/lib64/' lapack.pc.in &&
 
  cp -v blas.pc.in /usr/lib64/pkgconfig/blas.pc &&
 
  cp -v blas.pc.in /usr/lib64/pkgconfig/blas.pc &&
  cp -v cblas.pc.in /usr/lib64/pkgconfig/cblas.pc
+
  cp -v lapack.pc.in /usr/lib64/pkgconfig/lapack.pc
 
   
 
   
 
== Contents ==
 
== Contents ==
Line 266: Line 157:
 
|-valign="top";
 
|-valign="top";
 
!Installed Libraries:
 
!Installed Libraries:
| libatlas.{a,so}, libcblas.{a,so}, libblas{.a,so}
+
| libatlas.{a,so}, libcblas.{a,so}, libf77blas.{a,so}, libptcblas.{a, so} libptf77cblas.{a, so}, liblapack.{a, so}
 
|}
 
|}
  
Line 279: Line 170:
 
|is the C library with optimized BLAS functions.
 
|is the C library with optimized BLAS functions.
 
|-valign="top"
 
|-valign="top"
!libblas
+
!libf77blas
 
|is the FORTRAN library with optimized BLAS functions.
 
|is the FORTRAN library with optimized BLAS functions.
 +
|-valign="top"
 +
!libptcblas
 +
|is the threaded C library with optimized BLAS functions.
 +
|-valign="top"
 +
!libptf77blas
 +
|is the threaded FORTRAN library with optimized BLAS functions.
 +
|-valign="top"
 +
!liblapack
 +
|is the LAPACK library.
 
|}
 
|}
  
 
[[Category:Science_Engineering]]
 
[[Category:Science_Engineering]]

Latest revision as of 09:43, 20 March 2010

Download Source: http://downloads.sourceforge.net/math-atlas/atlas3.8.0.tar.bz2

Introduction to ATLAS

BLAS are Basic Linear Algebra Subprograms written in Fortran. There are Level 1 (scalar and vector operations), Level 2 (scalar-matrix operations) and Level 3 (matrix-matrix operations) subprograms. ATLAS (Automatically Tuned Linear Algebra Software) will provide C and FORTRAN interfaces to a BLAS implementation optimized for a specific machine architecture. The ideal source of BLAS and LAPACK libraries are those provided by the microprocesor vendor such as AMD's ACML. However, these are not provided under a license that allows re-distribution without written consent from the vendor.

Project Homepage: http://www.netlib.org/blas/

Non-Multilib

First, build the LAPACK libraries, then compile the package:

mkdir build &&
cd build &&
../configure --prefix=/usr \
--with-netlib-lapack=$PWD/../../lapack-3.1.1/lapack_LINUX.a \
-Fa alg -fPIC -b 32 &&
sed -i "/RANLIB/s/echo/ranlib/" Make.inc &&
make &&
cd lib &&
make shared &&
make ptshared &&
cd ..

Install the package:

 make install &&
 cp -v lib/*so /usr/lib

Multilib

32Bit

First, build the LAPACK libraries, then compile the package:

mkdir build &&
cd build &&
CC="gcc ${BUILD32}" ../configure --prefix=/usr \
--with-netlib-lapack=$PWD/../../lapack-3.1.1/lapack_LINUX.a \
-Fa alg -fPIC -b 32 &&
sed -i "/RANLIB/s/echo/ranlib/" Make.inc &&
make &&
cd lib &&
make shared &&
make ptshared &&
cd ..

Install the package:

 make install &&
 cp -v lib/*so /usr/lib

N32

First, build the LAPACK libraries, then compile the package:

mkdir build &&
cd build &&
CC="gcc ${BUILDN32}" ../configure \
--prefix=/usr --libdir=/usr/lib32 \
--with-netlib-lapack=$PWD/../../lapack-3.1.1/lapack_LINUX.a \
-Fa alg -fPIC &&
sed -i "/RANLIB/s/echo/ranlib/" Make.inc &&
make &&
cd lib &&
make shared &&
make ptshared &&
cd ..

Install the package:

 make install &&
 cp -v lib/*so /usr/lib32

64Bit

First, build the LAPACK libraries, then compile the package:

mkdir build &&
cd build &&
CC="gcc ${BUILD64}" ../configure \
--prefix=/usr --libdir=/usr/lib64 \
--with-netlib-lapack=$PWD/../../lapack-3.1.1/lapack_LINUX.a \
-Fa alg -fPIC -b 64 &&
sed -i "/RANLIB/s/echo/ranlib/" Make.inc &&
make &&
cd lib &&
make shared &&
make ptshared &&
cd ..

Install the package:

 make install &&
 cp -v lib/*so /usr/lib64

Configuration Information

Create and install pkgconfig metadata files:

cat > blas.pc.in << "EOF"
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/<LIB>
includedir=${prefix}/include

Name: blas
Description: Automatically Tuned Linear Algebra Software F77 BLAS implementation
Version: 3.8.0
URL: http://math-atlas.sourceforge.net/
Libs: -L${libdir} -latlas -lcblas -lf77blas -lptcblas -lptf77cblas
Libs.private: -lm -lgfortran
EOF
cat > lapack.pc.in << "EOF"
prefix=/usr
exec_prefix=${prefix}
libdir=/usr/<LIB>
includedir=${prefix}/include

Name: lapack
Description: Linear Algebra PACKage
Version: 3.8.0
URL: http://math-atlas.sourceforge.net/
Libs: -L${libdir} -latlas -llapack 
Libs.private: -lm -lgfortran
Cflags: -I${includedir}
EOF

Non-Multilib or 32-Bit

sed -i 's/<LIB>/lib/' blas.pc.in &&
sed -i 's/<LIB>/lib/' lapack.pc.in &&
cp -v blas.pc.in /usr/lib/pkgconfig/blas.pc &&
cp -v lapack.pc.in /usr/lib/pkgconfig/lapack.pc

N32

sed -i 's/<LIB>/lib32/' blas.pc.in &&
sed -i 's/<LIB>/lib32/' lapack.pc.in &&
cp -v blas.pc.in /usr/lib32/pkgconfig/blas.pc &&
cp -v lapack.pc.in /usr/lib32/pkgconfig/lapack.pc

64-Bit

sed -i 's/<LIB>/lib64/' blas.pc.in &&
sed -i 's/<LIB>/lib64/' lapack.pc.in &&
cp -v blas.pc.in /usr/lib64/pkgconfig/blas.pc &&
cp -v lapack.pc.in /usr/lib64/pkgconfig/lapack.pc

Contents

Installed Libraries: libatlas.{a,so}, libcblas.{a,so}, libf77blas.{a,so}, libptcblas.{a, so} libptf77cblas.{a, so}, liblapack.{a, so}

Short Description

libatlas is the main ATLAS library, providing low-level routines for all interface libraries.
libcblas is the C library with optimized BLAS functions.
libf77blas is the FORTRAN library with optimized BLAS functions.
libptcblas is the threaded C library with optimized BLAS functions.
libptf77blas is the threaded FORTRAN library with optimized BLAS functions.
liblapack is the LAPACK library.
Retrieved from "?title=ATLAS&oldid=19977"