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

OpenMP is not correctly included in the CMake file and causes compile errors #41

Open
schulz0r opened this issue Aug 27, 2020 · 0 comments

Comments

@schulz0r
Copy link

Dear developer team,
I am using Apple Clang to compile ColPack. The compiler throws errors because of missing omp headers. This is because the CMakeLists.txt does not include OpenMP in a correct way. Here is an instruction manual on how to include OpenMP to your projects:

target_link_libraries(ColPack_static PUBLIC OpenMP::OpenMP_CXX)
...
target_link_libraries(ColPack_shared PUBLIC OpenMP::OpenMP_CXX)

It is not enough to add a compiler flag indicating that OMP is being used. It consists of headers, binaries etc., so you have to link ColPack against the whole target OpenMP::OpenMP_CXX. CMake does the rest for you, including adding the needed compiler flags. I think you can savely delete the lines where you set with the set_target_properties() call.

Regards
Schulz0r

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

No branches or pull requests

1 participant