-
-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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 5.0.1 (new formula) #20589
libomp 5.0.1 (new formula) #20589
Conversation
I do not think this is a good idea.
|
However, building with a completely different compiler can cause problems; for example, using Boost + llvm 5 vs. Boost + Apple llvm 9 vs. Boost + GCC. This does not require a completely different compiler chain. |
Agreed with @fxcoudert. This duplicates what's available in the llvm formula. It's already possible to use openmp from the llvm formula with Xcode's clang. Sorry @henryiii! We look forward to your next contribution. |
@ilovezfs , how would you do that? Including
it works. |
If anyone needs it, I've moved the PR contents to a Tap, https://github.com/CLIUtils/homebrew-apple. A cmake include file that conditionally adds this if it's installed is in https://github.com/CLIUtils/cmake/blob/master/PatchOpenMPApple.cmake. I'm using it in GooFit successfully. I'll probably write a blog post about it eventually (which I'll link in the Stack Overflow answers above) |
@henryiii mind updating this for llvm 5? We'd like to experiment with using
instead of
for formulae that need openmp. |
Okay, though keep in mind, the build and linking line is a bit different than GCC. I can make a PR to CMake to help with that in the future. |
Right I think we need some superenv (see https://github.com/Homebrew/brew/tree/master/Library/Homebrew/shims/super) support for it. It would be really nice to be able to have
"just work" |
Done. |
@henryiii thanks! Have you been able to figure out what the minimum Xcode for this magic to work is? |
@henryiii the test block seems to pass even if I remove the |
Okay, will fix that in a minute. Working on adding a travis test on multiple versions of XCode (running, unfortunately it seems, that test block...) |
Is there something obvious missing from the test block? I can get that to fail or pass manually, just not when it's part of the formula; then it always passes. |
I would think the test should fail if the |
Oh, I thought the rest ran when install ran. Nevermind, I now have a test that fails properly if those parts are removed. I'll commit it in a second. |
Ah, I see. Yeah you have to manually run |
@ilovezfs , it works with XCode 7+, from a simple test. XCode 6 fails. See https://travis-ci.org/henryiii/test_omp . (Build is still finishing for XCode 6, but it will eventually fail) Is it better to have the caveat print |
It should use Also, I think we want
since that's the minimum version for Xcode 7. |
Formula/libomp.rb
Outdated
-L#{opt_lib} -I#{opt_include} | ||
|
||
For CMake, the following will flags will cause the OpenMP::OpenMP_CXX target to be set up correctly: | ||
-DOpenMP_CXX_FLAGS="-Xpreprocessor -fopenmp -I#{opt_include}" -DOpenMP_CXX_LIB_NAMES="omp" -DOpenMP_omp_LIBRARY=#{opt_lib}/libomp.a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think by default we'd want to suggest the dylib not the .a
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a typo, I don't think it even makes a .a
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. (Actually, this one does make .a
and .dylib
; the one I had in my tap only made the dylib)
Add OpenMP for Apple Clang. Apple Clang now has support for OpenMP, but it has been disabled in the driver and is not included with High Sierra. It can be built and used, though; this formula will build it and provides hints on the correct usage.
What about adding the bottles? I can see the hashes from Jenkins, should I copy and paste them in? |
@henryiii no that is handled automatically by |
Oh, okay, thanks. Wasn't sure how that was setup. |
Thanks for your first contribution to Homebrew, @henryiii! Without people like you submitting PRs we couldn't run this project. You rock! |
I've got a patch I'm working on for CMake's FindOpenMP: https://gitlab.kitware.com/cmake/cmake/merge_requests/1812 |
Add OpenMP for Apple Clang. Apple Clang now has support for OpenMP, but
it has been disabled in the driver and is not included with High Sierra.
It can be built and used, though; this formula will build it and
provides hints on the correct usage.
There have been a few other formula in the past, such as clang-omp, that provided
special compilers and other tricks to add OpenMP. This is not like those; this is for
the built-in system Clang. On at least High Sierra, this is now possible due to the fact
that it is based on a version of Clang (4.0) that has OpenMP support; it's just not built and
included by Apple.
This is the message printed by the formula:
And, future thoughts:
OpenMP::*
targets are used. I'm investigating a patch for CMake.brew install --build-from-source <formula>
, where<formula>
is the name of the formula you're submitting?brew audit --strict <formula>
(after doingbrew install <formula>
)?