From 871412adffd233e41bd6ecb7a771a95132c65c66 Mon Sep 17 00:00:00 2001 From: "James Edwards (xN/A) TX" Date: Mon, 11 Apr 2016 17:18:01 -0500 Subject: [PATCH] Remove ENV variables from CMakeLists.txt files. [git-p4: depot-paths = "//depot/stg/hsa/drivers/hsa/runtime/": change = 1256687] --- runtime/hsa-runtime/CMakeLists.txt | 4 ++-- runtime/hsa-runtime/README.md | 13 ++++++++----- runtime/hsa-runtime/core/CMakeLists.txt | 18 +++++++++--------- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/runtime/hsa-runtime/CMakeLists.txt b/runtime/hsa-runtime/CMakeLists.txt index 20555fe2a5..bf3253c099 100644 --- a/runtime/hsa-runtime/CMakeLists.txt +++ b/runtime/hsa-runtime/CMakeLists.txt @@ -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) diff --git a/runtime/hsa-runtime/README.md b/runtime/hsa-runtime/README.md index 3d13340c39..2b6bea4681 100644 --- a/runtime/hsa-runtime/README.md +++ b/runtime/hsa-runtime/README.md @@ -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= \ + -D HSATHK_BUILD_LIB_PATH= \ + ../src + make The name of the core hsa runtime is libhsa-runtime64.so.1. diff --git a/runtime/hsa-runtime/core/CMakeLists.txt b/runtime/hsa-runtime/core/CMakeLists.txt index a7f4495203..3f75fe5d92 100644 --- a/runtime/hsa-runtime/core/CMakeLists.txt +++ b/runtime/hsa-runtime/core/CMakeLists.txt @@ -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} )