Intel® MPI Library
Get help with building, analyzing, optimizing, and scaling high-performance computing (HPC) applications.

Getting SciPy to work with MKL and GNU threads

Brandon_M_
Beginner
911 Views

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
Honored Contributor III
911 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.

0 Kudos
Brandon_M_
Beginner
911 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?

0 Kudos
TimP
Honored Contributor III
911 Views

Have you checked your executable with ldd?

0 Kudos
Reply