-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Cannot find OpenMP header omp.h
#61
Comments
Please re-open if this is still relevant to you and happening with the current 19.1.0 release. |
FYI, the issue still persists in a fresh Linux docker: Repro: $ docker run -it --rm -h debian python:latest /bin/bash
root@debian:/# cat > test.cpp <<EOF
#include <iostream>
#include <omp.h>
const int TOTAL = 10;
int main() {
#pragma omp parallel for
for (int i = 0; i < TOTAL; i++) {
const int tid = omp_get_thread_num();
std::cout << "Hello World from thread = " << tid << "\n";
}
return 0;
}
EOF
root@debian:/# python3 -m venv venv
root@debian:/# source venv/bin/activate
(venv) root@debian:/# python3 -m pip install clang-tidy
Collecting clang-tidy
Downloading clang_tidy-19.1.0-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (3.7 kB)
Downloading clang_tidy-19.1.0-py2.py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (37.7 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 37.7/37.7 MB 105.2 MB/s eta 0:00:00
Installing collected packages: clang-tidy
Successfully installed clang-tidy-19.1.0
[notice] A new release of pip is available: 24.3.1 -> 25.0.1
[notice] To update, run: pip install --upgrade pip
(venv) root@debian:/# which -a clang-tidy
/venv/bin/clang-tidy
(venv) root@debian:/# clang-tidy --extra-arg=-v test.cpp
Error while trying to load a compilation database:
Could not auto-detect compilation database for file "test.cpp"
No compilation database found in / or any parent directory
fixed-compilation-database: Error while opening fixed database: No such file or directory
json-compilation-database: Error while opening JSON database: No such file or directory
Running without flags.
clang version 19.1.0 (https://github.com/ssciwr/clang-tidy-wheel b027ac477e75df27a8c4e6c67a41f5d802883651)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /venv/lib/python3.13/site-packages/clang_tidy/data/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/12
Candidate multilib: .;@m64
Selected multilib: .;@m64
clang Invocation:
"/venv/lib/python3.13/site-packages/clang_tidy/data/bin/clang-tool" "-cc1" "-triple" "x86_64-unknown-linux-gnu" "-fsyntax-only" "-disable-free" "-clear-ast-before-backend" "-disable-llvm-verifier" "-discard-value-names" "-main-file-name" "test.cpp" "-mrelocation-model" "pic" "-pic-level" "2" "-pic-is-pie" "-mframe-pointer=all" "-fmath-errno" "-ffp-contract=on" "-fno-rounding-math" "-mconstructor-aliases" "-funwind-tables=2" "-target-cpu" "x86-64" "-tune-cpu" "generic" "-debugger-tuning=gdb" "-fdebug-compilation-dir=/" "-v" "-fcoverage-compilation-dir=/" "-resource-dir" "/venv/lib/python3.13/site-packages/clang_tidy/data/lib/clang/19" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/x86_64-linux-gnu/c++/12" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/backward" "-internal-isystem" "/venv/lib/python3.13/site-packages/clang_tidy/data/lib/clang/19/include" "-internal-isystem" "/usr/local/include" "-internal-isystem" "/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include" "-internal-externc-isystem" "/usr/include/x86_64-linux-gnu" "-internal-externc-isystem" "/include" "-internal-externc-isystem" "/usr/include" "-fdeprecated-macro" "-ferror-limit" "19" "-fgnuc-version=4.2.1" "-fskip-odr-check-in-gmf" "-fcxx-exceptions" "-fexceptions" "-fcolor-diagnostics" "-faddrsig" "-D__GCC_HAVE_DWARF2_CFI_ASM=1" "-x" "c++" "/test.cpp"
clang -cc1 version 19.1.0 based upon LLVM 19.1.0 default target x86_64-unknown-linux-gnu
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/12/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/x86_64-linux-gnu/c++/12
/usr/lib/gcc/x86_64-linux-gnu/12/../../../../include/c++/12/backward
/venv/lib/python3.13/site-packages/clang_tidy/data/lib/clang/19/include
/usr/local/include
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
1 error generated.
Error while processing /test.cpp.
/test.cpp:2:10: error: 'omp.h' file not found [clang-diagnostic-error]
2 | #include <omp.h>
| ^~~~~~~
Found compiler error(s).
(venv) root@debian:/# find / -name 'omp.h'
/usr/lib/gcc/x86_64-linux-gnu/12/include/omp.h |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi, I'm currently developing a feature that aims to replace the system-installed
clang-tidy
with the version available as a PyPI package. However, I've encountered a challenge: theclang-tidy
installed viapip
seems unable to locate theomp.h
header file, which is causing some issues. Interestingly, the version ofclang-tidy
that's installed usingapt
does not have this problem and functions correctly. I'm looking for insights or suggestions on how to resolve this discrepancy.There is no
omp.h
shipped with the wheel insite-packages/clang_tidy/data/lib/clang/17/include
. It also not looking for the system include directory which containsomp.h
(/usr/lib/llvm-14/lib/clang/14.0.0/include
).Reproduce script:
Results in docker:
clang-tidy
from PyPI:clang-tidy
installed byapt
:The text was updated successfully, but these errors were encountered: