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
nvcc_wrappers and c++ 14 #2035
Comments
C++1z should correspond to C++17, not C++14. In older compilers, C++14 was referred to as C++1y. The flags C++1z and C++14 should not be interchangeable; they mean different things. |
@bathmatt - can you override this in cmake so you get the C++14 flags (everywhere)? I agree with David, this could create a world of pain as certain things get enabled that aren’t really supported. |
I'm sure I can fix it in cmake, no idea how as cmake is a giant mass of unknown.. Any ideas? I'm asking for c++14 and cmake is doing this but ...
|
The problem is that |
Why does make add c++1z when asked for C++14? That doesn't make any sense. c++1z is the "I kinda support C++17 features, but that standard is not yet ratified" flag. |
Also nvcc_wrapper is not pretending anything, it is not a compiler, it just reorders flags and adds a couple. The fact that it is identified as a C++ compiler is because cmake thinks all cpp files are C++ files. In our case all cpp files are CUDA files. |
Why CMake treats
|
@crtrott I’m having a talk with CMake Rob about this. He’s here at GTC and has some ideas about how to fix this. We should set something up |
Sure I am just finishing up some stuff in my hotel room. We can meet later if you guys are interested. There are some issues around the question of do now all our users need to set CMAKE_CXX_FLAGS and CMAKE_CUDA_FLAGS? CMAKE_CXX_FLAGS wouldn't actually ever be used as far as I understand since all our C++ files are CUDA files. How do the MPI Wrappers fit into the picture? The primary reason for nvcc_wrapper originally was that mpicxx couldn't be used as the host compiler for nvcc, and nvcc couldn't be used as the CXX compiler under mpicxx. How does linking work with RDC on, where we need to have both MPI stuff linked in and NVCC must be the linker etc. |
CMake MR 3128 removes the check that tries the |
It is going to be a while before this CMake update makes its way into a release number Trilinos requires as the minimum. I think the only sensible thing to do here is have nvcc_wrapper "downgrade" c++1z to c++14. It would appear we are lucky and that CMake is not actually testing In general, Kokkos usage should be it is an error to specify -std= directly through CXXFLAGS and it is an error to request "intermediate" standards. I recommend we just make the EMPIRE fix the current solution until 2 years from now. |
@jjwilke Would this solution (for |
@mhoemmen |
Dan beat me to it. Are there any versions of nvcc that accept |
from here: https://devblogs.nvidia.com/new-compiler-features-cuda-8/
I looks like one doesn't need to mess with |
@ibaned Thanks for the explanation! We don't need |
This will break the new CMake which uses |
NVCC doesn't support C++17 yet. There is also no good way to fixing this: lets say we just swap c++1z out for c++14: if cmake actually tries to compile any C++17 feature it will fail. That might be fine though, since it may just set a feature flag to "doesn't work" instead of saying "the compiler doesn't work since the flag is not accepted" - and since down the line cmake fixes the thing, it may be acceptable to do this inside of Trilinos. Another possible long term solution is for CMake not to misidentify nvcc as gcc, when nvcc is used for non-CUDA files. |
I meant to update this yesterday. Still fighting the plague. As always, I'm afraid of adding too much implicit behavior. I would much rather crash nvcc_wrapper if it gets anything other than c++11 or c++14 flags. If someone sets CXXFLAGS to c++1z, this could cause really bizarre compiler errors. There was another sweeping set of changes - now in the cmake-no-gmake branch. We would need to temporarily allow the flag if we are inside CMake. Maybe the best thing to do for now to 1) not silently change people's flags and 2) not cause CMake to crash is literally set an environment variable in CMake and only change the flag if we know that we are inside the CMake feature test (although I'm not sure how exactly we could do this). This isn't super elegant... but gets things working. |
I believe the new logic in the latest commit addresses this. If you request For special cases like this where the feature IS supported, but CMake cannot detect that support Kokkos then manually sets the flag to This is a stop-gap to request C++14 support through standard mechanisms. As soon as minimum CMake gets bumped, we can remove this logic and |
I believe this status is good enough for the release. |
I'd like to modify nvcc_wrapper to translate c++1z to c++14 as nvcc supports the latter but not the former.. cmake is puking on this in configure on some things....
Thoughts?
The text was updated successfully, but these errors were encountered: