How to install numba.openmp

I am trying to use multithreading in numba using PyOMP. This doesn’t seem to come with standard numbs installation.

from numba.openmp import openmp_context as openmp

`---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
Input In [42], in
----> 1 from numba.openmp import openmp_context as openmp

ModuleNotFoundError: No module named ‘numba.openmp’`

This work appears to be based on a fork of Numba - it looks like the fork resides at GitHub - Python-for-HPC/PyOMP: OpenMP for Python in Numba

conda install numba cffi -c drtodd13 -c conda-forge --override-channels

I’m the author so please let me know if you have any problems. We are going to try to move this into mainline Numba after it is developed a bit more. In the meantime, you can use the command above.

Thank you. I have used the command, but still i get

from numba.openmp import openmp_context as openmp
Traceback (most recent call last):
File “”, line 1, in
ImportError: No module named ‘numba.openmp’

1 Like

Did you create a new, clean conda environment to do the install in? Can you try that?

@DrTodd13 I have the same problem as the post author. I tried already your solution on a new Conda environment. Do you have any more tips? :frowning:

You get the exact same error? Did you activate the environment after creating it? Sorry for the simplistic question but I’ve had cases where that was the problem and it’s the first thing to check. Once you’re in the environment, would you please paste the result of “conda list”? Thanks! @roxaaams

I should have asked before but what OS and architectures are your machines? We only support Linux on x64 at the moment. The following tweaked command is better because it will force numba to come from my channel and won’t fall back to conda-forge and pick-up a Numba from there that matches your OS/arch pair. I suspect that is what happened in this case. We’re working on a Windows/x64 build at the moment so that should be coming soon.

conda install drtodd13::numba cffi -c conda-forge --override-channels

Hi.
I’ll try to install on linux x64 systeme with the following command :
conda install drtodd13::numba cffi -c conda-forge --override-channels
Unfortunately when I import njit from numba I obtain this error:
Traceback (most recent call last):
File “”, line 1, in
File “/soft/DL/conda_envs/omp/lib/python3.7/site-packages/numba/init.py”, line 19, in
from numba.core import config
File “/soft/DL/conda_envs/omp/lib/python3.7/site-packages/numba/core/config.py”, line 16, in
import llvmlite.binding as ll
File “/soft/DL/conda_envs/omp/lib/python3.7/site-packages/llvmlite/binding/init.py”, line 4, in
from .dylib import *
File “/soft/DL/conda_envs/omp/lib/python3.7/site-packages/llvmlite/binding/dylib.py”, line 3, in
from llvmlite.binding import ffi
File “/soft/DL/conda_envs/omp/lib/python3.7/site-packages/llvmlite/binding/ffi.py”, line 191, in
raise OSError(“Could not load shared object file: {}”.format(_lib_name))
OSError: Could not load shared object file: libllvmlite.so

Numba works well on the same system in another installation by conda.
Thanks for your help, pyOMP seems very useful

Hi.

When I tried to build PyOMP from the github project I get this error:
passmanagers.cpp:10:10: fatal error: llvm-c/Transforms/IntrinsicsOpenMP.h: No such file or directory
The IntrinsicsOpenMP.h head file not exist in the llvm-project source code