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

System OpenMP used for linking when building, conda OpenMP used when running #42

Closed
johnlees opened this issue Dec 18, 2020 · 2 comments · Fixed by #72
Closed

System OpenMP used for linking when building, conda OpenMP used when running #42

johnlees opened this issue Dec 18, 2020 · 2 comments · Fixed by #72

Comments

@johnlees
Copy link
Member

If building locally, in CMake find_package(OpenMP) gets the system OpenMP. But if you use a conda LD_LIBRARY_PATH this will potentially specify a different version at runtime. In many cases they are the same, but llvm-omp may cause segfaults etc

This isn't a problem on the conda build, as conda-forge doesn't have a system openmp and fixes the rpath at the end.

I couldn't work out how to change this by modifying this command in CMake

@johnlees
Copy link
Member Author

This isn't straightforward to fix - see https://github.com/Kitware/CMake/blob/master/Modules/FindOpenMP.cmake
This compiles a test program and looks for the OpenMP flags used. No variables than can be overriden here.

One option would be to remove OpenMP::OpenMP_CXX and add flags from:

  • OpenMP_CXX_LIB_NAMES (gomp;pthread)
  • OpenMP_CXX_INCLUDE_DIRS
  • OpenMP_CXX_FLAGS

@johnlees
Copy link
Member Author

As of #44 this is manually done in CMakeLists

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

Successfully merging a pull request may close this issue.

1 participant