Merge branch 'amd-mainline' into amd/dev/ninohila/enable-palamida

[ROCm/rocm-core commit: 7aaa4aad57]
Šī revīzija ir iekļauta:
Hila, Nino
2025-05-12 16:29:04 -04:00
revīziju iesūtīja GitHub
revīzija f9dd07ee75
19 mainīti faili ar 716 papildinājumiem un 307 dzēšanām
+1 -1
Parādīt failu
@@ -2,4 +2,4 @@ disabled: false
scmId: gh-emu-rocm
branchesToScan:
- amd-staging
- amd-mainline
- amd-mainline
@@ -0,0 +1,15 @@
name: Rocm Validation Suite KWS
on:
push:
branches: [amd-staging, amd-mainline]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
kws:
if: ${{ github.event_name == 'pull_request' }}
uses: AMD-ROCm-Internal/rocm_ci_infra/.github/workflows/kws.yml@mainline
secrets: inherit
with:
pr_number: ${{github.event.pull_request.number}}
base_branch: ${{github.base_ref}}
@@ -0,0 +1,26 @@
name: ROCm CI Caller
on:
# Commenting below to avoid re-runs of amd smi for trivial rebases
pull_request:
branches: [release/rocm-rel-*, amd-mainline]
types: [opened, reopened, synchronize]
push:
branches: [amd-mainline]
workflow_dispatch:
issue_comment:
types: [created]
jobs:
call-workflow:
if: github.event_name != 'issue_comment' ||(github.event_name == 'issue_comment' && github.event.issue.pull_request && (startsWith(github.event.comment.body, '!verify') || startsWith(github.event.comment.body, '!verify release') || startsWith(github.event.comment.body, '!verify retest')))
uses: AMD-ROCm-Internal/rocm_ci_infra/.github/workflows/rocm_ci.yml@mainline
secrets: inherit
with:
input_sha: ${{github.event_name == 'pull_request' && github.event.pull_request.head.sha || (github.event_name == 'push' && github.sha) || (github.event_name == 'issue_comment' && github.event.issue.pull_request.head.sha) || github.sha}}
input_pr_num: ${{github.event_name == 'pull_request' && github.event.pull_request.number || (github.event_name == 'issue_comment' && github.event.issue.number) || 0}}
input_pr_url: ${{github.event_name == 'pull_request' && github.event.pull_request.html_url || (github.event_name == 'issue_comment' && github.event.issue.pull_request.html_url) || ''}}
input_pr_title: ${{github.event_name == 'pull_request' && github.event.pull_request.title || (github.event_name == 'issue_comment' && github.event.issue.pull_request.title) || ''}}
repository_name: ${{ github.repository }}
base_ref: ${{github.event_name == 'pull_request' && github.event.pull_request.base.ref || (github.event_name == 'issue_comment' && github.event.issue.pull_request.base.ref) || github.ref}}
trigger_event_type: ${{ github.event_name }}
comment_text: ${{ github.event_name == 'issue_comment' && github.event.comment.body || '' }}
+5 -1
Parādīt failu
@@ -1,6 +1,10 @@
Change Logs for rocm-core
Unreleased ROCm6.1.0 release
ROCm6.4.1 release
- Added changelog.debian and copyright for debian packages.
ROCm6.3.0 release
- Enabled Support for CMAKE Module Config.
ROCm6.1.0 release
- Added new API to get ROCm install Path (getROCmInstallPath()) at runtime
using dlinfo of rocm-core Target Library.
ROCm6.0.0 release
+116 -72
Parādīt failu
@@ -32,11 +32,32 @@ project( ${CORE_TARGET} CXX )
## Define Lib Target Name and Lib Target Install Dir to be available to c++ source
add_definitions( -DTARGET_LIBRARY_NAME=\"${CORE_TARGET}\" -DTARGET_LIBRARY_INSTALL_DIR=\"${CMAKE_INSTALL_LIBDIR}\" )
## Build Type Settings
set( CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." )
## Verbose output.
set( CMAKE_VERBOSE_MAKEFILE on )
include( GNUInstallDirs )
if(ENABLE_ASAN_PACKAGING)
# Only libraries required for ASAN Package
set( CPACK_COMPONENTS_ALL CORE_ASAN )
set( COMP_TYPE "CORE_ASAN" )
set( PKG_DESCRIPTION "ROCm AddressSanitizer Instrumented Runtime software stack" )
set( CMAKE_INSTALL_DOCDIR "${CMAKE_INSTALL_DOCDIR}-asan" )
else()
if(BUILD_SHARED_LIBS)
set( CPACK_COMPONENTS_ALL CORE_RUNTIME )
set( COMP_TYPE "CORE_RUNTIME" )
set( PKG_DESCRIPTION "ROCm Runtime software stack" )
else()
set( CPACK_COMPONENTS_ALL CORE_STATIC )
set( STATIC_COMP_TYPE "CORE_STATIC" )
set( PKG_DESCRIPTION "ROCm Static software stack" )
endif()
endif()
include( utils.cmake )
include( GNUInstallDirs )
#Parse Version
message( STATUS "ROCM_VERSION = ${ROCM_VERSION}" )
@@ -45,12 +66,12 @@ parse_rocm_version( ${ROCM_VERSION} )
set( CPACK_PACKAGING_INSTALL_PREFIX "/opt/rocm" CACHE PATH "default cpack directory" )
set( BUILD_SHARED_LIBS ON CACHE BOOL "Build shared library (.so) or not." )
set( CPACK_GENERATOR "TGZ;DEB;RPM" CACHE STRING "package types to be produced " )
set( COPYRIGHT_FILE "${CMAKE_CURRENT_SOURCE_DIR}/copyright" )
set( LICENSE_FILE "${CMAKE_CURRENT_SOURCE_DIR}/copyright" )
set( BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR} )
if(NOT ENABLE_ASAN_PACKAGING)
option(FILE_REORG_BACKWARD_COMPATIBILITY "Enable File Reorg with backward compatibility" OFF)
endif()
set( EXTENDED_PACKAGE_DESCRIPTION
"ROCM-CORE is a package which can be used to get ROCm release version, get ROCm install path information etc.
It is also important to note that ROCM-CORE takes the role as a base component on which all of ROCm can depend,
to make it easy to remove all of ROCm with a package manager." CACHE STRING "Debian Package Extended Description")
## Set variables
set_variables()
@@ -62,37 +83,25 @@ if( NOT DEFINED BUILD_ID )
set( BUILD_ID "9999")
endif()
set( PACKAGE_BUILD_INFO "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_COMMIT_COUNT}-${BUILD_ID}-${VERSION_HASH}" )
#Add the libpatch version if available
if( DEFINED VERSION_POINT )
set( PACKAGE_BUILD_INFO "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_POINT}.${VERSION_COMMIT_COUNT}-${BUILD_ID}-${VERSION_HASH}" )
message ( STATUS "PACKAGE_BUILD_INFO ${PACKAGE_BUILD_INFO}" )
else ()
set( PACKAGE_BUILD_INFO "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_COMMIT_COUNT}-${BUILD_ID}-${VERSION_HASH}" )
endif()
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/rocmmod.in ${BUILD_DIR}/rocmmod @ONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/rocm-core.postinst ${BUILD_DIR}/postinst @ONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/rocm-core.prerm ${BUILD_DIR}/prerm @ONLY )
# Setting Permission 0755 for pre/post install scripts
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/rocm-core.postinst ${BUILD_DIR}/postinst
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE @ONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/rocm-core.prerm ${BUILD_DIR}/prerm
FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE @ONLY )
#Generate BUILD_INFO
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/rocm_version.h.in ${BUILD_DIR}/rocm_version.h @ONLY )
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/rocm_getpath.h.in ${BUILD_DIR}/rocm_getpath.h @ONLY )
#File reorg Backward compatibility function
if(NOT WIN32)
if(FILE_REORG_BACKWARD_COMPATIBILITY)
# To enabe/disable #error in wrapper header files
if(NOT DEFINED ROCM_HEADER_WRAPPER_WERROR)
if(DEFINED ENV{ROCM_HEADER_WRAPPER_WERROR})
set(ROCM_HEADER_WRAPPER_WERROR "$ENV{ROCM_HEADER_WRAPPER_WERROR}"
CACHE STRING "Header wrapper warnings as errors.")
else()
set(ROCM_HEADER_WRAPPER_WERROR "OFF" CACHE STRING "Header wrapper warnings as errors.")
endif()
endif()
if(ROCM_HEADER_WRAPPER_WERROR)
set(deprecated_error 1)
else()
set(deprecated_error 0)
endif()
include(rocm-core-backward-compat.cmake)
endif() #FILE_REORG_BACKWARD_COMPATIBILITY
endif()
#Make the rocmlib
set( SRCS rocm_version.cpp rocm_getpath.cpp)
@@ -110,34 +119,20 @@ set( SO_VERSION_STRING "${SO_MAJOR}.${SO_MINOR}.${ROCM_LIBPATCH_VERSION}" )
set_property( TARGET ${CORE_TARGET} PROPERTY VERSION "${SO_VERSION_STRING}" )
set_property( TARGET ${CORE_TARGET} PROPERTY SOVERSION "${SO_MAJOR}" )
if(ENABLE_ASAN_PACKAGING)
# Only libraries required for ASAN Package
set( CPACK_COMPONENTS_ALL CORE_ASAN )
set( COMP_TYPE "CORE_ASAN" )
set( PKG_DESCRIPTION "Radeon Open Compute (ROCm) AddressSanitizer Instrumented Runtime software stack" )
#Add the libpatch version if available to the version file
if( DEFINED VERSION_POINT )
file ( WRITE "${CMAKE_CURRENT_BINARY_DIR}/version" "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}.${VERSION_POINT}\n" )
else()
if(BUILD_SHARED_LIBS)
set( CPACK_COMPONENTS_ALL CORE_RUNTIME )
set( COMP_TYPE "CORE_RUNTIME" )
set( PKG_DESCRIPTION "Radeon Open Compute (ROCm) Runtime software stack" )
else()
set( CPACK_COMPONENTS_ALL CORE_STATIC )
set( STATIC_COMP_TYPE "CORE_STATIC" )
set( PKG_DESCRIPTION "Radeon Open Compute (ROCm) Static software stack" )
endif()
file ( WRITE "${CMAKE_CURRENT_BINARY_DIR}/version" "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}\n" )
endif()
#intallation directive
file ( WRITE "${CMAKE_CURRENT_BINARY_DIR}/version" "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}-${BUILD_ID}\n" )
## Support for Static and Shared Target Packaging
if(BUILD_SHARED_LIBS)
install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/version DESTINATION .info COMPONENT CORE_RUNTIME )
install ( FILES ${BUILD_DIR}/version DESTINATION .info COMPONENT CORE_RUNTIME )
# Target Library needs to installed/packaged to same destination
# in both ASAN and nonASAN Shared library builds
install ( TARGETS ${CORE_TARGET} DESTINATION ${CMAKE_INSTALL_LIBDIR}
PERMISSIONS OWNER_WRITE OWNER_READ OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
install ( TARGETS ${CORE_TARGET} EXPORT rocmCoreTargets DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT ${COMP_TYPE} )
install ( FILES ${BUILD_DIR}/rocm_version.h ${BUILD_DIR}/rocm_getpath.h
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/rocm-core
@@ -146,22 +141,20 @@ if(BUILD_SHARED_LIBS)
install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/runpath_to_rpath.py
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/rocm-core
COMPONENT CORE_RUNTIME )
install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/rocmmod
install ( FILES ${BUILD_DIR}/rocmmod
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT CORE_RUNTIME )
# License file
install ( FILES ${COPYRIGHT_FILE}
install ( FILES ${LICENSE_FILE}
DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME LICENSE.txt
COMPONENT CORE_RUNTIME)
install ( FILES ${COPYRIGHT_FILE} DESTINATION
${CMAKE_INSTALL_DOCDIR}-asan RENAME LICENSE.txt
COMPONENT CORE_ASAN)
else()
install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/version
install ( FILES ${BUILD_DIR}/version
DESTINATION .info
COMPONENT ${STATIC_COMP_TYPE} )
install ( TARGETS ${CORE_TARGET}
EXPORT rocmCoreTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT ${STATIC_COMP_TYPE} )
@@ -172,15 +165,56 @@ else()
install ( FILES ${CMAKE_CURRENT_SOURCE_DIR}/runpath_to_rpath.py
DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/rocm-core
COMPONENT ${STATIC_COMP_TYPE} )
install ( FILES ${CMAKE_CURRENT_BINARY_DIR}/rocmmod
install ( FILES ${BUILD_DIR}/rocmmod
DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT ${STATIC_COMP_TYPE} )
# License file
install ( FILES ${COPYRIGHT_FILE}
install ( FILES ${LICENSE_FILE}
DESTINATION ${CMAKE_INSTALL_DOCDIR} RENAME LICENSE.txt
COMPONENT ${STATIC_COMP_TYPE})
endif()
## Cmake module config file configurations
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/" CACHE INTERNAL "Default module path.")
## Export the package for use from the build-tree
## (this registers the build-tree with a global CMake-registry)
export(PACKAGE ${CORE_TARGET})
set(CONF_LIB_DIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
## Create the rocm-core-config.cmake and rocm-core-config-version files
include(CMakePackageConfigHelpers)
set(CONFIG_PACKAGE_INSTALL_DIR ${CONF_LIB_DIR}/cmake/${CORE_TARGET})
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
set(INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}")
set(BIN_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}")
set(PKG_MAINTAINER_NM "ROCm Dev Support")
set(PKG_MAINTAINER_EMAIL "rocm-dev.support@amd.com")
## Generate Config File for rocm-core
configure_package_config_file(
${CMAKE_MODULE_PATH}/${CORE_TARGET}-config.cmake.in
${BUILD_DIR}/${CORE_TARGET}-config.cmake
INSTALL_DESTINATION ${CONFIG_PACKAGE_INSTALL_DIR}
PATH_VARS LIB_INSTALL_DIR INCLUDE_INSTALL_DIR BIN_INSTALL_DIR
)
## Generate config Version File for rocm-core
write_basic_package_version_file(
${BUILD_DIR}/${CORE_TARGET}-config-version.cmake
VERSION "${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}"
COMPATIBILITY SameMajorVersion)
## Install the rocm-core-config.cmake and rocm-core-config-version.cmake
install(FILES
"${PROJECT_BINARY_DIR}/${CORE_TARGET}-config.cmake"
"${PROJECT_BINARY_DIR}/${CORE_TARGET}-config-version.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${CORE_TARGET}"
COMPONENT ${COMP_TYPE})
## Install the export set for use with the install-tree
install(EXPORT rocmCoreTargets DESTINATION
"${CMAKE_INSTALL_LIBDIR}/cmake/${CORE_TARGET}" COMPONENT ${COMP_TYPE})
## Packaging directives
set ( CPACK_PACKAGE_VENDOR "Advanced Micro Devices, Inc." )
@@ -188,9 +222,9 @@ set ( CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR} )
set ( CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR} )
set ( CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH} )
set ( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}" )
set ( CPACK_PACKAGE_CONTACT "ROCm Dev Support <rocm-dev.support@amd.com>" )
set ( CPACK_PACKAGE_CONTACT "${PKG_MAINTAINER_NM} <${PKG_MAINTAINER_EMAIL}>" )
set ( CPACK_PACKAGE_DESCRIPTION_SUMMARY "${PKG_DESCRIPTION}" )
set ( CPACK_RESOURCE_FILE_LICENSE "${COPYRIGHT_FILE}" )
set ( CPACK_RESOURCE_FILE_LICENSE "${LICENSE_FILE}" )
## packaging variables
if ( DEFINED ROCM_LIBPATCH_VERSION )
set ( CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${ROCM_LIBPATCH_VERSION}" )
@@ -207,6 +241,13 @@ set ( CPACK_DEBIAN_CORE_STATIC_PACKAGE_NAME ${CORE_TARGET} )
message ( STATUS "Using CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_DEBIAN_PACKAGE_RELEASE}" )
set ( CPACK_DEBIAN_FILE_NAME "DEB-DEFAULT" )
# Debian specific packaging configuration
if(COMP_TYPE)
configure_debian_pkg( ${CORE_TARGET} ${COMP_TYPE} ${CPACK_PACKAGE_VERSION} ${PKG_MAINTAINER_NM} ${PKG_MAINTAINER_EMAIL} )
elseif(STATIC_COMP_TYPE)
configure_debian_pkg( ${CORE_TARGET} ${STATIC_COMP_TYPE} ${CPACK_PACKAGE_VERSION} ${PKG_MAINTAINER_NM} ${PKG_MAINTAINER_EMAIL} )
endif()
## RPM package specific variables
set ( CPACK_RPM_COMPONENT_INSTALL ON )
set ( CPACK_RPM_CORE_RUNTIME_PACKAGE_NAME "${CORE_TARGET}" )
@@ -215,7 +256,6 @@ set ( CPACK_RPM_CORE_ASAN_PACKAGE_NAME ${CORE_TARGET}-asan )
# STATIC package name - For Now, No change for static package Name from default
set ( CPACK_RPM_CORE_STATIC_PACKAGE_NAME ${CORE_TARGET} )
## 'dist' breaks manual builds on debian systems due to empty Provides
execute_process( COMMAND rpm --eval %{?dist}
RESULT_VARIABLE PROC_RESULT
@@ -230,28 +270,32 @@ set ( CPACK_RPM_FILE_NAME "RPM-DEFAULT" )
# Debian package specific variables
set ( CPACK_DEBIAN_PACKAGE_DEPENDS ${DEB_DEPENDS_STRING} )
set ( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/RadeonOpenCompute/ROCm" )
set ( CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/ROCm/rocm-core" )
set ( CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${BUILD_DIR}/postinst;${BUILD_DIR}/prerm" )
set ( CPACK_DEBIAN_CORE_ASAN_PACKAGE_DEPENDS ${CORE_TARGET} )
set ( CPACK_DEBIAN_CORE_RUNTIME_PACKAGE_CONTROL_EXTRA "${BUILD_DIR}/postinst;${BUILD_DIR}/prerm" )
set ( CPACK_DEBIAN_CORE_STATIC_PACKAGE_CONTROL_EXTRA "${BUILD_DIR}/postinst;${BUILD_DIR}/prerm" )
set ( CPACK_DEBIAN_CORE_RUNTIME_PACKAGE_CONTROL_EXTRA "${CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA}" )
set ( CPACK_DEBIAN_CORE_STATIC_PACKAGE_CONTROL_EXTRA "${CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA}" )
set ( CPACK_DEBIAN_PACKAGE_DESCRIPTION "${EXTENDED_PACKAGE_DESCRIPTION}" )
## RPM package specific variables
set ( CPACK_RPM_PACKAGE_REQUIRES ${RPM_DEPENDS_STRING} )
set ( CPACK_RPM_PACKAGE_LICENSE "MIT" )
set ( CPACK_RPM_CORE_ASAN_PACKAGE_REQUIRES ${CORE_TARGET} )
set ( CPACK_RPM_CORE_RUNTIME_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/postinst" )
set ( CPACK_RPM_CORE_RUNTIME_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/prerm" )
set ( CPACK_RPM_CORE_STATIC_POST_INSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/postinst" )
set ( CPACK_RPM_CORE_STATIC_POST_UNINSTALL_SCRIPT_FILE "${CMAKE_CURRENT_BINARY_DIR}/prerm" )
set ( CPACK_RPM_CORE_RUNTIME_POST_INSTALL_SCRIPT_FILE "${BUILD_DIR}/postinst" )
set ( CPACK_RPM_CORE_RUNTIME_POST_UNINSTALL_SCRIPT_FILE "${BUILD_DIR}/prerm" )
set ( CPACK_RPM_CORE_STATIC_POST_INSTALL_SCRIPT_FILE "${BUILD_DIR}/postinst" )
set ( CPACK_RPM_CORE_STATIC_POST_UNINSTALL_SCRIPT_FILE "${BUILD_DIR}/prerm" )
set ( CPACK_RPM_PACKAGE_DESCRIPTION "${EXTENDED_PACKAGE_DESCRIPTION}" )
if ( DEFINED CPACK_PACKAGING_INSTALL_PREFIX )
set ( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION "${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/.info" )
endif ( )
set ( CPACK_RPM_EXCLUDE_FROM_AUTO_FILELIST_ADDITION
"${CPACK_PACKAGING_INSTALL_PREFIX} ${CPACK_PACKAGING_INSTALL_PREFIX}/.info" )
endif()
# Backward compatibility support for deprecated package rocm-clang-ocl
# TODO: To be removed after two releases
set(CPACK_DEBIAN_RUNTIME_PACKAGE_REPLACES "rocm-clang-ocl")
set(CPACK_DEBIAN_RUNTIME_PACKAGE_CONFLICTS "rocm-clang-ocl")
set(CPACK_RPM_RUNTIME_PACKAGE_OBSOLETES "rocm-clang-ocl")
## Include packaging
+1 -1
Parādīt failu
@@ -1 +1 @@
* @nunnikri @frepaul @raramakr @ashutom @amd-isparry
* @nunnikri @frepaul @raramakr @ashutom @amd-isparry @arvindcheru
+161
Parādīt failu
@@ -0,0 +1,161 @@
# ROCM-CORE Contributing Guide
To ensure the quality of the ROCM-CORE code base, the ROCM-CORE team has
established a code review process to inform developers of the steps
that are required to shepherd a change-set into the repository.
#### Table Of Contents
[How to get started](#How-to-get-started)
[How do I contribute?](#how-do-i-contribute)
* [Reporting Issues](#reporting-issues)
* [Creating a Pull Request](#Creating-a-Pull-Request)
[Responsibility of the Author](#Responsibility-of-the-Author)
[Responsibility of the Reviewer](#Responsibility-of-the-Reviewer)
[The Review](#the-review)
[References](#References)
## How to get started
rocm-core is a utility which can be used to get ROCm release version.
It also provides the Lmod modules files for the ROCm release.
getROCmVersion function provides the ROCm version.
## How do I contribute
### Deliverables
All contributions you make will be under the [MIT Software License](copyright).
For each new file in repository,
Please include the licensing header
```
/*******************************************************************************
*
* MIT License
*
* Copyright (c) 20xx Advanced Micro Devices, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in 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:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* 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
* AUTHORS 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 IN THE
* SOFTWARE.
*
*******************************************************************************/
```
### Formatting the code
All the code is formatted using `clang-format`. To format a file, use:
```shell
clang-format-10 -style=file -i <path-to-source-file>
```
### Reporting Issues
We use [GitHub Issues](https://github.com/ROCm/rocm-core/issues) to track public **bugs** and **enhancement requests**.
#### Bugs
Please follow the template below to report any bugs found in ROCM-CORE:
1. Description: ***Please be clear and descriptive***
2. How to Reproduce the issue:
* Hardware Information:
* Docker environment or Software Version:
* Expected behavior:
* Actual behavior:
3. Any additional information:
#### Enhancement Requests
Please follow the template below to report any enhancement requests for ROCM-CORE:
1. Description: ***Please be clear and descriptive***
2. Value and Motivation:
* Feature and functionalities enabled:
* Any alternatives:
3. Any additional information:
The author must set labels (and assigns a milestone) according to his/her own understanding.
Other contributors can change these values if they disagree. That being said,
adding a small comment explaining the motivation is highly recommended.
In this way, we keep the process flexible while cultivating mutual understanding.
[**Note**] Most likely, the labels like "bug", "feature" or "complexity*"
would not be changed. However, "value*" or "urgency*" might be from mutual
understanding.
### Creating a Pull Request
No changes are allowed to be directly committed to the develop
branch of the ROCM-CORE repository. All authors are required to
develop their change sets on a separate branch and then create
a pull request (PR) to merge their changes into the develop branch.
Once a PR has been created, a developer must choose two reviewers
to review the changes made. The first reviewer should be a
technical expert in the portion of the library that the changes
are being made in. You can find a list of these experts in
[CODEOWNERS](CODEOWNERS) list.
The second reviewer should be a peer reviewer. This reviewer
can be any other ROCM-CORE developer.
## Responsibility of the Author
The author of a PR is responsible for:
* Writing clear, well documented code
* Meeting expectations of code quality
* Verifying that the changes do not break current functionality
* Writing tests to ensure code coverage
* Report on the impact to performance
## Responsibility of the Reviewer
Each reviewer is responsible for verifying that the changes are
clearly written in keeping with the coding styles of the library,
are documented in a way that future developers will be able to
understand the intent of the added functionality, and will
maintain or improve the overall quality of the codebase.
Reviewer's task checklist:
1. Has the PR passed?
2. Does the PR consist of a well-organized sequence of small commits,
each of which is designed to make one specific feature or fix ?
3. Does the PR only include a reviewable amount of changes? Or it is a
consolidation of already reviewed small batches? e.g. break it into smaller
testable and reviewable tasks instead of a huge chunk at once.
4. Does the PR have sufficient documentation and easy to read and understand,
feasible for test and future maintainence, related docs already in place?
if API or functionality has changed?
5. For bugfixes and new features, new regression test created?
6. Is every PR associated with a ticket or issue number for tracking purposes?
## The Review
During the review, reviewers will look over the changes and make
suggestions or requests for changes.
In order to assist the reviewer in prioritizing their efforts,
authors can take the following actions:
* Set the urgency and value labels
* Set the milestone where the changes need to be delivered
* Describe the testing procedure and post the measured effect of
the change
* Remind reviewers via email if a PR needs attention
* If a PR needs to be reviewed as soon as possible, explain to
the reviewers why a review may need to take priority
## References
1. [ROCM-CORE Readme](README.md)
@@ -0,0 +1,5 @@
@DEB_PACKAGE_NAME@ (@DEB_PACKAGE_VERSION@) stable; urgency=low
* ROCm Runtime software stack Base Package.
-- @DEB_MAINTAINER_NAME@ <@DEB_MAINTAINER_EMAIL@> @DEB_TIMESTAMP@
@@ -0,0 +1,26 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: @DEB_PACKAGE_NAME@
Upstream-Contact: @DEB_MAINTAINER_NAME@ <@DEB_MAINTAINER_EMAIL@>
Source: https://github.com/ROCm/@DEB_PACKAGE_NAME@
Files: *
License: @DEB_LICENSE@
Copyright: @DEB_COPYRIGHT_YEAR@ Advanced Micro Devices, Inc. All rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in 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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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
AUTHORS 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 IN THE
SOFTWARE.
+217
Parādīt failu
@@ -0,0 +1,217 @@
# ROCM-CORE Introduction
ROCM-CORE is a package which can be used to get ROCm release version, get ROCm install path information etc.
It is also important to note that ROCM-CORE takes the role as a base component on which all of ROCm can depend,
to make it easy to remove all of ROCm with a package manager.
getROCmVersion function provides the ROCm version.
It also provides an example Lmod modules files for the ROCm release.
Lmod module files can be loaded with the following commands.
``` shell
module load rocm/x.y or
module load rocm
```
You can find sources and binaries in our [GitHub repository](https://github.com/ROCm/rocm-core).
> [!NOTE]
> As with all ROCm projects, the documentation is open source. For more information, see [Contribute to ROCm documentation](https://rocm.docs.amd.com/en/latest/contribute/contributing.html).
## Installing ROCM-CORE
Before we proceed with how to install, take a look on references given below to understand System requirements, ROCm Installation prerequisites, ROCm package repository set up etc.
### Prerequisite References
* Refer [System Requirements](https://rocm.docs.amd.com/projects/install-on-linux/en/docs-6.2.2/reference/system-requirements.html#supported-gpus)
* Refer [ROCm installation for Linux](https://rocm.docs.amd.com/projects/install-on-linux/en/docs-6.2.2/index.html)
* A [ROCm](https://rocm.docs.amd.com/)-enabled platform
* To be noted that ROCM-CORE library primarily depends on having the C library available for the respective platform.
### Installing with pre-built packages
You can install ROCM-CORE on Ubuntu using
```shell
apt-get install rocm-core
```
## Building ROCM-CORE from source
You can build ROCM-CORE form source
First, get the sources from repository.
```shell
git clone https://github.com/ROCm/rocm-core.git
```
Go to Root Directory, create a build directory:
```shell
cd rocm-core; mkdir build; cd build
```
Next, configure CMake. Invoke cmake with the following variables define as deemed fit
```shell
cmake -S $PWD/../ -B . \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DCMAKE_INSTALL_PREFIX=./ \
-DROCM_VERSION="6.4.0" \
..
```
>[!NOTE]
>When specifying the path for the `CMAKE_PREFIX_PATH` variable, **do not** use the tilde (`~`)
>shorthand to represent the home directory.
### Setting up install locations
By default, the install location is set to `/opt/rocm`. You can change this using
`CMAKE_INSTALL_PREFIX`:
```shell
cmake -DCMAKE_INSTALL_PREFIX=<rocm-core-install-path> ..
```
where rocm-core-install-path is "./" in the cmake configure command shared above.
### Install
Once cmake configuration successfully completed, from the same build directory run build, install targets
```shell
cmake --build . --
cmake --build . -- install
```
### Package Generated
Once cmake configuration and build successfully completed from the same build directory trigger package generation
```shell
cmake --build . -- package
```
Once successfull execution of above command "rocm-core" RPM/DEBIAN packages will be generated (ex:rocm-core_6.4.0.60400-22.04_amd64.deb, rocm-core-6.4.0.60400-x86_64.rpm). The contents of the "rocm-core" package will include the following files:
```shell
Debian Package Sample:
$ dpkg -I rocm-core_6.4.0.60400-crdnnh.15158~22.04_amd64.deb
new debian package, version 2.0.
size 13986 bytes: control archive=2083 bytes.
305 bytes, 10 lines control
917 bytes, 11 lines md5sums
2871 bytes, 75 lines * postinst #!/bin/bash
873 bytes, 32 lines * prerm #!/bin/bash
Architecture: amd64
Description: ROCm Runtime software stack
Homepage: https://github.com/ROCm/rocm-core
Maintainer: ROCm Dev Support <rocm-dev.support@amd.com>
Package: rocm-core
Priority: optional
Section: devel
Version: 6.4.0.60400-crdnnh.15158~22.04
Installed-Size: 125
$ dpkg -c rocm-core_6.4.0.60400-crdnnh.15158~22.04_amd64.deb
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/.info/
-rw-r--r-- root/root 12 2024-11-22 10:37 ./opt/rocm-6.4.0/.info/version
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/include/
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/include/rocm-core/
-rw-r--r-- root/root 2801 2024-11-22 10:37 ./opt/rocm-6.4.0/include/rocm-core/rocm_getpath.h
-rw-r--r-- root/root 2440 2024-11-22 10:37 ./opt/rocm-6.4.0/include/rocm-core/rocm_version.h
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/cmake/
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/cmake/rocm-core/
-rw-r--r-- root/root 2878 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/cmake/rocm-core/rocm-core-config-version.cmake
-rw-r--r-- root/root 1590 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/cmake/rocm-core/rocm-core-config.cmake
-rw-r--r-- root/root 842 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/cmake/rocm-core/rocmCoreTargets-release.cmake
-rw-r--r-- root/root 3774 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/cmake/rocm-core/rocmCoreTargets.cmake
lrwxrwxrwx root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/librocm-core.so -> librocm-core.so.1
lrwxrwxrwx root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/librocm-core.so.1 -> librocm-core.so.1.0.60400
-rw-r--r-- root/root 16640 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/librocm-core.so.1.0.60400
-rw-r--r-- root/root 550 2024-11-22 10:37 ./opt/rocm-6.4.0/lib/rocmmod
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/libexec/
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/libexec/rocm-core/
-rw-r--r-- root/root 8208 2024-11-22 10:34 ./opt/rocm-6.4.0/libexec/rocm-core/runpath_to_rpath.py
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/share/
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/share/doc/
drwxr-xr-x root/root 0 2024-11-22 10:37 ./opt/rocm-6.4.0/share/doc/rocm-core/
-rw-r--r-- root/root 1113 2024-11-22 10:34 ./opt/rocm-6.4.0/share/doc/rocm-core/LICENSE.txt
RPM Package Sample:
$ rpm -qip rocm-core-6.4.0.60400-crdnnh.15158.el8.x86_64.rpm
Name : rocm-core
Version : 6.4.0.60400
Release : crdnnh.15158.el8
Architecture: x86_64
Install Date: (not installed)
Group : unknown
Size : 37096
License : MIT
Signature : (none)
Source RPM : rocm-core-6.4.0.60400-crdnnh.15158.el8.src.rpm
Build Date : Fri 22 Nov 2024 10:41:01 AM PST
Build Host : 514dbdf6c195
Relocations : /opt/rocm-6.4.0
Vendor : Advanced Micro Devices, Inc.
Summary : ROCm Runtime software stack
Description :
DESCRIPTION
===========
This is an installer created using CPack (https://cmake.org). No additional installation instructions provided.
$ rpm -qlp rocm-core-6.4.0.60400-crdnnh.15158.el8.x86_64.rpm
/opt/rocm-6.4.0
/opt/rocm-6.4.0/.info
/opt/rocm-6.4.0/.info/version
/opt/rocm-6.4.0/include
/opt/rocm-6.4.0/include/rocm-core
/opt/rocm-6.4.0/include/rocm-core/rocm_getpath.h
/opt/rocm-6.4.0/include/rocm-core/rocm_version.h
/opt/rocm-6.4.0/lib
/opt/rocm-6.4.0/lib/cmake
/opt/rocm-6.4.0/lib/cmake/rocm-core
/opt/rocm-6.4.0/lib/cmake/rocm-core/rocm-core-config-version.cmake
/opt/rocm-6.4.0/lib/cmake/rocm-core/rocm-core-config.cmake
/opt/rocm-6.4.0/lib/cmake/rocm-core/rocmCoreTargets-release.cmake
/opt/rocm-6.4.0/lib/cmake/rocm-core/rocmCoreTargets.cmake
/opt/rocm-6.4.0/lib/librocm-core.so
/opt/rocm-6.4.0/lib/librocm-core.so.1
/opt/rocm-6.4.0/lib/librocm-core.so.1.0.60400
/opt/rocm-6.4.0/lib/rocmmod
/opt/rocm-6.4.0/libexec
/opt/rocm-6.4.0/libexec/rocm-core
/opt/rocm-6.4.0/libexec/rocm-core/runpath_to_rpath.py
/opt/rocm-6.4.0/share
/opt/rocm-6.4.0/share/doc
/opt/rocm-6.4.0/share/doc/rocm-core
/opt/rocm-6.4.0/share/doc/rocm-core/LICENSE.txt
```
## ROCM-CORE Library
ROCM-CORE Library generated will be found in lib directory of the rocm-core package generated.
```shell
find . -name "librocm-core.so.*"
```
### Sample Usage of APIs provided by rocm-core Library
#### Get ROCm Version
For getting ROCm Version make use of getROCMVersion() API.
Sample Usage Example as shown below.
```C
// Usage :
int mj=0,mn=0,p=0,ret=0;
ret=getROCMVersion(&mj,&mn,&p);
if(ret !=VerSuccess ) // error occured
```
-105
Parādīt failu
@@ -1,105 +0,0 @@
Introduction:
rocm-core is a utility which can be used to get ROCm release version.
It also provides the Lmod modules files for the ROCm release.
getROCmVersion function provides the ROCm version.
Lmod module files can be loaded with the following commads.
module load rocm/x.y or
module load rocm
Build:
git clone <URL to git repo >
cd rocm-core; mkdir -p build ; cd build
After this invoke cmake with the following variables define as deemed fit
cmake \
-DCMAKE_CURRENT_BINARY_DIR=$PWD \
-DCMAKE_CURRENT_SOURCE_DIR=$PWD/../ \
-DCMAKE_VERBOSE_MAKEFILE=1 \
-DCMAKE_INSTALL_PREFIX=./ \
-DCPACK_GENERATOR=DEB \
-DCPACK_DEBIAN_PACKAGE_RELEASE="local.9999~20.04" \
-DCPACK_RPM_PACKAGE_RELEASE="local.9999" \
-DROCM_VERSION="5.5.0" \
..
make
make install
make package
After this the package "rocm-core_1.0.0-local_amd64.deb" will be generated accordingly
The content of which will be the following :
$dpkg -I rocm-core_1.0.0-local_amd64.deb
new Debian package, version 2.0.
size 6604 bytes: control archive=1608 bytes.
285 bytes, 10 lines control
191 bytes, 3 lines md5sums
2360 bytes, 65 lines * postinst #!/bin/bash
593 bytes, 25 lines * prerm #!/bin/bash
Architecture: amd64
Description: Radeon Open Compute (ROCm) Runtime software stack
Homepage: https://github.com/RadeonOpenCompute/ROCm
Maintainer: ROCm Dev Support <rocm-dev.support@amd.com>
Package: rocm-core
Priority: optional
Section: devel
Version: 1.0.0-local
Installed-Size: 70
$dpkg -c rocm-core_1.0.0-local_amd64.deb
drwxrwxr-x root/root 0 2022-11-09 09:02 ./opt/
drwxrwxr-x root/root 0 2022-11-09 09:02 ./opt/rocm/
drwxrwxr-x root/root 0 2022-11-09 09:02 ./opt/rocm/include/
-rw-r--r-- root/root 2970 2022-11-09 09:02 ./opt/rocm/include/rocm_version.h
drwxrwxr-x root/root 0 2022-11-09 09:02 ./opt/rocm/lib/
lrwxrwxrwx root/root 0 2022-11-09 09:02 ./opt/rocm/lib/librocm-core.so -> librocm-core.so.1
lrwxrwxrwx root/root 0 2022-11-09 09:02 ./opt/rocm/lib/librocm-core.so.1 -> librocm-core.so.1.0.0.
-rwxr-xr-x root/root 17096 2022-11-09 09:02 ./opt/rocm/lib/librocm-core.so.1.0.0.
-rw-r--r-- root/root 420 2022-11-09 09:02 ./opt/rocm/lib/rocmmod
The flags for the lib would the following :
$readelf -d ./opt/rocm/lib/librocm-core.so.1.0.0.
Dynamic section at offset 0x2de0 contains 28 entries:
Tag Type Name/Value
0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6]
0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1]
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000e (SONAME) Library soname: [librocm-core.so.1]
0x000000000000000c (INIT) 0x1000
0x000000000000000d (FINI) 0x12dc
0x0000000000000019 (INIT_ARRAY) 0x3dd0
0x000000000000001b (INIT_ARRAYSZ) 8 (bytes)
0x000000000000001a (FINI_ARRAY) 0x3dd8
0x000000000000001c (FINI_ARRAYSZ) 8 (bytes)
0x000000006ffffef5 (GNU_HASH) 0x2f0
0x0000000000000005 (STRTAB) 0x480
0x0000000000000006 (SYMTAB) 0x318
0x000000000000000a (STRSZ) 558 (bytes)
0x000000000000000b (SYMENT) 24 (bytes)
0x0000000000000003 (PLTGOT) 0x4000
0x0000000000000002 (PLTRELSZ) 168 (bytes)
0x0000000000000014 (PLTREL) RELA
0x0000000000000017 (JMPREL) 0x820
0x0000000000000007 (RELA) 0x760
0x0000000000000008 (RELASZ) 192 (bytes)
0x0000000000000009 (RELAENT) 24 (bytes)
0x000000006ffffffb (FLAGS_1) Flags: NODELETE
0x000000006ffffffe (VERNEED) 0x6d0
0x000000006fffffff (VERNEEDNUM) 3
0x000000006ffffff0 (VERSYM) 0x6ae
0x000000006ffffff9 (RELACOUNT) 3
0x0000000000000000 (NULL) 0x0
@@ -0,0 +1,18 @@
# - Config file for the rocm-core package
# It defines the following variables
# ROCM_CORE_INCLUDE_DIR - include directories for rocm-core
# ROCM_CORE_LIB_DIR - libraries to link against
# ROCM_PATH - Install Base Location for ROCM.
@PACKAGE_INIT@
# Compute paths
set_and_check(rocm_core_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(ROCM_CORE_INCLUDE_DIR "@PACKAGE_INCLUDE_INSTALL_DIR@")
set_and_check(rocm_core_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")
set_and_check(ROCM_CORE_LIB_DIR "@PACKAGE_LIB_INSTALL_DIR@")
set_and_check(ROCM_PATH "${PACKAGE_PREFIX_DIR}")
get_filename_component(ROCM_CORE_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include("${ROCM_CORE_CMAKE_DIR}/rocmCoreTargets.cmake")
+1 -1
Parādīt failu
@@ -1,6 +1,6 @@
MIT License
Copyright (c) 2017 - 2023 Advanced Micro Devices, Inc. All rights Reserved.
Copyright (c) 2017 - 2024 Advanced Micro Devices, Inc. All rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -1,48 +0,0 @@
/*
MIT License
Copyright (c) 2017 - 2023 Advanced Micro Devices, Inc. All rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in 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:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
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
AUTHORS 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 IN THE
SOFTWARE.
*/
#ifndef @include_guard@
#define @include_guard@
#ifndef ROCM_HEADER_WRAPPER_WERROR
#define ROCM_HEADER_WRAPPER_WERROR @deprecated_error@
#endif
#if ROCM_HEADER_WRAPPER_WERROR /* ROCM_HEADER_WRAPPER_WERROR 1 */
#error "@file_name@ has moved to @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/@headerfile_dir@ "
#else /* ROCM_HEADER_WRAPPER_WERROR 0 */
#if defined(__GNUC__)
#warning "@file_name@ has moved to @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/@headerfile_dir@ "
#else
#pragma message ("@file_name@ has moved to @CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@/@headerfile_dir@ ")
#endif
#endif /* ROCM_HEADER_WRAPPER_WERROR */
@include_statements@
@hashzero_check@
@file_contents@
@hash_endif@
#endif
@@ -1,63 +0,0 @@
# Copyright (c) 2023 Advanced Micro Devices, Inc. All Rights Reserved.
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in 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:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# 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
# AUTHORS 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 IN
# THE SOFTWARE.
cmake_minimum_required(VERSION 3.16.8)
set(ROCM_CORE_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(ROCM_CORE_WRAPPER_DIR ${ROCM_CORE_BUILD_DIR}/wrapper_dir)
set(ROCM_CORE_WRAPPER_INC_DIR ${ROCM_CORE_WRAPPER_DIR}/include)
set(headerfile_dir "rocm-core")
#Function to set actual file contents in wrapper files
#Some components grep for the contents in the file
function(set_file_contents input_file)
set(hashzero_check "#if 0
/* The following is a copy of the original file for the benefit of build systems which grep for values
* in this file rather than preprocess it. This is just for backward compatibility */")
file(READ ${input_file} file_contents)
set(hash_endif "#endif")
get_filename_component(file_name ${input_file} NAME)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/header_template.hpp.in ${ROCM_CORE_WRAPPER_INC_DIR}/${file_name})
endfunction()
#use header template file and generate wrapper header files
function(generate_wrapper_header)
file(MAKE_DIRECTORY ${ROCM_CORE_WRAPPER_INC_DIR})
#find all header files
file(GLOB include_files ${ROCM_CORE_BUILD_DIR}/*.h)
#Create wrapper files
foreach(header_file ${include_files})
# set include guard
get_filename_component(INC_GAURD_NAME ${header_file} NAME_WE)
string(TOUPPER ${INC_GAURD_NAME} INC_GAURD_NAME)
set(include_guard "ROCM_CORE_WRAPPER_INCLUDE_${INC_GAURD_NAME}_H")
#set #include statement
get_filename_component(file_name ${header_file} NAME)
set(include_statements "#include \"${headerfile_dir}/${file_name}\"\n")
set_file_contents(${header_file})
endforeach()
endfunction()
#Use template header file and generater wrapper header files
generate_wrapper_header()
install(DIRECTORY ${ROCM_CORE_WRAPPER_INC_DIR} DESTINATION . COMPONENT runtime)
+12 -3
Parādīt failu
@@ -34,20 +34,29 @@ do_update_alternatives(){
altscore=$((altscore*1000000+(now-1600000000)/60))
# Update the /opt/rocm symlink
update-alternatives --install "/opt/rocm" "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@" "$altscore"
# For custom location installation of rpm package, /opt/rocm symlink is not required
# TBD: For custom location installation of deb package.
if [[ ${ID_LIKE:-$ID} == "debian" ]] || [[ "$RPM_INSTALL_PREFIX0" == "/opt/rocm-"* ]] ; then
update-alternatives --install "/opt/rocm" "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@" "$altscore"
fi
for loc in "/usr/share/modules/modulefiles" "/usr/local/Modules/modulefiles" "/usr/share/Modules/modulefiles"
do
if [ -d "$loc" ]
then
mkdir -p "$loc/rocm"
update-alternatives --install "$loc/rocm/@ROCM_VERSION@" "rocmmod@ROCM_VERSION@" "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/rocmmod" "$altscore"
if [[ ${ID_LIKE:-$ID} == "debian" ]] ; then
update-alternatives --install "$loc/rocm/@ROCM_VERSION@" "rocmmod@ROCM_VERSION@" "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/rocmmod" "$altscore"
else
update-alternatives --install "$loc/rocm/@ROCM_VERSION@" "rocmmod@ROCM_VERSION@" "$RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_LIBDIR@/rocmmod" "$altscore"
fi
break;
fi
done
true
}
if [ -e /etc/lsb-release ] && source /etc/lsb-release && [ "$DISTRIB_ID" = "Ubuntu" ]
if [ -e /etc/os-release ] && source /etc/os-release && [[ ${ID_LIKE:-$ID} == "debian" ]]
then
case "$1" in
(configure)
+10 -3
Parādīt failu
@@ -4,11 +4,18 @@ do_update_alternatives(){
# skip update if program doesn't exist
command -v update-alternatives >/dev/null || return 0
# Update the /opt/rocm symlink
update-alternatives --remove "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@"
update-alternatives --remove "rocmmod@ROCM_VERSION@" "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/rocmmod"|| true
if [[ ${ID_LIKE:-$ID} == "debian" ]] || [[ "$RPM_INSTALL_PREFIX0" == "/opt/rocm-"* ]] ; then
update-alternatives --remove "rocm" "@CPACK_PACKAGING_INSTALL_PREFIX@"
fi
if [[ ${ID_LIKE:-$ID} == "debian" ]] ; then
update-alternatives --remove "rocmmod@ROCM_VERSION@" "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@/rocmmod"|| true
else
update-alternatives --remove "rocmmod@ROCM_VERSION@" "$RPM_INSTALL_PREFIX0/@CMAKE_INSTALL_LIBDIR@/rocmmod"|| true
fi
}
if [ -e /etc/lsb-release ] && source /etc/lsb-release && [ "$DISTRIB_ID" = "Ubuntu" ]
if [ -e /etc/os-release ] && source /etc/os-release && [[ ${ID_LIKE:-$ID} == "debian" ]]
then
case "$1" in
(remove | upgrade)
+7 -6
Parādīt failu
@@ -3,15 +3,16 @@
## Rocm module
##
module-whatis "adds `@CPACK_PACKAGING_INSTALL_PREFIX@/bin' to your PATH environment variable"
module-whatis "Adds ROCm binary paths to your environment variable"
proc ModulesHelp { } {
puts stderr "\tThe ROCM Module."
}
set ROOT [file normalize [file dirname [file normalize ${ModulesCurrentModulefile}/__]]/../..]
prepend-path PATH "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_BINDIR@:@CPACK_PACKAGING_INSTALL_PREFIX@/llvm/bin"
prepend-path MANPATH "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_MANDIR@:@CPACK_PACKAGING_INSTALL_PREFIX@/llvm/share/man1"
prepend-path CMAKE_PREFIX_PATH "@CPACK_PACKAGING_INSTALL_PREFIX@"
setenv ROCM_PATH "@CPACK_PACKAGING_INSTALL_PREFIX@"
setenv HIP_PATH "@CPACK_PACKAGING_INSTALL_PREFIX@"
prepend-path PATH "${ROOT}/@CMAKE_INSTALL_BINDIR@:${ROOT}/lib/llvm/bin"
prepend-path MANPATH "${ROOT}/@CMAKE_INSTALL_MANDIR@:${ROOT}/lib/llvm/share/man1"
prepend-path CMAKE_PREFIX_PATH "${ROOT}"
setenv ROCM_PATH "${ROOT}"
setenv HIP_PATH "${ROOT}"
+95 -3
Parādīt failu
@@ -57,6 +57,12 @@ function( parse_rocm_version VERSION_STRING )
set ( TEMP_VERSION_STRING "${TEMP_VERSION_STRING}.${PATCH}" )
endif ()
if ( ${VERSION_COUNT} GREATER 3 )
list ( GET VERSIONS 3 POINT )
set ( VERSION_POINT ${POINT} PARENT_SCOPE )
set ( TEMP_VERSION_STRING "${TEMP_VERSION_STRING}.${POINT}" )
endif ()
if ( DEFINED VERSION_BUILD )
set ( VERSION_BUILD "${VERSION_BUILD}" PARENT_SCOPE )
endif ()
@@ -113,7 +119,7 @@ function( set_variables )
endif()
#set libpatch version
if(NOT DEFINED ROCM_LIBPATCH_VERSION)
if(NOT DEFINED ENV{ROCM_LIBPATCH_VERSION})
set(ROCM_LIBPATCH_VERSION "${VERSION_MAJOR}")
string(LENGTH ${VERSION_MINOR} LENSTR)
if(LENSTR EQUAL 1) # length of version cannot be zero hence it would be 1 or greater
@@ -130,15 +136,17 @@ function( set_variables )
endif()
set(ROCM_LIBPATCH_VERSION "${ROCM_LIBPATCH_VERSION}" PARENT_SCOPE )
else()
set (ROCM_LIBPATCH_VERSION $ENV{ROCM_LIBPATCH_VERSION} PARENT_SCOPE )
endif()
if ( DEFINED CPACK_RPM_PACKAGE_RELEASE )
if ( DEFINED ENV{CPACK_RPM_PACKAGE_RELEASE} )
set ( CPACK_RPM_PACKAGE_RELEASE ${CPACK_RPM_PACKAGE_RELEASE} PARENT_SCOPE )
else()
set ( CPACK_RPM_PACKAGE_RELEASE "local" PARENT_SCOPE )
endif()
if ( DEFINED CPACK_DEBIAN_PACKAGE_RELEASE )
if ( DEFINED ENV{CPACK_DEBIAN_PACKAGE_RELEASE} )
set ( CPACK_DEBIAN_PACKAGE_RELEASE ${CPACK_DEBIAN_PACKAGE_RELEASE} PARENT_SCOPE )
else()
set ( CPACK_DEBIAN_PACKAGE_RELEASE "local" PARENT_SCOPE )
@@ -146,16 +154,100 @@ function( set_variables )
set( VERSION_COMMIT_COUNT "${VERSION_COMMIT_COUNT}" PARENT_SCOPE )
set( VERSION_HASH "${VERSION_HASH}" PARENT_SCOPE )
set( VERSION_BUILD "${VERSION_BUILD}" PARENT_SCOPE )
message(STATUS "VERSION_MAJOR : ${VERSION_MAJOR}" )
message(STATUS "VERSION_MINOR : ${VERSION_MINOR}" )
message(STATUS "VERSION_PATCH : ${VERSION_PATCH}" )
message(STATUS "VERSION_POINT : ${VERSION_POINT}" )
message(STATUS "ROCM_LIBPATCH_VERSION : ${ROCM_LIBPATCH_VERSION}" )
message(STATUS "VERSION_COMMIT_COUNT : ${VERSION_COMMIT_COUNT}" )
message(STATUS "VERSION_HASH : ${VERSION_HASH}" )
message(STATUS "VERSION_BUILD : ${VERSION_BUILD}" )
message(STATUS "CPACK_DEBIAN_PACKAGE_RELEASE : ${CPACK_DEBIAN_PACKAGE_RELEASE}" )
message(STATUS "CPACK_RPM_PACKAGE_RELEASE : ${CPACK_RPM_PACKAGE_RELEASE}" )
endfunction()
## Configure Copyright File for Debian Package
function( configure_debian_pkg PACKAGE_NAME_T COMPONENT_NAME_T PACKAGE_VERSION_T MAINTAINER_NM_T MAINTAINER_EMAIL_T)
# Check If Debian Platform
find_file (DEBIAN debian_version debconf.conf PATHS /etc)
if(DEBIAN)
set_debian_pkg_cmake_flags( ${PACKAGE_NAME_T} ${PACKAGE_VERSION_T}
${MAINTAINER_NM_T} ${MAINTAINER_EMAIL_T} )
# Create debian directory in build tree
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/DEBIAN")
# Configure the copyright file
configure_file(
"${CMAKE_SOURCE_DIR}/DEBIAN/copyright.in"
"${CMAKE_BINARY_DIR}/DEBIAN/copyright"
@ONLY
)
# Install copyright file
install ( FILES "${CMAKE_BINARY_DIR}/DEBIAN/copyright"
DESTINATION "${CMAKE_INSTALL_DOCDIR}"
COMPONENT ${COMPONENT_NAME_T} )
# Configure the changelog file
configure_file(
"${CMAKE_SOURCE_DIR}/DEBIAN/changelog.in"
"${CMAKE_BINARY_DIR}/DEBIAN/changelog.Debian"
@ONLY
)
# Install Change Log
find_program ( DEB_GZIP_EXEC gzip )
if(EXISTS "${CMAKE_BINARY_DIR}/DEBIAN/changelog.Debian" )
execute_process(
COMMAND ${DEB_GZIP_EXEC} -9 "${CMAKE_BINARY_DIR}/DEBIAN/changelog.Debian"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/DEBIAN"
RESULT_VARIABLE result
OUTPUT_VARIABLE output
ERROR_VARIABLE error
)
if(NOT ${result} EQUAL 0)
message(FATAL_ERROR "Failed to compress: ${error}")
endif()
install ( FILES "${CMAKE_BINARY_DIR}/DEBIAN/${DEB_CHANGELOG_INSTALL_FILENM}"
DESTINATION ${CMAKE_INSTALL_DOCDIR}
COMPONENT ${COMPONENT_NAME_T})
endif()
else()
message( STATUS "Ignore Configuring Debian Specific Packaging Configuration" )
endif()
endfunction()
# Set variables for changelog and copyright
# For Debian specific Packages
function( set_debian_pkg_cmake_flags DEB_PACKAGE_NAME_T DEB_PACKAGE_VERSION_T DEB_MAINTAINER_NM_T DEB_MAINTAINER_EMAIL_T )
# Setting configure flags
set( DEB_PACKAGE_NAME "${DEB_PACKAGE_NAME_T}" CACHE STRING "Debian Package Name" )
set( DEB_PACKAGE_VERSION "${DEB_PACKAGE_VERSION_T}" CACHE STRING "Debian Package Version String" )
set( DEB_MAINTAINER_NAME "${DEB_MAINTAINER_NM_T}" CACHE STRING "Debian Package Maintainer Name" )
set( DEB_MAINTAINER_EMAIL "${DEB_MAINTAINER_EMAIL_T}" CACHE STRING "Debian Package Maintainer Email" )
set( DEB_COPYRIGHT_YEAR "2025" CACHE STRING "Debian Package Copyright Year" )
set( DEB_LICENSE "MIT" CACHE STRING "Debian Package License Type" )
set( DEB_CHANGELOG_INSTALL_FILENM "changelog.Debian.gz" CACHE STRING "Debian Package ChangeLog File Name" )
# Get TimeStamp
find_program( DEB_DATE_TIMESTAMP_EXEC date )
set ( DEB_TIMESTAMP_FORMAT_OPTION "-R" )
execute_process (
COMMAND ${DEB_DATE_TIMESTAMP_EXEC} ${DEB_TIMESTAMP_FORMAT_OPTION}
OUTPUT_VARIABLE TIMESTAMP_T
)
set( DEB_TIMESTAMP "${TIMESTAMP_T}" CACHE STRING "Current Time Stamp for Copyright/Changelog" )
message(STATUS "DEB_PACKAGE_NAME : ${DEB_PACKAGE_NAME}" )
message(STATUS "DEB_PACKAGE_VERSION : ${DEB_PACKAGE_VERSION}" )
message(STATUS "DEB_MAINTAINER_NAME : ${DEB_MAINTAINER_NAME}" )
message(STATUS "DEB_MAINTAINER_EMAIL : ${DEB_MAINTAINER_EMAIL}" )
message(STATUS "DEB_COPYRIGHT_YEAR : ${DEB_COPYRIGHT_YEAR}" )
message(STATUS "DEB_LICENSE : ${DEB_LICENSE}" )
message(STATUS "DEB_TIMESTAMP : ${DEB_TIMESTAMP}" )
message(STATUS "DEB_CHANGELOG_INSTALL_FILENM : ${DEB_CHANGELOG_INSTALL_FILENM}" )
endfunction()