SWDEV-425678 - Fix build failure in HIP samples
- Due to file reorg path changes cmake fails at find_package(hip) unless CMAKE_PREFIX_PATH is set explicitly - Update CMakeLists.txt to set CMAKE_PREFIX_PATH - Update Readme Change-Id: Ibdb4419efcdd6583b059a728e48dfdb8f927a48b
This commit is contained in:
committed by
Rahul Manocha
parent
d04b8bf458
commit
4dfa7ca7e6
@@ -19,9 +19,11 @@
|
||||
# THE SOFTWARE.
|
||||
|
||||
cmake_minimum_required(VERSION 3.10)
|
||||
if (NOT DEFINED ROCM_PATH )
|
||||
set ( ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory." )
|
||||
endif ()
|
||||
if(UNIX)
|
||||
if(NOT DEFINED ROCM_PATH)
|
||||
set(ROCM_PATH "/opt/rocm" CACHE STRING "Default ROCM installation directory.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT DEFINED HIP_PATH)
|
||||
if(NOT DEFINED ENV{HIP_PATH})
|
||||
@@ -30,6 +32,9 @@ if(NOT DEFINED HIP_PATH)
|
||||
set(HIP_PATH $ENV{HIP_PATH} CACHE PATH "Path to which HIP has been installed")
|
||||
endif()
|
||||
endif()
|
||||
# Search for rocm in common locations
|
||||
list(APPEND CMAKE_PREFIX_PATH ${ROCM_PATH})
|
||||
|
||||
set(CMAKE_MODULE_PATH "${HIP_PATH}/lib/cmake/hip/" ${CMAKE_MODULE_PATH})
|
||||
set(CMAKE_HIP_ARCHITECTURES OFF)
|
||||
project(12_cmake)
|
||||
|
||||
Reference in New Issue
Block a user