I have compiled Octave 4.2.1 from sources with no error. Is there any way to make it use Intel Math Kernel Library?
I have installed it in \opt\intel. When I add it to blas and lapack alternatives with:
sudo update-alternatives --install /usr/lib/libblas.so.3 \
libblas.so.3 \
/opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_rt.so \
50
sudo update-alternatives --install /usr/lib/liblapack.so.3 \
liblapack.so.3 \
/opt/intel/compilers_and_libraries/linux/mkl/lib/intel64/libmkl_rt.so \
50
Octave doesn't start with the following error:
Intel MKL FATAL ERROR: Cannot load libmkl_core.so.
I have also tried to compile Octave using MKL.
export JAVA_HOME="/usr/lib/jvm/default-java"
export CFLAGS="-O2 -fPIC -DMKL_LP64 -DM_PI=3.1415926535897932384"
export FFLAGS="-O2 -fPIC"
export CPPFLAGS="-I/opt/intel/mkl/include/ -I/opt/intel/mkl/include/fftw/"
export LDFLAGS="-L/opt/intel/mkl/lib/intel64 -L/opt/intel/lib/intel64"
export LD_LIBRARY_PATH="/usr/lib/gcc:/usr/lib/gcc/x86_64-linux-gnu/:/opt/intel/lib/intel64:/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH"
./configure --prefix=/opt/octave4_2_mkl --with-blas="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread" --with-lapack="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread" --with-fftw3="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread -lm" --with-fftw3f="-lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core -liomp5 -lpthread -lm"
Unfortunately although ./configure does not spit out any errors, when I run 'make' and 'make check' afterwards, the test gets crazy and exits with Signal 6.
Install octave in any way (say from repo), then start it with
LD_PRELOAD=/opt/intel/mkl/lib/intel64/libmkl_rt.so octave
Now it actually uses mkl and turns out to be faster than openblas.
– Icannotlogin May 09 '17 at 20:51LD_PRELOAD= /usr/lib/libblas.so octave
You can edit octave's .Desktop file so you can just click the launcher.
– Icannotlogin May 09 '17 at 21:01