-
Notifications
You must be signed in to change notification settings - Fork 15.4k
Labels
cmakeBuild system in general and CMake in particularBuild system in general and CMake in particularllvmUmbrella label for LLVM issuesUmbrella label for LLVM issues
Description
#132096 introduced new llvm-gpu-loader tool that can link to HSA and CUDA runtimes.
Both checks were added deep down the source tree, in tools/llvm-gpu-loader/CMakeLists.txt:
| find_package(hsa-runtime64 QUIET 1.2.0 HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm) |
| find_package(CUDAToolkit 11.2 QUIET) |
Neither of them features a proper option() to control the dependency, and on top of that, they are both marked QUIET, so it's really easy to overlook this (as we did), and end up building packages that randomly depend on either of the runtimes, or miss the specific function.
Please:
- Do not use
QUIETfor package checks that control features included in installed tools. - Do not add dependency checks deep down the source tree — LLVM has a bunch of standard locations such as top
CMakeLists.txtandcmake/config-ix.cmake, where people actually look for changes like these. We don't really have the resources to monitor all 528CMakeLists.txtfiles in LLVM alone. - Add
option()s to control enabling the specific dependencies, so that we can cleanly control whether they are enabled or not, rather than being automatically linked if the build system incidentally happens to have them installed.
Metadata
Metadata
Assignees
Labels
cmakeBuild system in general and CMake in particularBuild system in general and CMake in particularllvmUmbrella label for LLVM issuesUmbrella label for LLVM issues