-
-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Cflags in openblas.pc are not compatible with Apple Clang #209091
Comments
Homebrew only runs |
This is probably a consequence of our using GCC to build on macOS. Using |
Upstream doesn't seem to be aware of a possibility to use I tried building the current git version of openblas with just I also tried to remove |
You need to enable OpenMP for a comparable build with: export USE_OPENMP=1 |
this leads to an error as above in such a configuration, almost immediately. EDIT2. I was slightly sloppy again. Now, with checkout of 0.3.29 (or with today's main), I get
|
another option might be to have openblas linked to libomp, not libgomp. |
This actually appears doable, except that it's linking to both of them, Would you be interested in a PR switching this build to such a setup? |
I don't think we want to link to both |
Python people deal with multiple libomp's in one application on a regular basis. Perhaps @rgommers can comment on this. I also don't know whether there is any C OpenMP in openblas. |
This is correct, it's a recipe for major trouble.
The only reason for this is that wheels uploaded to PyPI cannot depend on a common shared library, and aren't built as a coherent stack. To make it work at all, extensive symbol mangling machinery is used. The end result is lower performance without any real upside, because you have two OpenMP runtimes that don't know about each other and hence won't manage resources as well as a single runtime could in multithreading or multiprocessing use cases. |
Does this mean that merely correcting flags acceptable by clang (by adding |
brew gist-logs <formula>
link ORbrew config
ANDbrew doctor
output(I'm not root on the machine, so I can't meaningfully run
brew doctor
)I asked a root for the output of
brew gist-logs openblas
, still waiting.EDIT: the root replied with
Verification
brew doctor
output saysYour system is ready to brew.
and am still able to reproduce my issue.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)?
I am trying to use Homebrew's openblas with XCode C compiler, Apple's clang:
Openblas is located in
/opt/homebrew/Cellar/openblas/0.3.29/
and itsopenblas.pc
produces the following CFLAGS:Such flags are not accepted by Apple's clang.
Specifically, on gets:
The correct format for the OpenMP option is
-Xclang -fopenmp
,as can be checked directly, or read on the R Project website: https://mac.r-project.org/openmp/
Thus,
openblas.pc
has to be fixed, but it's probably only opening a can of worms, as I have no idea whetherlibgomp
, against whichlibopenblas
is linked, is compatible with Apple clang's support of OpenMP.What happened (include all command output)?
What did you expect to happen?
It should work.
Step-by-step reproduction instructions (by running
brew
commands)The text was updated successfully, but these errors were encountered: