libraries/OpenBLAS: Fix build on VM.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Tim Dickson 2019-01-07 19:26:31 +07:00 committed by Willy Sudiarto Raharjo
parent 0adf2f7655
commit ca7f1f2fc4
No known key found for this signature in database
GPG Key ID: 887B8374D7333381
2 changed files with 20 additions and 2 deletions

View File

@ -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 \

View File

@ -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