-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
libomp header file conflicts with gcc openmp compilation #112107
Comments
Because |
Homebrew's Homebrew's ❯ fd --no-ignore '^omp.h$' /opt/homebrew
/opt/homebrew/Cellar/libomp/14.0.6/include/omp.h
/opt/homebrew/Cellar/gcc/12.2.0/lib/gcc/current/gcc/aarch64-apple-darwin21/12/include/omp.h
/opt/homebrew/Cellar/llvm/15.0.1/lib/clang/15.0.1/include/omp.h
/opt/homebrew/include/omp.h I guess a possible workaround would be to make Would need to look into risk of breakages from doing this for dependents, in CMake's FindOpenMP logic, and so on. May want to get some additional feedback from others who may be more familiar with Homebrew's |
libomp being keg-only seems like the right approach to me |
Closing as #112390 made Users that now want to link to
|
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
outputVerification
brew update
and am still able to reproduce my issue.brew doctor
and that did not fix my problem.What were you trying to do (and why)?
To be able to compile OpenMP programs with both clang and gcc on a system with
libomp
installed.What happened (include all command output)?
libomp
installsomp.h
in/opt/homebrew/include/omp.h
When compiling an OpenMP program which includes
omp.h
withgcc
and using other header files in/opt/homebrew/include/
gcc
will use libomp's header file as it takes priority over gcc's built-in omp.h file.But that header file is incompatible with gcc's
libgomp
resulting in a broken program.You the same issue in this bug report for the
libomp
RPM package for Fedora.I also came across this issue here.
What did you expect to happen?
The omp.h from libomp should not be used when compiling OpenMP code with gcc.
Step-by-step reproduction instructions (by running
brew
commands)Here's a small example of the problem: https://gist.github.com/biochem-fan/31864239460769d2a4a3585e4959d298
The text was updated successfully, but these errors were encountered: