You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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):
SET ( CMAKE_C_COMPILER "/opt/local/bin/gcc-mp-9" CACHE STRING "GNU MP C compiler" )
SET ( CMAKE_CXX_COMPILER "/opt/local/bin/g++-mp-9" CACHE STRING "GNU MP C++ compiler" )
SET (CMAKE_C_FLAGS -flax-vector-conversions)
SET (CMAKE_C_FLAGS_DEBUG -flax-vector-conversions)
SET (CMAKE_C_FLAGS_RELEASE -flax-vector-conversions)
SET (OpenMP_C_FLAGS -flax-vector-conversions)
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
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h:379:70: error: incompatible type for argument 2 of '_mm_mullo_epi16'
despite having
set (CMAKE_C_FLAGS -flax-vector-conversions)
set (CMAKE_C_FLAGS_DEBUG -flax-vector-conversions)
set (CMAKE_C_FLAGS_RELEASE -flax-vector-conversions)
Activity
PaulWessel commentedon Oct 29, 2019
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.
PaulWessel commentedon Oct 29, 2019
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.
seisman commentedon Oct 29, 2019
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.
PaulWessel commentedon Oct 29, 2019
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
cmake -DCMAKE_INSTALL_PREFIX=gmt6 -DCMAKE_BUILD_TYPE=Release -G Ninja -C ~/cache.cmake ..joa-quim commentedon Oct 29, 2019
pthreadis not used anywhere in GMT, but we build a test using it (pthreads_example)seisman commentedon Oct 29, 2019
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?
joa-quim commentedon Oct 29, 2019
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.
joa-quim commentedon Oct 29, 2019
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.
[-]Add glib2 as GMT dependency[/-][+]GThread, pthread and OpenMP support[/+]claudiodsf commentedon Nov 1, 2019
I could actually let CMake found OpenMP, using Homebrew's
libomp.Details are in the attached brew formula
However compilation aborts at 42% with this error:
PaulWessel commentedon Nov 1, 2019
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....)
[-]GThread, pthread and OpenMP support[/-][+]OpenMP support on macOS[/+]seisman commentedon Jan 6, 2020
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.
PaulWessel commentedon May 2, 2020
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
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/Headers/vBasicOps.h:379:70: error: incompatible type for argument 2 of '_mm_mullo_epi16'despite having
in my cache file. After config I see
-- Using CFLAGS = '-std=gnu99 -Wextra -Wall -Wdeclaration-after-statement -fopenmp -O3 -DNDEBUG'so so much for the flax settings. Thought?
seisman commentedon May 2, 2020
It seems you have to set all variables as cached entries.
joa-quim commentedon Apr 12, 2024
Is this still an open issue?
seisman commentedon Apr 15, 2024
Yes, we still have trouble enabling OpenMP on macOS.