-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Use default(none) for OpenMP definitions #3524
Use default(none) for OpenMP definitions #3524
Conversation
142e83f
to
c7fbd7a
Compare
Not sure if we can really apply this as: Ubuntu 19.04 fails with:
If I fix it Ubuntu 16.04 fails with:
|
|
I setup now an environment like Azure Ubuntu 19.10 image on my machine to get an successful build. It seems to be really impossible to get this working as:
Reasons seems to be different supported versions of OpenMP:
So I still prefer to remove support of OpenMP, as it looks completely random, when it is used and when not and it prevent us of modernize some code, because of old OpenMP versions. |
See here ;-) |
057fcfa
to
e4cfd09
Compare
I saw now that Seems |
Don't be hasty. Please check Pg 2, right column. Also, I figured out the solution to your problem. I have 2 solutions working on godbolt Apparently, |
You are right. Happens if you take a short look 2 minutes before to knock off work.
Well I believe we shouldn't check for GCC-Version, but for
Interesting thing: Your online compiler says GCC 9.2 only have OpenMP 4.5 support during the OpenMP website says it should can 5.0. Interesting thing: OpenMP spec (Chapter 7.2) says
But GCC 5.4 behaves like before OpenMP 4.0 😕 Maybe I should add an output to CMake, which prints supported OpenMP version, so we can check it. But we really want a lot of #ifdefs? |
NOTE: Visual C++ only supports OpenMP 2.0. OpenMP 3.0 and later is not supported in Visual C++. |
Ideally, no. But like @UnaNancyOwen just said, we might not escape that. I really really look forwards to OpenMP executors to eliminate pre-preprocessor compiler magic. Regarding the rest of OpenMP version and GCC versions: 🤷♂ 🤦♂ |
Well this doesn't work, no idea why 😖 (I'm using CMake 3.16 and the variables are empty)
|
Maybe look at the setup output. Mine gives the following information (without modifications):
Oh, I think you missed this in CMake documentation. It states:
As in not guaranteed |
I see it at Ubuntu 19.10 Azure build, but not on 16.04. Even my machine with CMake 3.16 is silent. And I don't see a message call for it in Changed
True, VS2017 reports as supported spec version |
cc609e0
to
144b27c
Compare
Well I don't think I missed it, as there is already an issue ;-) |
144b27c
to
426b839
Compare
0990fa9
to
8260982
Compare
I hope it compiles now all. I tested it with gcc-8, gcc-9 & clang-8. Because of this stupid thing I need to check for GCC version and not just for the version of 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.
Compiles 🚀 Good hunting @SunBlack
8260982
to
04fa716
Compare
@kunaltyagi I suggest to let this PR as it is and to not change behavior, so I'm solving your first first 3 suggestions without applying, because they have nothing to do with clang-tidy. Feel free to create some PRs to adjust them ;-) |
common/src/fft/kiss_fft.c
Outdated
@@ -255,7 +255,15 @@ void kf_work( | |||
int k; | |||
|
|||
// execute the p different work units in different threads | |||
# pragma omp parallel for | |||
#if defined _OPENMP && _OPENMP <= 201307 || (__GNUC__ >= 6 && __GNUC__ < 9) |
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.
This expression is repeated in multiple files and looks extremely cryptic. What does it test, why? I'd suggest we give it a descriptive name (e.g. OPENMP_SUPPORTS_XYZ
) and put it in pcl_macros.h
.
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 added OPENMP_LEGACY_CONST_DATA_SHARING_RULE
now (except in kiss_fft.c
as this is a C file and can't include pcl_macros.h
)
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.
Could you create a todo-issue because one of my branch's pcl_macros addresses this issue? That'll be resolved after a few merges though.
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.
Sorry for late response. Did you already have a PR for your changes related to pcl_macros or an issue where I can attach this information?
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.
Perfect, thank you! I will adjust it, when this is merged.
69511e8
to
839d068
Compare
…-*,openmp-use-default-none'
839d068
to
3bc8ca9
Compare
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.
LGTM. CI doesn't show any warnings related to 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.
The CMake part and the macro LGTM. However, I don't have enough experience with OpenMP to review the "meat" of this PR, so we'll have to rely on your judgement, @kunaltyagi
Fix warnings reported by
run-clang-tidy -header-filter='.*' -checks='-*,openmp-use-default-none'
Some notes, whch i didn't touched here:
private
if values are always uninitialized.#ifdef _OPENMP
is mostly unnecessary, as Any pragma that is not recognized is ignored.