Python numba/npyufunc/omppool.cpp:5:10: fatal error: 'omp.h' file not found

runix

New Member

Reaction score: 1
Messages: 15

Experts,

I am trying to install numba using pip inside a virtual python environment. I am encountering the following error:
Code:
cc: numba/cuda/cudadrv/_extras.c
    cc -shared -lpthread -L/usr/local/lib -fstack-protector build/temp.freebsd-12.0-RELEASE-p2-amd64-3.6/numba/cuda/cudadrv/_extras.o -L/usr/local/lib -lpython3.6m -o build/lib.freebsd-12.0-RELEASE-p2-amd64-3.6/numba/cuda/cudadrv/_extras.so
    building 'numba.npyufunc.omppool' extension
    C compiler: cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC

    compile options: '-I/home/russellb/py_devel/pyPlay/include -I/usr/local/include/python3.6m -c'
    extra options: '-fopenmp -std=c++11'
    cc: numba/npyufunc/omppool.cpp
    cc: numba/npyufunc/gufunc_scheduler.cpp
    numba/npyufunc/omppool.cpp:5:10: fatal error: 'omp.h' file not found
    #include <omp.h>
             ^~~~~~~
    1 error generated.
    numba/npyufunc/omppool.cpp:5:10: fatal error: 'omp.h' file not found
    #include <omp.h>
             ^~~~~~~
    1 error generated.
    error: Command "cc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -O2 -pipe -fstack-protector -fno-strict-aliasing -fPIC -I/home/russellb/py_devel/pyPlay/include -I/usr/local/include/python3.6m -c numba/npyufunc/omppool.cpp -o build/temp.freebsd-12.0-RELEASE-p2-amd64-3.6/numba/npyufunc/omppool.o -fopenmp -std=c++11" failed with exit status 1
error
Cleaning up...
  Removing source in /tmp/pip-install-g3ckpog3/numba
Removed build tracker '/tmp/pip-req-tracker-21vj3szg'
Command "/home/russellb/py_devel/pyPlay/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-g3ckpog3/numba/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-lf_sxfnx/install-record.txt --single-version-externally-managed --compile --install-headers /home/russellb/py_devel/pyPlay/include/site/python3.6/numba" failed with error code 1 in /tmp/pip-install-g3ckpog3/numba/
Exception information:
Traceback (most recent call last):
  File "/home/russellb/py_devel/pyPlay/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/home/russellb/py_devel/pyPlay/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 366, in run
    use_user_site=options.use_user_site,
  File "/home/russellb/py_devel/pyPlay/lib/python3.6/site-packages/pip/_internal/req/__init__.py", line 49, in install_given_reqs
    **kwargs
  File "/home/russellb/py_devel/pyPlay/lib/python3.6/site-packages/pip/_internal/req/req_install.py", line 791, in install
    spinner=spinner,
  File "/home/russellb/py_devel/pyPlay/lib/python3.6/site-packages/pip/_internal/utils/misc.py", line 705, in call_subprocess
    % (command_desc, proc.returncode, cwd))
pip._internal.exceptions.InstallationError: Command "/home/russellb/py_devel/pyPlay/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-g3ckpog3/numba/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-lf_sxfnx/install-record.txt --single-version-externally-managed --compile --install-headers /home/russellb/py_devel/pyPlay/include/site/python3.6/numba" failed with error code 1 in /tmp/pip-install-g3ckpog3/numba/
But omp.h is present in /usr/local/llvm70/lib/clang/7.0.1/include/omp.h.
I also want to set llvm70 as default for my virtual environment python installations? Should I look in to venv config inside the environment?
Any help to troubleshoot/fix this issue is much appreciated.[/file]
 
Last edited by a moderator:
Top