diff --git a/projects/rocm-smi-lib/CMakeLists.txt b/projects/rocm-smi-lib/CMakeLists.txt index fa53996c33..d99711d9d1 100755 --- a/projects/rocm-smi-lib/CMakeLists.txt +++ b/projects/rocm-smi-lib/CMakeLists.txt @@ -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}) diff --git a/projects/rocm-smi-lib/cmake_modules/utils.cmake b/projects/rocm-smi-lib/cmake_modules/utils.cmake index 9e69f27430..5e1c19bd3f 100755 --- a/projects/rocm-smi-lib/cmake_modules/utils.cmake +++ b/projects/rocm-smi-lib/cmake_modules/utils.cmake @@ -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 diff --git a/projects/rocm-smi-lib/docs/README.md b/projects/rocm-smi-lib/docs/README.md index 7574668df6..e6c920fcec 100755 --- a/projects/rocm-smi-lib/docs/README.md +++ b/projects/rocm-smi-lib/docs/README.md @@ -26,6 +26,8 @@ After the the ROCm SMI library git repository has been cloned to a local Linux m ##### ```$ cd build``` ##### ```$ cmake ``` ##### ```$ 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 ``` ##### ```$ cd ``` ##### ```$ cmake -DROCM_DIR= /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