-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Warnings with nvc++ as the compiler #3849
Labels
Comments
@brycelelbach @mhoemmen not sure if NVIDIA has a contributor agreement, and you guys could issue a PR? |
We'd be willing to accept a pull request to fix this issue. We do not plan to implement a fix ourselves, since we do not officially support nvc++. |
@crtrott I'm new to NVIDIA, so I'm asking about this. |
mhoemmen
added a commit
to mhoemmen/googletest
that referenced
this issue
Sep 19, 2022
When I build the current stable branch (760060059fb746018a9849234e02dc9bf003861b) of the reference mdspan implementation (https://github.com/kokkos/mdspan) with nvc++ (either 22.7 or a pre-release version), I get a couple build warnings like the following. ``` ".../tests/googletest-src/googletest/src/gtest-internal-inl.h", line 636: warning: unknown attribute "optimize" [unrecognized_attribute] GTEST_NO_INLINE_ GTEST_NO_TAIL_CALL_; ^ ``` Issue google#3849 explains: GTest is using `#elif __GNUC__` to protect use of `__attribute__((optimize("no-optimize-sibling-calls")))`. Many compilers that are not GCC define `__GNUC__` to express some degree of compatibility with GCC extensions. This includes nvc++. nvc++ does not understand this attribute, so it emits a warning. My fix just disables use of that attribute if `__NVCOMPILER` is defined. I've tested this fix with a pre-release (post-22.7) version of nvc++. It prevents the warning, and the reference mdspan implementation's tests build and run correctly. Fixes google#3849.
kunitoki
pushed a commit
to kunitoki/googletest
that referenced
this issue
Nov 4, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Steps to reproduce the bug
Does the bug persist in the most recent commit?
This was tested with the latest commit 8d51dc5
What operating system and version are you using?
RedHat 7.x
What compiler and version are you using?
What build system are you using?
cmake version 3.21.1
Additional context
The first issue can be resolved by checking for __NVCOMPILER in
googletest/googletest/include/gtest/internal/gtest-port.h
Lines 772 to 779 in 8d51dc5
I.e. the rootcause seems to be that __NVCOMPILER does define GNUC, but its not really GCC. So just making sure that the GCC variant is only used when __NVCOMPILER is not defined fixes that warning.
I would issue a PR, but not sure its worth the effort to get the corporate contributor agreement signed ..
The second warning, is likely on nvc++ itself (i mean the lock is clearly used and serves a function), however one could fix it with adding a
(void) l
in the code.The text was updated successfully, but these errors were encountered: