Reputation: 333
I have a C++ project and built it with CMake. I have no problem on Windows. However when I tried it on WSL I got symbol lookup error: /opt/intel/oneapi/mkl/latest/lib/libmkl_intel_thread.so.2: undefined symbol: omp_get_num_procs
. On configuration I am not getting any error.
In PATH
I have /opt/intel/oneapi/2024.0/lib/
.
I have:
MKL_ROOT=/opt/intel/oneapi/mkl/latest/
IPP_ROOT=/opt/intel/oneapi/ipp/latest
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
as environment variables.
Note:
WSL Ubuntu 22.04.3 LTS. WSL 2
I get no error or warning while building. I have also successfully run different tests where I don't use MKL.
Upvotes: 2
Views: 449
Reputation: 333
Problem was on WSL some runtime libs of openMP does not installed when installed essentials. So run:
sudo apt install libomp-dev
Upvotes: 1
Reputation: 213879
symbol lookup error: .../libmkl_intel_thread.so.2: undefined symbol: omp_get_num_procs
The error means that libmkl_intel_thread.so.2
was not linked correctly.
You can work around this by adding -lgomp
to the end of your link line.
In
PATH
I have/opt/intel/oneapi/2024.0/lib/
That is the wrong thing to put into your PATH
; you should remove it.
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu
You should unset LD_LIBRARY_PATH
-- the /usr/lib/x86_64-linux-gnu
is searched by default and shouldn't be in LD_LIBRARY_PATH
.
Upvotes: 0