Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Brandon_M_
Beginner
115 Views

Getting SciPy to work with MKL and GNU threads

Hi All,

I am attempting to find a workaround for a user who wants to build NumPy and SciPy with MKL, but use the GNU toolchain to compile. I have followed the instructions at

https://software.intel.com/en-us/articles/numpyscipy-with-intel-mkl

For doing just this, however when we attempt to test SciPy in this configuration we get the error

symbol lookup error: /opt/intel/composer_xe_2013.2.146/mkl/lib/intel64/libmkl_gnu_thread.so: undefined symbol: omp_get_num_procs

after using export MKL_THREADING_LAYER=GNU and MKL_THREADING_INTERFACE=GNU

I cannot find a suitable workaround for the user. Can you offer any insight as to why this may be happening?

We are using python 2.6 for this user who requires a custom build with custom versions of numpy and scipy, along with intel 2013.

Thanks very much.

0 Kudos
3 Replies
TimP
Black Belt
115 Views

libmkl_gnu_thread.so requires -lgomp (which would be implied by -fopenmp) in place of the reference to -liomp5 which would be required by the intel_thread library. 

You should be able to use either combination, in accordance with https://software.intel.com/en-us/articles/intel-mkl-link-line-advisor,

If you wish to run without an OpenMP library, you must select the sequential library in place of the thread one.

Brandon_M_
Beginner
115 Views

Hi Tim,

Thanks so much for your reply. But my problem persists. I tried building with:

export CFLAGS="-fopenmp -m64 -mtune=native -O3 -Wl,--no-as-needed -fPIC"

export CXXFLAGS="-fopenmp -m64 -mtune=native -O3 -Wl,--no-as-needed -fPIC"

export LDFLAGS="-ldl -lm -lgomp -shared"

export FFLAGS="-fopenmp -m64 -mtune=native -O3 -fPIC"

export MKL_THREADING_LAYER=GNU

export MKL_INTERFACE_LAYER=GNU

I have verified the existence of /usr/lib64/libgomp.so.1.0.0, but when I run scipy.test("full"), I still get:

libmkl_gnu_thread.so: undefined symbol: omp_get_num_procs

Any more ideas?

TimP
Black Belt
115 Views

Have you checked your executable with ldd?

Reply