WSL2 installation problems

I have been running ngsolve with the ngsxfem addon on windows using WSL2. I recently tried to update my setup to the newest version of ubuntu+ngsolve+ngsxfem, but it doesn’t work anymore. I can open netgen fine, but when I try to import ngsolve I get the following error:

Traceback (most recent call last):
File “”, line 1, in
File “/home/----/.local/lib/python3.10/site-packages/ngsolve/init.py”, line 30, in
ctypes.CDLL(_mkl_rt)
File “/usr/lib/python3.10/ctypes/init.py”, line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: /home/----/.local/lib/python3.10/site-packages/…/…/libmkl_rt.so.1: cannot open shared object file: No such file or directory

Any idea how to fix this?

Dear JSR,

how (compile from source, via pip,…) did you install ngsolve and ngs-xfem?

Could you please search for any “libmkl_tr” in your /home/----/.local/lib directory?
(with something like "find /home/----/.local/lib -name “libmkl_rt”)

Best,
MR

I installed ngsolve using pip (haven’t tried to install ngsxfem yet, as ngsolve doesn’t work).

When I tried to install ngsolve with apt-get, I got the following error:

libtbb2-dev : Conflicts: libtbb-dev but 2021.5.0-7ubuntu2 is to be installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

The search results returned:
/home/----/.local/lib/libmkl_rt.so.2

Oh, on my system I also have .so.2 instead of .so.1, but since I build from source, I could specify the mkl lib manually.
Don’t know how to get the .so.1 mkl lib via pip :confused:

Any tips on how to do that? I’ve never built anything from source before, but if that’s the only way to install it I guess I’ll have to learn…

There are other options than installation from source for sure.
Unfortunately, I just don’t have a lot of experience with them (did a pip install some months ago but did not run into this problem). Maybe someone else who knows what’s going on, shows by here.

Which version of the mkl package do you have installed?
(“pip list | grep mkl”)

mkl 2023.0.0

Could you please try to downgrade mkl via pip to 2021.1.1 or 2021.4.0?
They might come with the .so.1 version.

It works! I just tried downgrading to 2021.4.0, and it comes with the .so.1 version. Ngsolve is working now. Thank you.

Incidentally, I tried reinstalling ngsolve again afterwards, and the pip installer reinstalled mkl 2023.0.0, breaking ngsolve. I’ll report it on the PIP thread.