Remove ENV variables from CMakeLists.txt files.
[git-p4: depot-paths = "//depot/stg/hsa/drivers/hsa/runtime/": change = 1256687]
This commit is contained in:
@@ -59,9 +59,9 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/core/inc)
|
||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/libamdhsacode)
|
||||
include_directories($ENV{HSATHK_BUILD_INC_PATH})
|
||||
include_directories(${HSATHK_BUILD_INC_PATH})
|
||||
|
||||
link_directories ($ENV{HSATHK_BUILD_LIB_PATH})
|
||||
link_directories (${HSATHK_BUILD_LIB_PATH})
|
||||
|
||||
add_subdirectory(libamdhsacode)
|
||||
add_subdirectory(loader)
|
||||
|
||||
@@ -43,17 +43,20 @@ can be obtained from the ROCT-Thunk-Interface repository, available here:
|
||||
https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface
|
||||
|
||||
Specify the directory containing libhsakmt.so.1 and hsakmt.h using the following
|
||||
environment variables:
|
||||
cmake variables:
|
||||
|
||||
HSATHK_BUILD_INC_PATH - Set to the dirctory containing hsakmt.h.
|
||||
|
||||
HSATHK_BUILD_LIB_PATH - Set to the directory containing libhsakmt.so.1
|
||||
|
||||
After setting these variables, create a build directory and invoke cmake on
|
||||
the top level CMakeLists.txt file. For example, from the top level ROCR
|
||||
repository execute:
|
||||
For example, from the top level ROCR repository execute:
|
||||
|
||||
mkdir build && cd build && cmake ../src && make
|
||||
mkdir build
|
||||
cd build
|
||||
cmake -D HSATHK_BUILD_INC_PATH=<location of hsakmt.h> \
|
||||
-D HSATHK_BUILD_LIB_PATH=<location of libhsakmt.so> \
|
||||
../src
|
||||
make
|
||||
|
||||
The name of the core hsa runtime is libhsa-runtime64.so.1.
|
||||
|
||||
|
||||
@@ -50,7 +50,7 @@ endif ()
|
||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../cmake_modules")
|
||||
|
||||
## Process environment variables.
|
||||
if ( "$ENV{HSATHK_BUILD_TARGET_BITS}" STREQUAL 32 )
|
||||
if ( DEFINED HSATHK_BUILD_TARGET_BITS AND "${HSATHK_BUILD_TARGET_BITS}" STREQUAL 32 )
|
||||
set ( ONLY64STR "" )
|
||||
set ( IS64BIT 0 )
|
||||
else ()
|
||||
@@ -58,22 +58,22 @@ else ()
|
||||
set ( IS64BIT 1 )
|
||||
endif ()
|
||||
|
||||
if ( NOT EXISTS $ENV{HSATHK_BUILD_INC_PATH}/hsakmt.h )
|
||||
if ( NOT EXISTS ${HSATHK_BUILD_INC_PATH}/hsakmt.h )
|
||||
MESSAGE ( FATAL_ERROR "Environment variable HSATHK_BUILD_INC_PATH is not set to point to the location where KFD Thunk header file hsakmt.h (and rest of the thunk headers) could be found." )
|
||||
endif ()
|
||||
|
||||
if ( NOT EXISTS $ENV{HSATHK_BUILD_LIB_PATH}/libhsakmt.so.1 )
|
||||
if ( NOT EXISTS ${HSATHK_BUILD_LIB_PATH}/libhsakmt.so.1 )
|
||||
MESSAGE ( FATAL_ERROR "Environment variable HSATHK_BUILD_LIB_PATH is not set to point to the location where KFD Thunk library libhsakmt.so.1 could be found." )
|
||||
endif ()
|
||||
|
||||
if ( EXISTS $ENV{LIBSP3_BUILD_INC_PATH}/sp3.h )
|
||||
set ( LIBSP3_BUILD_INC_PATH $ENV{LIBSP3_BUILD_INC_PATH} )
|
||||
if ( EXISTS ${LIBSP3_BUILD_INC_PATH}/sp3.h )
|
||||
set ( LIBSP3_BUILD_INC_PATH ${LIBSP3_BUILD_INC_PATH} )
|
||||
else ()
|
||||
set ( LIBSP3_BUILD_INC_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../utils/sp3 )
|
||||
endif ()
|
||||
|
||||
if ( EXISTS $ENV{LIBSP3_BUILD_LIB_PATH}/libsp3.a )
|
||||
set ( LIBSP3_BUILD_LIB_PATH $ENV{LIBSP3_BUILD_LIB_PATH} )
|
||||
if ( EXISTS ${LIBSP3_BUILD_LIB_PATH}/libsp3.a )
|
||||
set ( LIBSP3_BUILD_LIB_PATH ${LIBSP3_BUILD_LIB_PATH} )
|
||||
else ()
|
||||
set ( LIBSP3_BUILD_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../utils/sp3 )
|
||||
endif ()
|
||||
@@ -152,11 +152,11 @@ set ( CORE_SRCS ${CORE_SRCS} common/hsa_table_interface.cpp )
|
||||
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
|
||||
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/../inc )
|
||||
include_directories ( ${CMAKE_CURRENT_SOURCE_DIR}/inc )
|
||||
include_directories ( $ENV{HSATHK_BUILD_INC_PATH} )
|
||||
include_directories ( ${HSATHK_BUILD_INC_PATH} )
|
||||
include_directories ( ${LIBSP3_BUILD_INC_PATH} )
|
||||
|
||||
## Library path(s).
|
||||
link_directories ( $ENV{HSATHK_BUILD_LIB_PATH} )
|
||||
link_directories ( ${HSATHK_BUILD_LIB_PATH} )
|
||||
link_directories ( ${LIBSP3_BUILD_LIB_PATH} )
|
||||
|
||||
add_library ( ${CORE_RUNTIME_TARGET} SHARED ${CORE_SRCS} )
|
||||
|
||||
Reference in New Issue
Block a user