Skip to content

Commit

Permalink
Add NO_DEFAULT_PATH for llvm-mc, llvm-dis, clang-offload-bundler
Browse files Browse the repository at this point in the history
Found in QA image, where LLVM is installed, but rocm-llvm-dev is not.
`/usr/bin/llvm-dis` and `/opt/rocm/llvm/bin/llvm-mc` were being used to
build the `llvm_ir_to_executable` example. This version mismatch results
in a build failure.

Adding `NO_DEFAULT_PATH` to only search for these programs in the
specified paths. ${ROCM_PATH}, for example.

Signed-off-by: David Galiffi <[email protected]>
  • Loading branch information
dgaliffiAMD committed Jul 4, 2024
1 parent 77f3beb commit 0ebbc95
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions HIP-Basic/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,21 @@ if(NOT "${GPU_RUNTIME}" STREQUAL "CUDA")
llvm-dis
PATH_SUFFIXES bin
PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm
NO_DEFAULT_PATH
)
find_program(
OFFLOAD_BUNDLER_COMMAND
clang-offload-bundler
PATH_SUFFIXES bin
PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm
NO_DEFAULT_PATH
)
find_program(
LLVM_MC_COMMAND
llvm-mc
PATH_SUFFIXES bin
PATHS ${ROCM_ROOT}/llvm ${CMAKE_INSTALL_PREFIX}/llvm
NO_DEFAULT_PATH
)

if(LLVM_DIS_COMMAND AND OFFLOAD_BUNDLER_COMMAND AND LLVM_MC_COMMAND)
Expand Down

0 comments on commit 0ebbc95

Please sign in to comment.