-
Notifications
You must be signed in to change notification settings - Fork 1.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
CMake: Pass OpenMP
compiler and linker flags through CMake targets
#5180
base: develop
Are you sure you want to change the base?
Conversation
a6e2183
to
b0746c7
Compare
b0746c7
to
c856ba6
Compare
Using `OpenMP::OpenMP_LANG` targets for CMake is less error-prone than passing the compiler and linker flags manually. Furthermore, it allows the user to customize those flags by setting `OpenMP_LANG_FLAGS`, `OpenMP_LANG_LIB_NAMES`, and `OpenMP_omp_LIBRARY`.
bf2f49f
to
18ccac9
Compare
Ok, this is ready. If appropriate, I can also remove all OpenMP related code in |
see #5169 for the needed setup |
A successful test on Linux x86_64, where libomp is installed system-wide in /usr/. I ran the following:
and the linkage is correct:
|
Also works on M1 up to date system, with
openblas.pc looks correct too. |
Using
OpenMP::OpenMP_LANG
targets for CMake is less error-prone than passing the compiler and linker flags manually. Furthermore, it allows the user to customize those flags by settingOpenMP_LANG_FLAGS
,OpenMP_LANG_LIB_NAMES
, andOpenMP_omp_LIBRARY
.