-
Notifications
You must be signed in to change notification settings - Fork 15
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
[Meson] Fix how we link the OpenMP library #379
base: master
Are you sure you want to change the base?
Conversation
@nimgould
I am wondering if our issue on Mac is not related to how |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #379 +/- ##
==========================================
- Coverage 43.39% 43.34% -0.05%
==========================================
Files 313 313
Lines 161943 161943
Branches 56197 56197
==========================================
- Hits 70269 70194 -75
- Misses 74098 74180 +82
+ Partials 17576 17569 -7 ☔ View full report in Codecov by Sentry. |
Thanks for persevering with this @amontoison I have looked to see what flags are passed to the C test of sls (which calls ssids) on the mac. It seems that the linking is via the fortran (not C) compiler gfortram, and the |
Specifically, the linking for the C test is via gfortran-14 -O -g -Wall -Wno-uninitialized -fcheck=all,no-recursion -fbacktrace -fno-var-tracking-assignments -I/Users/nimg/fortran/optrove_git/galahad/modules/mac64.osx.gfo/double_64 -I/Users/nimg/fortran/optrove_git/cutest/modules/mac64.osx.gfo/double_64 -fopenmp -o run_sls /Users/nimg/fortran/optrove_git/galahad/objects/mac64.osx.gfo/double_64/slsct_double_64.o -L/Users/nimg/fortran/optrove_git/galahad/objects/mac64.osx.gfo/double_64 -lgalahad_c -lhsl_c -lgalahad -lhsl -lgalahad_spral -lstdc++ -lhwloc -L/opt/homebrew/Cellar/hwloc/2.11.2/lib -lgalahad_mkl_pardiso -lgalahad_pardiso -lgalahad_wsmp -lmetis64_nodend -lgalahad_pastix -lgalahad_mumps -lgalahad_mpi -lgalahad_umfpack -lgalahad_lapack -lgalahad_blas |
Nick, the link flag for the C++ library should be You should also add by default the OpenMP library that you want to link. It's On Mac, with some compilers like
|
OK, but then why does it work with the options I gave on the Mac? It seems to find the omp linbraries without further prompting; the manual suggests that -fopenmp is used to provide the omp libraries t link time.. Are you using gfortran to do the linking? |
It also appears that -fopenmp inserts -lgomp when linking |
Yes, but not on all platforms. It's why we should specify -lgomp or -lomp or -liomp5 depending on the compiler at link phase.
|
I'm confused, we are talking about gfortran on a Mac, not any platform, and it works for me here. I have not tested with clang/flang, indeed I am not sure we have that on our system, or whether ssids and flang work together yet. They didn't last year. flang is really sub beta at the moment, it fails on simple things. I'll try your options when I next fire up our mac, but as I asid, they are not needed for this specific case |
This discussion could help to understand the issue: Off-topic: I'm watching the "Crunch" right now (France - England in rugby 🏉 ). |
I can confirm that changing from -lsdtc++ to -lc++ does NOT work - Undefined symbols for architecture arm64: (etc, etc, etc) However -lgomp is fine (but as I mentioned, this is invoked by -fopenmp anyway, so no point in changing standard gfortran things) I am not a rugby fan, but I gather that France came second yesterday. My claim to fame is that I perfomed multiple times on the sacred Twickenham turf; we had the annual south-west London schools athletics competetions there, and I was in the relay team that broke the 4x100 metres under 12s relay recond in 1968! Of coure there was only a crowd of a few hundred parents ... |
No description provided.