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

C++ compiler should not be enforced globally #238

Open
dmikushin opened this issue Jun 16, 2022 · 5 comments
Open

C++ compiler should not be enforced globally #238

dmikushin opened this issue Jun 16, 2022 · 5 comments
Assignees

Comments

@dmikushin
Copy link

dmikushin commented Jun 16, 2022

When doing add_subdirectory(ThirdParty/rocThrust) from a project, rocThrust fails to install rocprim with the following error message:

CMake Error at cmake/VerifyCompiler.cmake:29 (message):
  On ROCm platform 'hipcc' or HIP-aware Clang must be used as C++ compiler.
Call Stack (most recent call first):
  CMakeLists.txt:82 (include)

Please correct me, if I'm wrong: this message requests that the CMAKE_CXX_COMPILER must be hipcc. I believe this requirement contradicts with the way how modern CMake is designed. Starting from CMake 3.18/3.23, CUDA and HIP are CMake "languages" that could be enabled with e.g. enable_language(HIP). The hipcc compiler is then provided by CMAKE_HIP_COMPILER, independently of the main CMAKE_CXX_COMPILER. Furthermore, CMake chooses the C++ compiler variant, depending on the file extension (.cpp, .cu, .hip, etc.). In order to comply with this flexibility of CMake, rocThrust should not post this error, and instead check for CMAKE_HIP_COMPILER, and use it internally if it wishes so.

@doctorcolinsmith
Copy link
Collaborator

This can be resolved in our build scripts after we update the minimum CMake version to 3.21.

@doctorcolinsmith
Copy link
Collaborator

@mfep Please take a look at this.

@saadrahim
Copy link
Member

@dmikushin Our libraries are transitioning to better support for cmake's HIP language support. I appreciate your bug report. A fix will be targeted for a future release.

@doctorcolinsmith
Copy link
Collaborator

This item is still in progress. A fix will should appear in a future release.

@StewMH
Copy link

StewMH commented May 8, 2024

Would you just consider making this a warning for now anyway? It's not easy to work around in our builds (a large project supporting multiple GPU/CPU backends).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants