Skip to content
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

Fix OpenMP on MacOS #126

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix OpenMP on MacOS #126

wants to merge 2 commits into from

Conversation

smessmer
Copy link
Contributor

@smessmer smessmer commented Oct 2, 2024

Tested on Github Action macos-12, macos-13 (x64) and macos-14 (arm64) runners, they aren't able to find OpenMP. I don't know why the setting of CMAKE_PREFIX_PATH is not enough, but it does not work as intended. This change reinstates the code from the old cryptopp-cmake project, and this works correctly in all of the Github Action macos runners.

This change is needed for cryfs to upgrade from the previous cryptopp-cmake scripts to the this modern-cmake one.

Tested on Github Action macos-12, macos-13 (x64) and macos-14 (arm64) runners, they aren't able to find OpenMP. I don't know why the setting of `CMAKE_PREFIX_PATH` is not enough, but it does not work as intended. This change reinstates the code from the old cryptopp-cmake project, and I confirmed this works.
@smessmer
Copy link
Contributor Author

smessmer commented Oct 3, 2024

ok this is weird, the macos CI jobs here fail and say they can't find OpenMP. However, my change is written in a way that it shouldn't be able to make things worse. Previously, there was just a find_package and that find_package is still there, and this PR only changes behavior if that find_package doesn't find the package...So if the CI job found OpenMP before using this find_package call, it should still find it.

Copy link
Owner

@abdes abdes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way you could put all of the related things to OpenMP in a separate CMake module that we call with a single line of code? A custom FindOpenMP.cmake

@Vollstrecker
Copy link
Collaborator

Was there a point when this worked in the past, or did it never work and we just didn't notice? I'm sure if this never worked, there is something to fix in the find_openmp module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants