Commit 8350b93b authored by xoviat's avatar xoviat
Browse files

Use a binary OpenBLAS (#83)

Fetch OpenBLAS from wheels.scipy.org rather than building it.
parent 1332065a
# Stripped-down version of bash utilities for use with gfortran
ARCHIVE_SDIR="${ARCHIVE_SDIR:-archives}"
function _mb_get_gf_lib_for_suf {
local suffix=$1
local prefix=$2
local plat=${3:-$PLAT}
local uname=${4:-$(uname)}
if [ -z "$prefix" ]; then echo Prefix not defined; exit 1; fi
local fname="$prefix-${uname}-${plat}${suffix}.tar.gz"
local out_fname="${ARCHIVE_SDIR}/$fname"
if [ ! -e "$out_fname" ]; then
curl -L "${GF_LIB_URL}/$fname" > $out_fname || (echo "Fetch failed"; exit 1)
fi
echo "$out_fname"
}
function _mb_get_gf_lib {
# Get library with no suffix
_mb_get_gf_lib_for_suf "" $@
}
......@@ -2,6 +2,11 @@
# Defines IS_OSX, fetch_unpack
MULTIBUILD_DIR=$(dirname "${BASH_SOURCE[0]}")
source $MULTIBUILD_DIR/common_utils.sh
source $MULTIBUILD_DIR/_gfortran_utils.sh
# For OpenBLAS
PLAT="${PLAT:x86_64}"
GF_LIB_URL="https://3f23b170c54c2533c070-1c8a9b3114517dc5fe17b7c3f8c63a43.ssl.cf2.rackcdn.com"
# Recipes for building some libaries
OPENBLAS_VERSION="${OPENBLAS_VERSION:-0.2.18}"
......@@ -97,15 +102,9 @@ function build_openblas {
brew install openblas
brew link --force openblas
else
if [ -d "OpenBLAS" ]; then
(cd OpenBLAS && git clean -fxd && git reset --hard)
else
git clone https://github.com/xianyi/OpenBLAS
fi
(cd OpenBLAS \
&& git checkout "v${OPENBLAS_VERSION}" \
&& make DYNAMIC_ARCH=1 USE_OPENMP=0 NUM_THREADS=64 > /dev/null \
&& make PREFIX=$BUILD_PREFIX install)
local plat=${1:-$PLAT}
local tar_path=$(abspath $(_mb_get_gf_lib "openblas-${OPENBLAS_VERSION}" "$plat"))
(cd / && tar zxf $tar_path)
fi
touch openblas-stamp
}
......
......@@ -16,5 +16,6 @@ suppress build_libwebp
suppress build_szip
suppress build_swig
suppress build_github fredrik-johansson/arb 2.11.1
suppress build_openblas
stop_spinner
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment