blechta / pardiso-matlab-recipes Goto Github PK
View Code? Open in Web Editor NEW(Unofficial) build recipes for official Pardiso-Matlab bindings
License: BSD 2-Clause "Simplified" License
(Unofficial) build recipes for official Pardiso-Matlab bindings
License: BSD 2-Clause "Simplified" License
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
.
Other hacking might be possible: http://www.fcollyer.com/2013/01/04/elf-symbol-visibility-and-the-perils-of-name-clashing/.
Hello, thank you for your method. I have set up mex of pardiso. May I ask a question, how to start openmp multithreading of pardiso on matlab platform
Thank you for your work
I compile the mex file successfully, however, when I compile the test, it get stuck at here
"The factors have 17 nonzero entries.
** On entry to DGER parameter number 9 had an illegal value
** On entry to DGER parameter number 9 had an illegal value
** On entry to DGER parameter number 9 had an illegal value
The matrix has 4 positive and 0 negative eigenvalues.
"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.