From 74113a559444dbbdd555a9f70577dd55b8f8654b Mon Sep 17 00:00:00 2001 From: Chris Freehill Date: Sat, 12 Sep 2020 09:51:22 -0500 Subject: [PATCH] Enable library-based rocm_smi.py Change-Id: I5443308905456defc9818fac07ac2f20fe9426fd [ROCm/rocm_smi_lib commit: 8f9f9433d86bf84fd6998c69bcaa3d4b9561e4d0] --- projects/rocm-smi-lib/CMakeLists.txt | 5 ----- projects/rocm-smi-lib/python_smi_tools/rocm-smi | 1 + .../{rocmSmiLib_cli.py => rocm_smi.py} | 0 projects/rocm-smi-lib/rocm_smi/CMakeLists.txt | 16 ++++++++++++++++ 4 files changed, 17 insertions(+), 5 deletions(-) create mode 120000 projects/rocm-smi-lib/python_smi_tools/rocm-smi rename projects/rocm-smi-lib/python_smi_tools/{rocmSmiLib_cli.py => rocm_smi.py} (100%) diff --git a/projects/rocm-smi-lib/CMakeLists.txt b/projects/rocm-smi-lib/CMakeLists.txt index efaaca9436..f2ec0ae597 100755 --- a/projects/rocm-smi-lib/CMakeLists.txt +++ b/projects/rocm-smi-lib/CMakeLists.txt @@ -149,11 +149,6 @@ set(CMN_INC_LIST ${CMN_INC_LIST} "${SHR_MUTEX_DIR}/shared_mutex.h") add_subdirectory("rocm_smi") add_subdirectory("oam") -# install(TARGETS ${ROCM_SMI_TARGET} -# LIBRARY DESTINATION ${ROCM_SMI}/lib COMPONENT ${ROCM_SMI_COMPONENT}) -# install(FILES ${COMMON_SRC_ROOT}/include/rocm_smi/rocm_smi.h -# DESTINATION rocm_smi/include/rocm_smi) - ## Add the packaging directives for the runtime library. # TODO set(CPACK_DEBIAN_PACKAGE_HOMEPAGE ) diff --git a/projects/rocm-smi-lib/python_smi_tools/rocm-smi b/projects/rocm-smi-lib/python_smi_tools/rocm-smi new file mode 120000 index 0000000000..81ced37843 --- /dev/null +++ b/projects/rocm-smi-lib/python_smi_tools/rocm-smi @@ -0,0 +1 @@ +rocm_smi.py \ No newline at end of file diff --git a/projects/rocm-smi-lib/python_smi_tools/rocmSmiLib_cli.py b/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py similarity index 100% rename from projects/rocm-smi-lib/python_smi_tools/rocmSmiLib_cli.py rename to projects/rocm-smi-lib/python_smi_tools/rocm_smi.py diff --git a/projects/rocm-smi-lib/rocm_smi/CMakeLists.txt b/projects/rocm-smi-lib/rocm_smi/CMakeLists.txt index d9b087912c..bf83d8bf4b 100755 --- a/projects/rocm-smi-lib/rocm_smi/CMakeLists.txt +++ b/projects/rocm-smi-lib/rocm_smi/CMakeLists.txt @@ -121,6 +121,22 @@ install(FILES ${COMMON_SRC_ROOT}/include/rocm_smi/rocm_smi.h DESTINATION rocm_smi/include/rocm_smi) install(FILES ${COMMON_SRC_ROOT}/include/rocm_smi/kfd_ioctl.h DESTINATION rocm_smi/include/rocm_smi) +install(FILES ${COMMON_SRC_ROOT}/python_smi_tools/rsmiBindings.py + DESTINATION rocm_smi/bindings) +install(FILES ${COMMON_SRC_ROOT}/python_smi_tools/rocm_smi.py + PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ + GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE + DESTINATION bin) +install(FILES ${COMMON_SRC_ROOT}/python_smi_tools/rocm-smi + DESTINATION bin) +add_custom_target(bindings_link ALL + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMAND ${CMAKE_COMMAND} -E create_symlink + ../rocm_smi/bindings/rsmiBindings.py bindings_link) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/bindings_link + DESTINATION bin RENAME rsmiBindings.py) + + # Generate Doxygen documentation find_package(Doxygen) find_package(LATEX COMPONENTS PDFLATEX)