From ca7f1f2fc4a79a0a075ba1055d51d21e0e698654 Mon Sep 17 00:00:00 2001 From: Tim Dickson Date: Mon, 7 Jan 2019 19:26:31 +0700 Subject: libraries/OpenBLAS: Fix build on VM. Signed-off-by: Willy Sudiarto Raharjo --- libraries/OpenBLAS/OpenBLAS.SlackBuild | 17 +++++++++++++++-- libraries/OpenBLAS/README | 5 +++++ 2 files changed, 20 insertions(+), 2 deletions(-) (limited to 'libraries/OpenBLAS') diff --git a/libraries/OpenBLAS/OpenBLAS.SlackBuild b/libraries/OpenBLAS/OpenBLAS.SlackBuild index b0773b1259..5025a75415 100644 --- a/libraries/OpenBLAS/OpenBLAS.SlackBuild +++ b/libraries/OpenBLAS/OpenBLAS.SlackBuild @@ -17,7 +17,19 @@ if [ -z "$ARCH" ]; then *) ARCH=$( uname -m ) ;; esac fi - +EXTRAPARMS="" +if [ "x`uname -p|grep QEMU|wc -l`" = "x1" ]; then + #we are running in a vm with a QEMU cpu. OpenBLAS does not like this + EXTRAPARMS="DYNAMIC_ARCH=1" + if [ "x$TARGET" = "x" ]; then + echo "the cpu is not recognised by OpenBLAS. specify a target cpu" + echo "using variable TARGET=targetname" + echo "look at TargetList.txt in the source for valid TARGET types." + exit 2 + else + EXTRAPARMS=$EXTRAPARMS" TARGET="$TARGET + fi +fi CWD=$(pwd) TMP=${TMP:-/tmp/SBo} PKG=$TMP/package-$PRGNAM @@ -44,8 +56,9 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; -make +make $EXTRAPARMS make \ + $EXTRAPARMS \ NO_STATIC=1 \ BUILD_RELAPACK=1 \ DESTDIR=$PKG \ diff --git a/libraries/OpenBLAS/README b/libraries/OpenBLAS/README index f1a444a09e..7269fb158c 100644 --- a/libraries/OpenBLAS/README +++ b/libraries/OpenBLAS/README @@ -2,3 +2,8 @@ OpenBLAS is an optimized BLAS library based on GotoBLAS2 1.13 BSD version. Added symbolic link to install a generic blas library that can be used by Octave and R. +OpenBLAS has cpu specific targetted assembly code for speed optimisation. +If running in a vm with QEMU cpu you need to specify a variable +TARGET=cpuname to the script where cpuname is one from the list in the +sourcecode file TargetList.txt +examples are TARGET=NEHALEM for an Intel i7 or TARGET=ATHLON for AMD Athlon -- cgit v1.2.3