Coder Social home page Coder Social logo

pardiso-matlab-recipes's People

Contributors

blechta avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pardiso-matlab-recipes's Issues

compile test gets stuck

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.
"

Symbol name clash with Matlab's MKL

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/.

pardiso-matlab OpenMP

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.