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
Building FMS on macOS with clang (Apple's native clang, not LLVM clang that can be installed via homebrew) and OpenMP enabled has always been a problem, because the OpenMP library for Apple's clang must be installed separately. In spack-we can solve this using
So far, so good. But when using such a (static, unfortunately; shared would be easy) FMS library in a cmake project, it seems that this dependency on llvm-openmp's libomp doesn't make it into the makefiles. There are ways to work around this, for example building the entire project that links to FMS with
but that's far from ideal. It seems to me that FMS should be able to present itself correctly to cmake when find_package(OpenMP C Fortran) and target_link_library(...) is used, and not only link to the gfortran libgomp.dylib on macOS, but also to the C OpenMP library on macOS. Or am I wrong?
Unlike other packages, e.g. netCDF, there is no explicit way to link against a C OpenMP library:
target_link_libraries(fv3 PUBLIC NetCDF::NetCDF_C NetCDF::NetCDF_Fortran)
For OpenMP, it's only
target_link_libraries(fv3 PUBLIC OpenMP::OpenMP_Fortran)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Building FMS on macOS with clang (Apple's native clang, not LLVM clang that can be installed via homebrew) and OpenMP enabled has always been a problem, because the OpenMP library for Apple's clang must be installed separately. In spack-we can solve this using
So far, so good. But when using such a (static, unfortunately; shared would be easy) FMS library in a cmake project, it seems that this dependency on llvm-openmp's
libomp
doesn't make it into the makefiles. There are ways to work around this, for example building the entire project that links to FMS withbut that's far from ideal. It seems to me that FMS should be able to present itself correctly to cmake when
find_package(OpenMP C Fortran)
andtarget_link_library(...)
is used, and not only link to the gfortranlibgomp.dylib
on macOS, but also to the C OpenMP library on macOS. Or am I wrong?Unlike other packages, e.g. netCDF, there is no explicit way to link against a C OpenMP library:
For OpenMP, it's only
and
OpenMP::C
does not exist/leads to an error.Beta Was this translation helpful? Give feedback.
All reactions