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 enabled whenever it is found in the system #235

Open
ilyapopov opened this issue Aug 2, 2022 · 2 comments
Open

OpenMP is enabled whenever it is found in the system #235

ilyapopov opened this issue Aug 2, 2022 · 2 comments

Comments

@ilyapopov
Copy link
Contributor

In CmakeLists.txt, if OpenMP is found on the system, it is unconditionally enabled:

amgcl/CMakeLists.txt

Lines 60 to 68 in c71ab45

find_package(OpenMP)
if (OPENMP_FOUND)
target_compile_options(amgcl INTERFACE ${OpenMP_CXX_FLAGS})
target_link_libraries(amgcl INTERFACE
$<$<CXX_COMPILER_ID:GNU>:${OpenMP_CXX_FLAGS}>
$<$<CXX_COMPILER_ID:Clang>:${OpenMP_CXX_FLAGS}>
$<$<CXX_COMPILER_ID:Intel>:${OpenMP_CXX_FLAGS}>
)
endif ()

However, I may want to compile my application without OpenMP even though it is installed. Currently, there is no way to do that.

amgcl could define a CMake option to enable/disable use of OpenMP.

@ddemidov
Copy link
Owner

ddemidov commented Aug 3, 2022

That is a good point, but I am currently away from keyboard for about two weeks, and so won't be able to implement it right away. I'll gladly accept a pull request though.

@ilyapopov
Copy link
Contributor Author

No problem! I will try to make a PR in the coming days.

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

2 participants