-
Notifications
You must be signed in to change notification settings - Fork 339
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
OpenMP support on macOS #1926
Comments
This is all @joa-quim I think. I really want us to standardize on OpenMP as having too many different system for achieving the same thing makes maintenance much harder and add more dependencies for just a few modules. I have added OpenMP to several modules and library functions and if I find time (hah!) I would like to rewrite grdfilter to use OpenMP, etc., etc. |
But to answer your question, yes, I guess glib2 (at least for now - see above) should be treated the same way we treat other optional libs like Lapack, etc. |
OK. I will submit a PR for glib2 later. As for OpenMP, we still need to figure out how to enable OpenMP on macOS using Apple's default compiler. |
Apple has yet to implement OpenMP in their clang. once can install another version or use gcc to build it. Just install gcc and make a file (here cache.cmake):
and then
|
|
I think that's not true. I can use OpenMP with AppleClang, following this post (https://iscinumpy.gitlab.io/post/omp-on-high-sierra/), so it's doable. The only problem is cmake can't find AppleClang's OpenMP support correctly.
Since it's never used, do you think we should remove it? |
Yes, I think we should. Afaik, it was Florian that for some reason added that pthread test. Regarding OpenMP the VS support is lousy but found this, which makes think things are changing. The #pragma omp for simd seems really interesting. |
But reading this https://developercommunity.visualstudio.com/idea/351554/please-support-newer-version-of-openmp.html chills out the enthusiasm. The VS guys talk about OMP is just hard to believe they are talking seriously. |
I could actually let CMake found OpenMP, using Homebrew's Details are in the attached brew formula
However compilation aborts at 42% with this error:
|
So this works fine with gcc -fopen and clearly we are using rational comparison <. It must not like to expand the macro or the cast to signed int? (WIndows demands signed ints....) |
I recently updated cmake to 3.16.2, and cmake now can find AppleClang OpenMP correctly. However, as reported by @claudiodsf, the compilation gives an error. |
I am trying to ease back into OpenMP. Before I try Xcode, I wanted to just do gcc. This worked previously with gcc for me, but now I get tons of these
despite having
in my cache file. After config I see
so so much for the flax settings. Thought? |
It seems you have to set all variables as cached entries.
|
Is this still an open issue? |
Yes, we still have trouble enabling OpenMP on macOS. |
I think GMT also needs glib2 for gthread support, right? If yes, we should also add glib2 as an optional dependency.
A related question: is pthread used in GMT?
HAVE_PTHREAD
is almost never used in the codes.The text was updated successfully, but these errors were encountered: