HIP: Adding a lower level component dependency in hip-lang-config.cmake raises several issues
Modifying the hip-lang-config.cmake to call find_dependency() to a lower level component raises several issues:
-
If the lower level config file calls check_cxx_source_compiles this fails with error CXX: needs to be enabled before use
-
During the call to CMAKE_DETERMINE_COMPILER_ABI in try_compile, the CMAKE_PREFIX_PATH (and other options passed from the top level cmake command) does not seem to be taken into account. The CMAKE_PREFIX_PATH needs to be reset inside hip-lang-config.cmake before find_dependency() otherwise it fails to find the package.
` /opt/rocm/lib/cmake/hip-lang/hip-lang-config.cmake:70 (find_dependency) /usr/local/lib64/python3.6/site-packages/cmake/data/share/cmake-3.25/Modules/CMakeHIPInformation.cmake:146 (find_package)
/test_container/hip-tests/samples/2_Cookbook/22_cmake_hip_lang/build/CMakeFiles/CMakeScratch/TryCompile-tcDjIx/CMakeLists.txt:4 (project)
CMake Error at /usr/local/lib64/python3.6/site-packages/cmake/data/share/cmake-3.25/Modules/CMakeDetermineCompilerABI.cmake:57 (try_compile):`
- If the lower level component includes a sub-dependency to a library that exists under lib64 it can't be found see #26194 (closed)