From 44fb1be462bc61a668fc6643b409a2fccfd32302 Mon Sep 17 00:00:00 2001 From: Ramesh Errabolu Date: Wed, 18 Dec 2019 15:30:55 -0600 Subject: [PATCH] Support the building and packaging of legacy ROCr tools by itself Change-Id: I2247bf7a46ee93495340f7b2603b09dc6b667443 [ROCm/ROCR-Runtime commit: d015d78de30991f491823d4feb8026e535b022af] --- .../packages/rocr_tools_legacy/CMakeLists.txt | 86 +++++++++++++++++++ .../packages/rocr_tools_legacy/copyright | 38 ++++++++ .../packages/rocr_tools_legacy/description | 15 ++++ .../packages/rocr_tools_legacy/postinst | 19 ++++ .../runtime/packages/rocr_tools_legacy/prerm | 19 ++++ .../packages/rocr_tools_legacy/rpm_post | 1 + .../packages/rocr_tools_legacy/rpm_postun | 3 + 7 files changed, 181 insertions(+) create mode 100755 projects/rocr-runtime/runtime/packages/rocr_tools_legacy/CMakeLists.txt create mode 100755 projects/rocr-runtime/runtime/packages/rocr_tools_legacy/copyright create mode 100755 projects/rocr-runtime/runtime/packages/rocr_tools_legacy/description create mode 100755 projects/rocr-runtime/runtime/packages/rocr_tools_legacy/postinst create mode 100755 projects/rocr-runtime/runtime/packages/rocr_tools_legacy/prerm create mode 100755 projects/rocr-runtime/runtime/packages/rocr_tools_legacy/rpm_post create mode 100755 projects/rocr-runtime/runtime/packages/rocr_tools_legacy/rpm_postun diff --git a/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/CMakeLists.txt b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/CMakeLists.txt new file mode 100755 index 0000000000..fc53abdb5e --- /dev/null +++ b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/CMakeLists.txt @@ -0,0 +1,86 @@ +################################################################################ +## +## The University of Illinois/NCSA +## Open Source License (NCSA) +## +## Copyright (c) 2014-2017, Advanced Micro Devices, Inc. All rights reserved. +## +## Developed by: +## +## AMD Research and AMD HSA Software Development +## +## Advanced Micro Devices, Inc. +## +## www.amd.com +## +## Permission is hereby granted, free of charge, to any person obtaining a copy +## of this software and associated documentation files (the "Software"), to +## deal with the Software without restriction, including without limitation +## the rights to use, copy, modify, merge, publish, distribute, sublicense, +## and#or sell copies of the Software, and to permit persons to whom the +## Software is furnished to do so, subject to the following conditions: +## +## - Redistributions of source code must retain the above copyright notice, +## this list of conditions and the following disclaimers. +## - Redistributions in binary form must reproduce the above copyright +## notice, this list of conditions and the following disclaimers in +## the documentation and#or other materials provided with the distribution. +## - Neither the names of Advanced Micro Devices, Inc, +## nor the names of its contributors may be used to endorse or promote +## products derived from this Software without specific prior written +## permission. +## +## THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +## IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +## FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +## THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +## OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +## ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +## DEALINGS WITH THE SOFTWARE. +## +################################################################################ + +cmake_minimum_required ( VERSION 3.5.0 ) + +## Set the name and project name. +set ( PROJECT_STRING rocr-tools-legacy ) +project ( ${PROJECT_STRING} ) + +# +# The parameter "tool_objs" specifies the folder where build +# products accumulate. It is specified relative to current cmake +# binary directory +# +add_subdirectory("${CMAKE_CURRENT_SOURCE_DIR}/../../hsa-runtime-tools" "${CMAKE_CURRENT_BINARY_DIR}/tools_objs") + +## Include the cmake_modules utils.cmake +list ( APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake_modules" ) +include ( utils ) + +## Get the package version. +get_version ( "1.1.9" ) + +set( PACKAGE_VERSION_STRING "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_COMMIT_COUNT}-${VERSION_JOB}-${VERSION_HASH}" ) + +## Packaging directives +set ( CPACK_GENERATOR "DEB;RPM" CACHE STRING "Package types to build") + +set ( CPACK_PACKAGE_NAME ${PROJECT_NAME} ) +set ( CPACK_PACKAGE_VENDOR "AMD" ) +set ( CPACK_PACKAGE_VERSION ${PACKAGE_VERSION_STRING} ) +set ( CPACK_PACKAGE_CONTACT "Advanced Micro Devices Inc." ) +set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "AMD Heterogeneous System Architecture HSA - Linux HSA Runtime extensions for ROCm platforms" ) +set ( CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/description" ) +set ( CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/copyright" ) + +# Debian package specific variables +set ( CPACK_DEBIAN_PACKAGE_DEPENDS "hsakmt-roct" "hsa-rocr-dev" ) +set ( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/RadeonOpenCompute/ROCR-Runtime" ) +set ( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;${CMAKE_CURRENT_SOURCE_DIR}/prerm" ) + +# RPM package specific variables +set ( CPACK_RPM_PACKAGE_DEPENDS "hsakmt-roct" "hsa-rocr-dev" ) +set ( CPACK_RPM_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/rpm_post" ) +set ( CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/rpm_postun" ) + +include ( CPack ) diff --git a/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/copyright b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/copyright new file mode 100755 index 0000000000..1fc00dc10a --- /dev/null +++ b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/copyright @@ -0,0 +1,38 @@ +The University of Illinois/NCSA +Open Source License (NCSA) + +Copyright (c) 2014-2016, Advanced Micro Devices, Inc. All rights reserved. + +Developed by: + + AMD Research and AMD HSA Software Development + + Advanced Micro Devices, Inc. + + www.amd.com + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to +deal with the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimers in + the documentation and/or other materials provided with the distribution. + - Neither the names of Advanced Micro Devices, Inc, + nor the names of its contributors may be used to endorse or promote + products derived from this Software without specific prior written + permission. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS WITH THE SOFTWARE. + diff --git a/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/description b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/description new file mode 100755 index 0000000000..7aa5a46ef2 --- /dev/null +++ b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/description @@ -0,0 +1,15 @@ +This package includes legacy version of ROCr Tools library. The use +of this library is deprecatd and no longer supported. + +This library provides following services: + + - Kernel dispatches via PM4 path + - Collection of Performance Counters + - The last ROCm release that supported CodeXL was 2.6 + - Submission of Pm4 commands via AQL packets enables this functionality + - Support various Debugger related activities + - The last ROCm release that supported Debugger was 2.6 + +Services other than kernel dispatches are AMD private i.e. are +not defined by any specification. + diff --git a/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/postinst b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/postinst new file mode 100755 index 0000000000..5b58ca8e6d --- /dev/null +++ b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/postinst @@ -0,0 +1,19 @@ +#/bin/bash + +set -e + +do_ldconfig() { + echo /opt/rocm/hsa/lib > /etc/ld.so.conf.d/rocr_tools_legacy.conf && ldconfig +} + +case "$1" in + configure) + do_ldconfig + ;; + abort-upgrade|abort-remove|abort-deconfigure) + echo "$1" + ;; + *) + exit 0 + ;; +esac diff --git a/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/prerm b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/prerm new file mode 100755 index 0000000000..77cdc299a9 --- /dev/null +++ b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/prerm @@ -0,0 +1,19 @@ +#!/bin/bash + +set -e + +rm_ldconfig() { + rm -f /etc/ld.so.conf.d/rocr_tools_legacy.conf && ldconfig +} + +case "$1" in + remove) + rm_ldconfig + ;; + purge) + ;; + *) + exit 0 + ;; +esac + diff --git a/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/rpm_post b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/rpm_post new file mode 100755 index 0000000000..98415f5a1a --- /dev/null +++ b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/rpm_post @@ -0,0 +1 @@ +echo /opt/rocm/hsa/lib > /etc/ld.so.conf.d/rocr_tools_legacy.conf && ldconfig diff --git a/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/rpm_postun b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/rpm_postun new file mode 100755 index 0000000000..0987ae7159 --- /dev/null +++ b/projects/rocr-runtime/runtime/packages/rocr_tools_legacy/rpm_postun @@ -0,0 +1,3 @@ +if [ $1 -eq 0]; then + rm -f /etc/ld.so.conf.d/rocr_tools_legacy.conf && ldconfig +fi