Fix building lib and test in non-automated (CI) env.

Also, use abbreviated ROCM_BUILD_ID environment variable for job
and build number, if it's available.

Change-Id: Ib5a721f5920f1008bb6382935f7b439429389de0
This commit is contained in:
Chris Freehill
2019-08-14 23:18:15 -05:00
والد dffa533e13
کامیت aa2db48237
3فایلهای تغییر یافته به همراه19 افزوده شده و 23 حذف شده
+10 -10
مشاهده پرونده
@@ -47,6 +47,16 @@ set(${ROCM_SMI}_VERSION_PATCH "0")
set(${ROCM_SMI}_VERSION_BUILD "0")
message("SOVERSION: ${SO_VERSION_STRING}")
## Define default variable and variables for the optional build target
## rocm_smi_lib-dev
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
CACHE STRING "Location of rocm_smi source code.")
set(CMAKE_INSTALL_PREFIX "/opt/rocm"
CACHE STRING "Default installation directory.")
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/rocm"
CACHE STRING "Default packaging prefix.")
set(CPACK_GENERATOR "DEB;RPM" CACHE STRING "Default packaging generators.")
project(${ROCM_SMI_TARGET})
# Create a configure file to get version info from within library
@@ -130,16 +140,6 @@ if ("${CMAKE_BUILD_TYPE}" STREQUAL Release)
POST_BUILD COMMAND ${CMAKE_STRIP} lib${ROCM_SMI_TARGET}.so)
endif ()
## Define default variable and variables for the optional build target
## rocm_smi_lib-dev
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}
CACHE STRING "Location of rocm_smi source code.")
set(CMAKE_INSTALL_PREFIX "/opt/rocm"
CACHE STRING "Default installation directory.")
set(CPACK_PACKAGING_INSTALL_PREFIX "/opt/rocm"
CACHE STRING "Default packaging prefix.")
set(CPACK_GENERATOR "DEB;RPM" CACHE STRING "Default packaging generators.")
## Add the install directives for the runtime library.
install(TARGETS ${ROCM_SMI_TARGET}
LIBRARY DESTINATION ${ROCM_SMI}/lib COMPONENT ${ROCM_SMI_COMPONENT})
+4 -12
مشاهده پرونده
@@ -129,21 +129,13 @@ function(get_package_version_number DEFAULT_VERSION_STRING VERSION_PREFIX GIT)
num_change_since_prev_pkg(${VERSION_PREFIX})
set(PKG_VERSION_STR "${VERSION_STRING}.${NUM_COMMITS}")
if(DEFINED ENV{JOB_NAME})
set(VERSION_JOB $ENV{JOB_NAME})
if (DEFINED ENV{ROCM_BUILD_ID})
set(VERSION_ID $ENV{ROCM_BUILD_ID})
else()
set(VERSION_JOB "local_build")
set(VERSION_ID "local_build-0")
endif()
set(PKG_VERSION_STR "${PKG_VERSION_STR}-${VERSION_JOB}")
if(DEFINED ENV{BUILD_NUMBER})
set(VERSION_BUILD_NUMBER $ENV{BUILD_NUMBER})
else()
set(VERSION_BUILD_NUMBER "0")
endif()
set(PKG_VERSION_STR "${PKG_VERSION_STR}-${VERSION_BUILD_NUMBER}")
set(PKG_VERSION_STR "${PKG_VERSION_STR}.${VERSION_ID}")
if (GIT)
execute_process(COMMAND git rev-parse --short HEAD
+5 -1
مشاهده پرونده
@@ -26,6 +26,8 @@ After the the ROCm SMI library git repository has been cloned to a local Linux m
##### ```$ cd build```
##### ```$ cmake <location of root of ROCm SMI library CMakeLists.txt>```
##### ```$ make```
##### ```# Install library file and header; default location is /opt/rocm
##### ```$ make install
The built library will appear in the `build` folder.
#### Building the Documentation
@@ -44,7 +46,9 @@ In order to verify the build and capability of ROCm SMI on your system and to se
##### ```$ mkdir <location for test build>```
##### ```$ cd <location for test build>```
##### ```$ cmake -DROCM_DIR=<location of ROCM SMI library .so> <ROCm SMI source root>/tests/rocm_smi_test```
To run the test, execute the program `rsmitst` that is built from the steps above. Make sure ROCm SMI library is in your library search path when executing the test program.
##### ```$ make
To run the test, execute the program `rsmitst` that is built from the steps above.
# Usage Basics
## Device Indices