diff --git a/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt b/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt index f1a8bf8a82..248dd355b0 100644 --- a/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt +++ b/samples/2_Cookbook/12_cmake_hip_add_executable/CMakeLists.txt @@ -25,12 +25,12 @@ endif () if(NOT DEFINED HIP_PATH) if(NOT DEFINED ENV{HIP_PATH}) - set(HIP_PATH "${ROCM_PATH}/hip" CACHE PATH "Path to which HIP has been installed") + set(HIP_PATH ${ROCM_PATH} CACHE PATH "Path to which HIP has been installed") else() set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to which HIP has been installed") endif() endif() -set(CMAKE_MODULE_PATH "${HIP_PATH}/cmake" ${CMAKE_MODULE_PATH}) +set(CMAKE_MODULE_PATH "${HIP_PATH}/hip/cmake" ${CMAKE_MODULE_PATH}) set(CMAKE_HIP_ARCHITECTURES OFF) project(12_cmake) @@ -53,7 +53,7 @@ set_source_files_properties(${MY_SOURCE_FILES} PROPERTIES HIP_SOURCE_PROPERTY_FO hip_add_executable(${MY_TARGET_NAME} ${MY_SOURCE_FILES} HIPCC_OPTIONS ${MY_HIPCC_OPTIONS} HCC_OPTIONS ${MY_HCC_OPTIONS} CLANG_OPTIONS ${MY_CLANG_OPTIONS} NVCC_OPTIONS ${MY_NVCC_OPTIONS}) # Search for rocm in common locations -list(APPEND CMAKE_PREFIX_PATH ${HIP_PATH} ${ROCM_PATH}) +list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH}/hip ${ROCM_PATH}) find_package(hip QUIET) if(TARGET hip::host) message(STATUS "Found hip::host at ${hip_DIR}") diff --git a/samples/2_Cookbook/16_assembly_to_executable/Makefile b/samples/2_Cookbook/16_assembly_to_executable/Makefile index b82ec8fdbe..0a32aa2b9c 100644 --- a/samples/2_Cookbook/16_assembly_to_executable/Makefile +++ b/samples/2_Cookbook/16_assembly_to_executable/Makefile @@ -21,15 +21,15 @@ ifeq ($(OS),Windows_NT) $(error Makefile is not supported on windows platform. Please use cmake instead to build sample.) endif ROCM_PATH?= $(wildcard /opt/rocm/) -HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) +HIP_PATH?= $(ROCM_PATH) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif HIPCC=$(HIP_PATH)/bin/hipcc -CLANG=$(HIP_PATH)/../llvm/bin/clang -LLVM_MC=$(HIP_PATH)/../llvm/bin/llvm-mc -CLANG_OFFLOAD_BUNDLER=$(HIP_PATH)/../llvm/bin/clang-offload-bundler +CLANG=$(HIP_PATH)/llvm/bin/clang +LLVM_MC=$(HIP_PATH)/llvm/bin/llvm-mc +CLANG_OFFLOAD_BUNDLER=$(HIP_PATH)/llvm/bin/clang-offload-bundler SRCS=square.cpp diff --git a/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile b/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile index 835f4b2789..d68304dcac 100644 --- a/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile +++ b/samples/2_Cookbook/17_llvm_ir_to_executable/Makefile @@ -21,17 +21,17 @@ ifeq ($(OS),Windows_NT) $(error Makefile is not supported on windows platform. Please use cmake instead to build sample.) endif ROCM_PATH?= $(wildcard /opt/rocm/) -HIP_PATH?= $(wildcard $(ROCM_PATH)/hip) +HIP_PATH?= $(ROCM_PATH) ifeq (,$(HIP_PATH)) HIP_PATH=../../.. endif HIPCC=$(HIP_PATH)/bin/hipcc -CLANG=$(HIP_PATH)/../llvm/bin/clang -LLVM_MC=$(HIP_PATH)/../llvm/bin/llvm-mc -CLANG_OFFLOAD_BUNDLER=$(HIP_PATH)/../llvm/bin/clang-offload-bundler -LLVM_AS=$(HIP_PATH)/../llvm/bin/llvm-as -LLVM_DIS=$(HIP_PATH)/../llvm/bin/llvm-dis +CLANG=$(HIP_PATH)/llvm/bin/clang +LLVM_MC=$(HIP_PATH)/llvm/bin/llvm-mc +CLANG_OFFLOAD_BUNDLER=$(HIP_PATH)/llvm/bin/clang-offload-bundler +LLVM_AS=$(HIP_PATH)/llvm/bin/llvm-as +LLVM_DIS=$(HIP_PATH)/llvm/bin/llvm-dis SRCS=square.cpp