Make a PKGBUILD? Submit it here for user review and possible placement into the repository.


Postby jdarm » Sat Aug 17, 2013 9:58 pm

The Automatically Tuned Linear Algebra Software (ATLAS) provides access to optimised Basic Linear Algebra Subprograms (BLAS) and Linear Algebra PACKage (LAPACK ) functions. Optimisation of BLAS and LAPACK functions for specific CPUs can result in substantial reduction of the time it takes to complete calculations. Common applications making use of these libraries are programmes like NumPy, SAGE, R and the like.

ATLAS is designed to find the right implementations for a specific target CPU/platform in an automated manner, hence the build should not be distributed to other CPUs/targets. Building this package can take a long time, on the BeagleBoard Black I have used to test it it took a few days. During the 'build()' the system should be dedicated to building the package, as differences in load could result in errors in the automated search for the optimal implementation of a BLAS/LAPACK function. During 'check()' this is not important.

In simple testing of the performance of BLAS in R on the BeagleBoard Black, the gains achievable on specific functions appear to be up to approximately 62%, with a total reduction of the running time of Simon Urbanek's 'R Benchmark 2.5) from 1663s to 1053s. (the standard packages provided in the repository were used as reference)

An issue popping up in my build was is not being built by the original configure script provided in the source archive, I have solved this by adding the creation of in the PKGBUILD.

It would be great if people could go over the package (and correct the silly stuff I have undoubtedly done) and maybe test ATLAS on various CPUs/platforms. Also a repository of binaries/formulation of good defaults for various CPUs/platforms might be nice, as building really can take a very long time.

Code: Select all
# Inspiration/substantial parts taken from atlas-lapack in Arch linux AUR

pkgdesc="Complete LAPACK and BLAS implementation using optimised ATLAS routines"
makedepends=('binutils' 'sed' 'gcc-fortran')
conflicts=('blas' 'lapack' 'cblas')
provides=("blas" "lapack=$_lapackver" 'cblas')
license=('custom:blas' 'custom:lapack' 'custom:atlas')
source=($_lapackver.tgz${pkgver}.tar.bz2  blas-license.txt atlas-license.txt)
noextract=(lapack-$_lapackver.tgz atlas$pkgver.tar.bz2 armhardfp_archdef.tar)

prepare() {
   msg 'Prepare directories'
   cd "$srcdir"
   tar -xjf atlas$pkgver.tar.bz2

   mkdir -p "$srcdir/build-atlas"
   cd "$srcdir/build-atlas"

build() {
    msg 'Build ATLAS'
    unset MAKE
    cd "$srcdir/build-atlas"
    rm -rf *
   ../ATLAS/configure -D c -DATL_ARM_HARDFP=1 -Si archdef 0 -Fa alg -mfloat-abi=hard --dylibs --prefix=/usr/ --with-netlib-lapack-tarfile="$srcdir/lapack-$_lapackver.tgz"
   make build

   # Link seperately, as the default config which is generated does not work
   cd "$srcdir/build-atlas/lib"
   /usr/bin/gcc -shared -o -Wl,-soname, -Wl,--whole-archive liblapack.a -Wl,--no-whole-archive -L. -L/usr/lib -L/usr/lib/gcc/armv7l-unknown-linux-gnueabihf/4.7.2/ -lcblas -lblas -lgcc_s

check() {
   cd "$srcdir/ATLAS/build"

   msg 'Check...'
   unset MAKE
   make check
   make ptcheck
   make time

package() {
   cd "$srcdir/build-atlas"
   make DESTDIR="$pkgdir/usr" install
   cp -d lib/*.so* "$pkgdir/usr/lib"
   [ -e lib/libptlapack.a ] && cp lib/libptlapack.a "$pkgdir/usr/lib"
   cd "$pkgdir/usr/lib"
   ln -s
   ln -s

   install -Dm644 "${srcdir}/blas-license.txt" \
   install -Dm644 "${srcdir}/build-atlas/src/lapack/reference/LICENSE" \
   install -Dm644 "${srcdir}/atlas-license.txt" \
Package for building ATLAS
(2.78 KiB) Downloaded 885 times
Posts: 1
Joined: Sat Aug 17, 2013 9:16 pm

Return to User-Submitted Packages

Who is online

Users browsing this forum: No registered users and 1 guest