You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It turns out that loading built OpenBLAS leads to segfault whenever Matlab wants to use anything from BLAS or LAPACK.
Fortunately one can easily modify symbol names of the OpenBLAS build, using this feature OpenMathLib/OpenBLAS#459, using simple change:
diff --git a/build/share/pardiso_wrappers.conf b/build/share/pardiso_wrappers.conf
index 5e9e33a..a5c8575 100755
--- a/build/share/pardiso_wrappers.conf
+++ b/build/share/pardiso_wrappers.conf
@@ -13,7 +13,7 @@ export MATLABPATH="${PREFIX}/matlab:${MATLABPATH}"
export LD_LIBRARY_PATH="${PREFIX}/lib:${LD_LIBRARY_PATH}"
# Tell matlab to load OpenBLAS instead of its MKL
-export LD_PRELOAD="${PREFIX}/lib/libopenblas.so"
+export LD_PRELOAD="${PREFIX}/lib/libmatpar_openblas.so"
# Get rid of annoying license message
export PARDISOLICMESSAGE=1
diff --git a/make_openblas.sh b/make_openblas.sh
index 1883fcc..00e2404 100755
--- a/make_openblas.sh
+++ b/make_openblas.sh
@@ -11,5 +11,5 @@ tar -xzf OpenBLAS-${OPENBLAS_VERSION}.tar.gz
# Build and install OpenBLAS into the build dir
cd OpenBLAS-${OPENBLAS_VERSION}
-make NO_LAPACKE=1 NO_CBLAS=1 USE_OPENMP=0 USE_THREAD=0
-make install NO_LAPACKE=1 NO_CBLAS=1 NO_STATIC=1 PREFIX="${PREFIX}"
+make NO_LAPACKE=1 NO_CBLAS=1 USE_OPENMP=0 USE_THREAD=0 SYMBOLPREFIX="matpar_"
+make install NO_LAPACKE=1 NO_CBLAS=1 NO_STATIC=1 PREFIX="${PREFIX}" SYMBOLPREFIX="matpar_"
Bad thing is that all symbols in libpardiso600-GNU720-X86-64.so are dynamic. So we can't rename them see, https://stackoverflow.com/a/20599760. We can't also link together libpardiso600-GNU720-X86-64.so and libopenblas, see https://stackoverflow.com/a/924181. It seems like our only option is to ask Pardiso team to provide us either libpardiso.so with prefixed BLAS symbols or give us libpardiso.a.
Pardiso team is not willing to provide any help fixing the problem. So that leaves these recipes with breaking any functionality in Matlab which uses BLAS/LAPACK.
Uh oh!
There was an error while loading. Please reload this page.
It turns out that loading built OpenBLAS leads to segfault whenever Matlab wants to use anything from BLAS or LAPACK.
Fortunately one can easily modify symbol names of the OpenBLAS build, using this feature OpenMathLib/OpenBLAS#459, using simple change:
Bad thing is that all symbols in
libpardiso600-GNU720-X86-64.so
are dynamic. So we can't rename them see, https://stackoverflow.com/a/20599760. We can't also link togetherlibpardiso600-GNU720-X86-64.so
andlibopenblas
, see https://stackoverflow.com/a/924181. It seems like our only option is to ask Pardiso team to provide us eitherlibpardiso.so
with prefixed BLAS symbols or give uslibpardiso.a
.Other hacking might be possible: http://www.fcollyer.com/2013/01/04/elf-symbol-visibility-and-the-perils-of-name-clashing/.
The text was updated successfully, but these errors were encountered: