-
Notifications
You must be signed in to change notification settings - Fork 19
[WIP] refactor OpenMP module; fixes #247 #248
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
base: master
Are you sure you want to change the base?
Conversation
changes: - append flags if either OPENMP_FOUND OR OpenMP_${_lang}_FOUND - do not set OPENMP_FOUND - make version dependence of workaround for CMake < 3.5 more explicit - do not add_definitions(-DHAVE_OPENMP) - rename to omp-flags.cmake to be more explicit and to not silently drop -DHAVE_OPENMP
The solution has been proposed and discussed in #247. @loriab @robertodr |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It’d be nice if the kit ware findopenmp let one specify wanted langs as components since I don’t usually care if Fortean omp found.
Convenience wise, I’d prefer if this module continued setting the preprocessor definition.
How new is foreach in cmake?
I agree about your comment on Should this module set |
This is where changes spill over from the build system to the code. I'd consider renaming Psi-centric, I'd just want |
I would still prefer this to spill over to the Autocmake client. Since we (the maintainers we) do not have a consensus on this issue yet, let's chug along with setting definitions in the module. If we do I suggest to loop over enabled languages only (in this way we skip the requirement for a Fortran compiler to use this module) and set |
I don't particularly care, as I'll probably stick with the file in psi4/psi4#1017. The suggestion in @robertodr's 3rd paragraph, while nominally very sensible, would bring psi back to the original complaint in #247 of failed omp detection for enabled fortran effectively turning off omp throughout. |
Yes, we should only check enabled languages but still solve the issue. I would like to give some feedback to the caller on whether something was found or not but am unsure how. The global Also unsure whether we should stop the code if I want One option is that we return variables containing flags. And then the caller can add them globally or to a target only. Also the caller can verify whether the string is empty. If non-empty, the caller can add definitions to some target. |
By the way, I started sketching out how I'd want math detection to properly interact with the new capabilities of |
Changes:
drop -DHAVE_OPENMP
Question: Unsure about the removal of
-DHAVE_OPENMP
but I am not sure what that variable means if OpenMP support is not detected for all project languages. Alternative would be to add a definition for each language separately. Yet another alternative would be to add the definition to compile flags. I am worried to break client codes since we do not have a functioning versioning and changelog in place.