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

Issues with build process for OpenMP on Mac OS #136

Open
mlesnick opened this issue Aug 25, 2018 · 0 comments
Open

Issues with build process for OpenMP on Mac OS #136

mlesnick opened this issue Aug 25, 2018 · 0 comments

Comments

@mlesnick
Copy link
Contributor

mlesnick commented Aug 25, 2018

@davidt0x's recent changes (currently in a pull request) parallelize RIVET's minimal presentation computation using openMP.

This works perfectly on Ubuntu. However, the current CMakeLists.txt file and installation procedure for Mac OS X in the documentation do not build RIVET In a way that is compatible with OpenMP. This is not awful, since RIVET will still build properly for a single core, but of course it is something we want to fix.

This issue is related to the fact that Mac OS's version Clang does not come with OpenMP. One can install the OpenMP runtime library via homebrew using the command:

brew install libomp

However, it seems that to get RIVET to actually build with OpenMP using Mac OS's clang requires some finesse with CMake that we have not yet been able to manage.

The following links may give some hints about what needs to be done:
https://stackoverflow.com/questions/44380459/is-openmp-available-in-high-sierra-llvm
https://iscinumpy.gitlab.io/post/omp-on-high-sierra/
https://stackoverflow.com/questions/49738961/cmake-support-for-openmp-on-macos-high-sierra

Note in particular that in CMake 3.12.0, a patch is added to allow OpenMP and Clang to play nicely with each other. However, it seems that naively applying the patch is not sufficient.

@xoltar has pointed out that to circumvent this issue, you can install brew's version of llvm that has a clang with openmp, or else use g++. If this is the approach we wish to recommend to users (and I'm not sure that it is, since a solution using "brew install libomp" seems not too far off), then the install instructions should explain how to do this in detail.

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

No branches or pull requests

1 participant