|
|
|
@ -1,6 +1,6 @@
|
|
|
|
|
#!/bin/bash |
|
|
|
|
# Build script for Slackware |
|
|
|
|
# Copyright (C) 2008,2009,2010,2011,2013,2016 Damien Goutte-Gattat |
|
|
|
|
# Copyright (C) 2008-2011,2013,2016,2019 Damien Goutte-Gattat |
|
|
|
|
# |
|
|
|
|
# Redistribution and use of this script, with or without modifications, |
|
|
|
|
# is permitted provided that the following conditions are met: |
|
|
|
@ -35,18 +35,24 @@
|
|
|
|
|
# on different machines, unless they are all powered by the |
|
|
|
|
# very same processor; |
|
|
|
|
# b) that the processor must run at *constant full speed* during |
|
|
|
|
# the build (cpufreq should be disabled, or be used with the |
|
|
|
|
# `performance' governor). |
|
|
|
|
# the build. |
|
|
|
|
# |
|
|
|
|
# The way to achieve the second point may depend on the actual |
|
|
|
|
# machine and processor used. For example, on my current Core i5 |
|
|
|
|
# laptop, I had to boot the kernel with intel_pstate=disable AND |
|
|
|
|
# unload the acpi-cpufreq module; keeping acpi-cpufreq active |
|
|
|
|
# with the "userspace" governor and a fixed frequency was oddly |
|
|
|
|
# not enough. |
|
|
|
|
|
|
|
|
|
# Source packages infos |
|
|
|
|
ATLAS_NAMESRC=${ATLAS_NAMESRC:-atlas} |
|
|
|
|
ATLAS_VERSION=${ATLAS_VERSION:-3.10.2} |
|
|
|
|
ATLAS_VERSION=${ATLAS_VERSION:-3.10.3} |
|
|
|
|
ATLAS_ARCHIVE=${ATLAS_ARCHIVE:-${ATLAS_NAMESRC}$ATLAS_VERSION.tar.bz2} |
|
|
|
|
ATLAS_URL=${ATLAS_URL:-http://downloads.sourceforge.net/math-atlas} |
|
|
|
|
|
|
|
|
|
LAPACK_NAMESRC=${LAPACK_NAMESRC:-lapack} |
|
|
|
|
LAPACK_VERSION=${LAPACK_VERSION:-3.4.1} |
|
|
|
|
LAPACK_ARCHIVE=${LAPACK_ARCHIVE:-$LAPACK_NAMESRC-$LAPACK_VERSION.tgz} |
|
|
|
|
LAPACK_VERSION=${LAPACK_VERSION:-3.8.0} |
|
|
|
|
LAPACK_ARCHIVE=${LAPACK_ARCHIVE:-$LAPACK_NAMESRC-$LAPACK_VERSION.tar.gz} |
|
|
|
|
LAPACK_URL=${LAPACK_URL:-http://www.netlib.org/lapack} |
|
|
|
|
|
|
|
|
|
# Build infos |
|
|
|
@ -55,6 +61,7 @@ VERSION=${VERSION:-$ATLAS_VERSION}
|
|
|
|
|
BUILD=${BUILD:-1GGD} |
|
|
|
|
ARCH=${ARCH:-$(uname -m | sed 's/^i.86$/i486/;s/^arm.*/arm/')} |
|
|
|
|
EXT=${EXT:-txz} |
|
|
|
|
CPUARCH=${CPUARCH:-Corei5} |
|
|
|
|
|
|
|
|
|
# Directories |
|
|
|
|
TMP=${TMP:-/tmp} |
|
|
|
@ -97,10 +104,9 @@ if [ ! -r $LAPACK_ARCHIVE ]; then
|
|
|
|
|
wget -c -O $LAPACK_ARCHIVE.part "$LAPACK_URL/$LAPACK_ARCHIVE" |
|
|
|
|
mv $LAPACK_ARCHIVE.part $LAPACK_ARCHIVE |
|
|
|
|
fi |
|
|
|
|
sha1sum -c $ATLAS_ARCHIVE.sha1 |
|
|
|
|
sha1sum -c $LAPACK_ARCHIVE.sha1 |
|
|
|
|
sha256sum -c $ATLAS_ARCHIVE.sha256 |
|
|
|
|
sha256sum -c $LAPACK_ARCHIVE.sha256 |
|
|
|
|
ATLAS_DIRNAME=$(tar ft $ATLAS_ARCHIVE | head -n 1 | cut -d / -f 1) |
|
|
|
|
LAPACK_DIRNAME=$(tar ft $LAPACK_ARCHIVE | head -n 1 | cut -d / -f 1) |
|
|
|
|
|
|
|
|
|
# Extract and configure |
|
|
|
|
cd $TMP |
|
|
|
@ -112,21 +118,12 @@ cd $TMP/$ATLAS_DIRNAME/build
|
|
|
|
|
--libdir=/usr/lib$LIBDIRSUFFIX \ |
|
|
|
|
--shared \ |
|
|
|
|
--with-netlib-lapack-tarfile=$CWD/$LAPACK_ARCHIVE \ |
|
|
|
|
-b $BITS -D c -DPentiumCPS=$MHZ -Fa alg -fPIC |
|
|
|
|
|
|
|
|
|
# Do not set the soname on shared libraries |
|
|
|
|
sed -i 's/-soname [^ ]\+//' lib/Makefile |
|
|
|
|
-b $BITS -D c -DPentiumCPS=$MHZ -Fa alg -fPIC -A $CPUARCH |
|
|
|
|
|
|
|
|
|
# Build |
|
|
|
|
make |
|
|
|
|
make install DESTDIR=$PKG/usr LIBINSTdir=$PKG/usr/lib$LIBDIRSUFFIX |
|
|
|
|
install -m 755 -s lib/libsatlas.so $PKG/usr/lib$LIBDIRSUFFIX |
|
|
|
|
|
|
|
|
|
# Install threaded library if it has been build |
|
|
|
|
# (on multiprocessors machines only) |
|
|
|
|
if [ -f lib/libtatlas.so ]; then |
|
|
|
|
install -m 755 -s lib/libtatlas.so $PKG/usr/lib$LIBDIRSUFFIX |
|
|
|
|
fi |
|
|
|
|
strip --strip-unneeded $PKG/usr/lib$LIBDIRSUFFIX/lib{s,t}atlas.so |
|
|
|
|
|
|
|
|
|
# Install documentation |
|
|
|
|
mkdir -p $PKG/usr/doc/$NAMEPKG-$VERSION |
|
|
|
@ -143,7 +140,7 @@ PACKAGING="
|
|
|
|
|
chown root:root . -R |
|
|
|
|
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT |
|
|
|
|
rm -rf $PKG |
|
|
|
|
rm -rf $TMP/$LAPACK_DIRNAME $TMP/$ATLAS_DIRNAME |
|
|
|
|
rm -rf $TMP/$ATLAS_DIRNAME |
|
|
|
|
" |
|
|
|
|
if type -p fakeroot ; then |
|
|
|
|
echo "$PACKAGING" | fakeroot |
|
|
|
|