-
Notifications
You must be signed in to change notification settings - Fork 139
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
Check for OpenMP compiler support #4422
Conversation
Added find_package call and meaningful error message.
CMakeLists.txt
Outdated
find_package(OpenMP) | ||
if(NOT OpenMP_FOUND) | ||
message(FATAL_ERROR "No compiler support for OpenMP..." | ||
"need to use -DQMC_OMP=OFF") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will push an edit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you been able to test this? e.g. Does the fruit company's compiler result in this error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested this code, but I think that this OpenMP availability test will need to be higher up. e.g. if the libstdc++ check has -fopenmp on the compile line, it will already have failed before we reach this point. The OpenMP test should be one of the first run.
CMakeLists.txt
Outdated
# Check for OpenMP compiler support if requested | ||
#--------------------------------------------------------- | ||
if(QMC_OMP) | ||
find_package(OpenMP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment before this line saying
# OpenMP package currently is only used to to verify compiler support. No feature of this package is been used and we customize OpenMP options directly in per vendor configurations.
This test needs to go before the Testlibstdc++ check, otherwise that can fail for the wrong reason. After the move, the current AppleClang 14.0.0.14000029 fails on the cxx17 check. According to https://en.cppreference.com/w/cpp/compiler_support/17 this is the correct result since memory resources are not yet implemented. Hopefully this will change shortly. with QMC_OMP=ON or not specified:
with QMC_OMP=OFF:
|
@prckent I moved the openmp check up. Could you verify if it works for you? If yes. Please proceed to merge this PR. |
Can confirm your fix reproduces my local fix. |
Test this please |
Proposed changes
Added find_package call and meaningful error message.
Closes #4372
What type(s) of changes does this code introduce?
Does this introduce a breaking change?
What systems has this change been tested on?
Ubuntu 22.04
Checklist