Closed Maetveis closed 2 years ago
Hmm, there are lot of other project
calls in the tests, probably most of them also don't compile any code. Should I change those calls as well?
- Finally when the build of rocm-cmake is embedded in an other project (as in the case of rocRAND)
How is rocRAND embedding rocm-cmake? You mean like add_subdirectory
?
- Finally when the build of rocm-cmake is embedded in an other project (as in the case of rocRAND)
How is rocRAND embedding rocm-cmake? You mean like
add_subdirectory
?
It's downloading, configuring and installing it via execute_process
, when it's not found normally via find_package
as part of Dependencies.cmake
. There is some work so that this might change to using FetchContent or similar, but currently this is how its done.
Long term we would actually like to remove that code from rocRAND (and the other libraries), and have it be handled in a similar fashion to any other dependency. However this change is correct regardless, so I'm in favour.
Hmm, there are lot of other
project
calls in the tests, probably most of them also don't compile any code. Should I change those calls as well?
Changing those calls in the tests which don't compile anything would be appreciated, thanks.
I'm fine with this change regardless, but I don't see how rocm-cmake's configuration can affect your project's configuration when you're building it using execute_process like that... unless you mean that the rocm-cmake configuration itself is failing?
Yes that's what's happening, because cmake is passing the compilers via environment variables (CC
or CXX
) to the commands executed in execute_process
(this is not documented, but easy to verify by executing env
via execute_process
).
The catch is that its only setting these environment variables for the languages the project enables.
So when rocRAND (which only enables C++) is configured it needs to have CMAKE_CXX_COMPILER=amdclang
set, so that gets passed through to rocm-cmake, but cmake will search for and default to MSVC for the C compiler resulting in an error during the configuration of rocm-cmake.
Set the languages of the projects to NONE explicitly, to avoid CMake defaulting to C and C++.
From CMake command project() documentation: