Skip to content

Commit

Permalink
Fixes openblas installation for static build
Browse files Browse the repository at this point in the history
  • Loading branch information
perdasilva authored and larroy committed Sep 28, 2019
1 parent 110597f commit 0220d4f
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions tools/dependencies/openblas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
# under the License.

# This script builds the static library of openblas that can be used as dependency of mxnet.
set +e # This script throws an error but otherwise works
set -x
OPENBLAS_VERSION=0.3.5
set -ex
OPENBLAS_VERSION=0.3.7
if [[ ! -e $DEPS_PATH/lib/libopenblas.a ]]; then
# download and build openblas
>&2 echo "Building openblas..."
Expand All @@ -32,8 +31,13 @@ if [[ ! -e $DEPS_PATH/lib/libopenblas.a ]]; then
pushd .
cd $DEPS_PATH/OpenBLAS-$OPENBLAS_VERSION

$MAKE DYNAMIC_ARCH=1 NO_SHARED=1 USE_OPENMP=1
# Adding NO_DYNAMIC=1 flag causes make install to fail
$MAKE DYNAMIC_ARCH=1 USE_OPENMP=1
$MAKE PREFIX=$DEPS_PATH install

# Manually removing .so to avoid linking against it
rm $DEPS_PATH/lib/libopenblasp-r${OPENBLAS_VERSION}.so

popd
ln -s libopenblas.a $DEPS_PATH/lib/libcblas.a
ln -s libopenblas.a $DEPS_PATH/lib/liblapack.a
Expand Down

0 comments on commit 0220d4f

Please sign in to comment.