From e21c0551ab9cb30f99fad5785b5d868b7a01e3eb Mon Sep 17 00:00:00 2001 From: Lauren Wrubleski Date: Thu, 23 May 2024 15:04:29 -0600 Subject: [PATCH 01/17] Cherrypick static build fixes (#189) * Packaging for static components (#182) * Initial changes for static packaging * Changelog update * Correct tests for new behaviour * Add missing parameter * Remove devel dependency on runtime for static builds * install executables to bin/asan for ASAN builds (#178) --- CHANGELOG.md | 19 +++ .../cmake/ROCMCreatePackage.cmake | 125 +++++++++++------- .../cmake/ROCMInstallTargets.cmake | 5 +- test/pass/rocm-package-setup-component.cmake | 13 +- test/test.cmake | 6 + 5 files changed, 112 insertions(+), 56 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bda5f369..87354422 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,24 @@ # Change Log for rocm-cmake +## [(Unreleased) rocm-cmake 0.13.0 for ROCm 6.2.0] +### Changed +- ROCmCreatePackage: Accepts a suffix parameter, automatically generating it for static or ASAN builds. + - Package names will no longer be pulled from `CPACK__PACKAGE_NAME` + - Runtime packages will no longer be generated for static builds +## [rocm-cmake 0.12.0 for ROCm 6.1.0] +### Added +- ROCMTest: Add rpath to installed tests +- AOCMCreatePackage: Allow additional provides on header-only packages +- ROCMSphinxDoc: Allow separate source and config directories +### Changed +- Renamed CMake package to ROCmCMakeBuildTools. A wrapper has been provided + to ensure that `find_package(ROCM)` continues to work, but it is recommended + that developers switch to `find_package(ROCmCMakeBuildTools)` +- ROCMInstallTargets: Stopped installing executables in ASAN builds +### Fixed +- ROCMClangTidy: Fixed invalid list index in clang tidy +- Fixed test failures when `ROCM_CMAKE_GENERATOR` is an empty string + ## [rocm-cmake 0.11.0 for ROCm 6.0.0] ### Changed - ROCMSphinxDoc: Improved validation, documentation and rocm-docs-core integration. diff --git a/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake b/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake index 746982d0..c55968d2 100755 --- a/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake +++ b/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake @@ -269,7 +269,7 @@ endmacro() macro(rocm_create_package) set(options LDCONFIG PTH HEADER_ONLY) - set(oneValueArgs NAME DESCRIPTION SECTION MAINTAINER LDCONFIG_DIR PREFIX) + set(oneValueArgs NAME DESCRIPTION SECTION MAINTAINER LDCONFIG_DIR PREFIX SUFFIX) set(multiValueArgs DEPENDS COMPONENTS) cmake_parse_arguments(PARSE "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) @@ -324,18 +324,18 @@ macro(rocm_create_package) endif() if (ROCM_USE_DEV_COMPONENT) + rocm_compute_component_package_name(devel "${CPACK_PACKAGE_NAME}" "${PARSE_SUFFIX}" "${PARSE_HEADER_ONLY}") list(APPEND PARSE_COMPONENTS devel) - set(CPACK_DEBIAN_DEVEL_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-dev") rocm_join_if_set(", " CPACK_DEBIAN_RUNTIME_PACKAGE_RECOMMENDS - "${CPACK_PACKAGE_NAME}-dev (>=${CPACK_PACKAGE_VERSION})") + "${CPACK_DEBIAN_DEVEL_PACKAGE_NAME} (>=${CPACK_PACKAGE_VERSION})") rocm_find_program_version(rpmbuild GREATER_EQUAL 4.12.0 QUIET) if(rpmbuild_VERSION_OK) rocm_join_if_set(", " CPACK_RPM_RUNTIME_PACKAGE_SUGGESTS - "${CPACK_PACKAGE_NAME}-devel >= ${CPACK_PACKAGE_VERSION}" + "${CPACK_RPM_DEVEL_PACKAGE_NAME} >= ${CPACK_PACKAGE_VERSION}" ) endif() - if(PARSE_HEADER_ONLY) + if(PARSE_HEADER_ONLY OR NOT BUILD_SHARED_LIBS) rocm_join_if_set(", " CPACK_DEBIAN_DEVEL_PACKAGE_PROVIDES CPACK_DEBIAN_PACKAGE_PROVIDES @@ -411,7 +411,7 @@ macro(rocm_create_package) endif() rocm_setup_license(${PARSE_HEADER_ONLY}) if(PARSE_COMPONENTS) - rocm_set_comp_cpackvar(PARSE_HEADER_ONLY "${PARSE_COMPONENTS}") + rocm_set_comp_cpackvar(PARSE_HEADER_ONLY "${PARSE_SUFFIX}" "${PARSE_COMPONENTS}") endif() include(CPack) set(ROCM_PACKAGE_CREATED TRUE CACHE INTERNAL "Track whether rocm_create_package has been called.") @@ -449,7 +449,7 @@ macro(rocm_setup_license HEADER_ONLY) FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION share/doc/${_rocm_cpack_package_name}-asan ) - elseif(ROCM_USE_DEV_COMPONENT AND ${HEADER_ONLY}) + elseif((ROCM_USE_DEV_COMPONENT AND ${HEADER_ONLY}) OR NOT BUILD_SHARED_LIBS) install( FILES ${CPACK_RESOURCE_FILE_LICENSE} DESTINATION share/doc/${_rocm_cpack_package_name} @@ -464,24 +464,74 @@ macro(rocm_setup_license HEADER_ONLY) endif() endmacro() -macro(rocm_set_comp_cpackvar HEADER_ONLY components) +macro(rocm_compute_component_package_name COMPONENT_NAME BASE_NAME NAME_SUFFIX HEADER_ONLY) + # both the fully upper and lowercased names of the components will be needed + string(TOLOWER ${COMPONENT_NAME} _component_name_lower) + string(TOUPPER ${COMPONENT_NAME} _component_name_upper) + + # determine the package name suffix due to specific build conditions + if(${NAME_SUFFIX}) + string(TOLOWER ${NAME_SUFFIX} _component_suffix) + else() + if(ENABLE_ASAN_PACKAGING) + set(_component_suffix asan) + elseif(NOT ${HEADER_ONLY} AND NOT ${BUILD_SHARED_LIBS}) + set(_component_suffix static) + endif() + endif() + if(_component_suffix) + set(_component_suffix "-${_component_suffix}") + endif() + + # determine the package name component + if(_component_name_lower STREQUAL "runtime") + set(_rpm_component_partial "") + set(_deb_component_partial "") + elseif(_component_name_lower STREQUAL "devel") + set(_rpm_component_partial "-devel") + set(_deb_component_partial "-dev") + else() + set(_rpm_component_partial "-${_component_name_lower}") + set(_deb_component_partial "-${_component_name_lower}") + endif() + + # set the package names + if(NOT DEFINED CPACK_RPM_${_component_name_upper}_PACKAGE_NAME + OR CPACK_RPM_${_component_name_upper}_PACKAGE_NAME STREQUAL "" + ) + set(CPACK_RPM_${_component_name_upper}_PACKAGE_NAME + "${BASE_NAME}${_rpm_component_partial}${_component_suffix}") + endif() + if(NOT DEFINED CPACK_DEBIAN_${_component_name_upper}_PACKAGE_NAME + OR CPACK_DEBIAN_${_component_name_upper}_PACKAGE_NAME STREQUAL "" + ) + set(CPACK_DEBIAN_${_component_name_upper}_PACKAGE_NAME + "${BASE_NAME}${_deb_component_partial}${_component_suffix}") + endif() + + # clean up temporary variables + unset(_deb_component_partial) + unset(_rpm_component_partial) + unset(_component_suffix) + unset(_component_name_upper) + unset(_component_name_lower) +endmacro(rocm_compute_component_package_name) + +macro(rocm_set_comp_cpackvar HEADER_ONLY NAME_SUFFIX components) # Setting component specific variables set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) if(NOT ROCM_USE_DEV_COMPONENT OR NOT ${HEADER_ONLY}) - set(CPACK_RPM_MAIN_COMPONENT "runtime") + rocm_compute_component_package_name("runtime" "${CPACK_PACKAGE_NAME}" "${NAME_SUFFIX}" ${HEADER_ONLY}) if (NOT ENABLE_ASAN_PACKAGING) - set(CPACK_RPM_RUNTIME_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") - list(APPEND CPACK_COMPONENTS_ALL runtime) set(CPACK_DEBIAN_RUNTIME_FILE_NAME "${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${DEBIAN_VERSION}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE}.deb") - set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") else() - set(CPACK_PACKAGE_NAME "${CPACK_PACKAGE_NAME}-asan") - set(CPACK_RPM_RUNTIME_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") set(CPACK_RPM_RUNTIME_FILE_NAME "RPM-DEFAULT") - set(CPACK_DEBIAN_RUNTIME_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") set(CPACK_DEBIAN_RUNTIME_FILE_NAME "DEB-DEFAULT") + endif() + if (NOT ${HEADER_ONLY} AND BUILD_SHARED_LIBS) + set(CPACK_RPM_MAIN_COMPONENT "runtime") list(APPEND CPACK_COMPONENTS_ALL runtime) endif() endif() @@ -497,26 +547,12 @@ macro(rocm_set_comp_cpackvar HEADER_ONLY components) string(TOUPPER "${COMPONENT}" COMPONENT_UC) set(CPACK_RPM_${COMPONENT_UC}_FILE_NAME "RPM-DEFAULT") set(CPACK_DEBIAN_${COMPONENT_UC}_FILE_NAME "DEB-DEFAULT") - if(NOT DEFINED CPACK_DEBIAN_${COMPONENT_UC}_PACKAGE_NAME - OR CPACK_DEBIAN_${COMPONENT_UC}_PACKAGE_NAME STREQUAL "") - if(NOT DEFINED CPACK_DEBIAN_PACKAGE_NAME OR CPACK_DEBIAN_PACKAGE_NAME STREQUAL "") - set(CPACK_DEBIAN_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") - endif() - string(TOLOWER "${CPACK_DEBIAN_PACKAGE_NAME}-${COMPONENT}" CPACK_DEBIAN_${COMPONENT_UC}_PACKAGE_NAME) - else() - string(REGEX REPLACE "" "${CPACK_PACKAGE_NAME}" - CPACK_DEBIAN_${COMPONENT_UC}_PACKAGE_NAME "${CPACK_DEBIAN_${COMPONENT_UC}_PACKAGE_NAME}") - endif() - if(NOT DEFINED CPACK_RPM_${COMPONENT_UC}_PACKAGE_NAME - OR CPACK_RPM_${COMPONENT_UC}_PACKAGE_NAME STREQUAL "") - if(NOT DEFINED CPACK_RPM_PACKAGE_NAME OR CPACK_RPM_PACKAGE_NAME STREQUAL "") - set(CPACK_RPM_PACKAGE_NAME "${CPACK_PACKAGE_NAME}") - endif() - string(TOLOWER "${CPACK_RPM_PACKAGE_NAME}-${COMPONENT}" CPACK_RPM_${COMPONENT_UC}_PACKAGE_NAME) - else() - string(REGEX REPLACE "" "${CPACK_PACKAGE_NAME}" - CPACK_RPM_${COMPONENT_UC}_PACKAGE_NAME "${CPACK_RPM_${COMPONENT_UC}_PACKAGE_NAME}") - endif() + rocm_compute_component_package_name("${COMPONENT}" "${CPACK_PACKAGE_NAME}" "${NAME_SUFFIX}" "${HEADER_ONLY}") + + string(REGEX REPLACE "" "${CPACK_PACKAGE_NAME}" + CPACK_DEBIAN_${COMPONENT_UC}_PACKAGE_NAME "${CPACK_DEBIAN_${COMPONENT_UC}_PACKAGE_NAME}") + string(REGEX REPLACE "" "${CPACK_PACKAGE_NAME}" + CPACK_RPM_${COMPONENT_UC}_PACKAGE_NAME "${CPACK_RPM_${COMPONENT_UC}_PACKAGE_NAME}") endforeach() if(ROCM_PACKAGE_COMPONENT_DEPENDENCIES) foreach(COMP_DEP IN LISTS ROCM_PACKAGE_COMPONENT_DEPENDENCIES) @@ -540,21 +576,16 @@ macro(rocm_package_setup_component COMPONENT_NAME) list(APPEND ROCM_PACKAGE_COMPONENTS ${COMPONENT_NAME}) - if(NOT DEFINED PARSE_PACKAGE_NAME) - string(TOLOWER "${COMPONENT_NAME}" PARSE_PACKAGE_NAME) - if(NOT BUILD_SHARED_LIBS) - set(PARSE_PACKAGE_NAME "${PARSE_PACKAGE_NAME}-static") + if(DEFINED PARSE_PACKAGE_NAME) + if(NOT DEFINED PARSE_LIBRARY_NAME) + set(PARSE_LIBRARY_NAME "") endif() - endif() - if(NOT DEFINED PARSE_LIBRARY_NAME) - set(PARSE_LIBRARY_NAME "") - endif() - - string(TOUPPER "${COMPONENT_NAME}" COMPONENT_GNAME) + string(TOUPPER "${COMPONENT_NAME}" COMPONENT_GNAME) - set(CPACK_DEBIAN_${COMPONENT_GNAME}_PACKAGE_NAME "${PARSE_LIBRARY_NAME}-${PARSE_PACKAGE_NAME}") - set(CPACK_RPM_${COMPONENT_GNAME}_PACKAGE_NAME "${PARSE_LIBRARY_NAME}-${PARSE_PACKAGE_NAME}") + set(CPACK_DEBIAN_${COMPONENT_GNAME}_PACKAGE_NAME "${PARSE_LIBRARY_NAME}-${PARSE_PACKAGE_NAME}") + set(CPACK_RPM_${COMPONENT_GNAME}_PACKAGE_NAME "${PARSE_LIBRARY_NAME}-${PARSE_PACKAGE_NAME}") + endif() if(DEFINED PARSE_PARENT) list(APPEND ROCM_PACKAGE_COMPONENT_DEPENDENCIES "${PARSE_PARENT}->${COMPONENT_NAME}") diff --git a/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake b/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake index f21fc223..463c482c 100644 --- a/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake +++ b/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake @@ -137,7 +137,7 @@ function(rocm_install_targets) set(LIB_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}) set(INCLUDE_INSTALL_DIR ${PARSE_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) elseif(ENABLE_ASAN_PACKAGING) - set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) + set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}/asan) set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan) set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) else() @@ -185,9 +185,6 @@ function(rocm_install_targets) set(export_arg EXPORT ${EXPORT_FILE}) if(T_TYPE STREQUAL "EXECUTABLE") unset(export_arg) - if(ENABLE_ASAN_PACKAGING) - continue() - endif() endif() install( TARGETS ${TARGET} diff --git a/test/pass/rocm-package-setup-component.cmake b/test/pass/rocm-package-setup-component.cmake index 546e5810..b8ed8cd8 100644 --- a/test/pass/rocm-package-setup-component.cmake +++ b/test/pass/rocm-package-setup-component.cmake @@ -1,3 +1,5 @@ +cmake_minimum_required(VERSION 3.10) + use_rocm_cmake() include(ROCMCreatePackage) include(ROCMClients) @@ -8,8 +10,8 @@ set(BUILD_SHARED_LIBS ON) rocm_package_setup_component(comp-a) test_expect_eq("${ROCM_PACKAGE_COMPONENTS}" "comp-a") -test_expect_eq("${CPACK_DEBIAN_COMP-A_PACKAGE_NAME}" "-comp-a") -test_expect_eq("${CPACK_RPM_COMP-A_PACKAGE_NAME}" "-comp-a") +test_expect_undef(CPACK_DEBIAN_COMP-A_PACKAGE_NAME) +test_expect_undef(CPACK_RPM_COMP-A_PACKAGE_NAME) rocm_package_setup_component( comp-b @@ -30,6 +32,7 @@ rocm_package_setup_component( RPM "baz = 3.0" COMPONENT comp-a comp-b LIBRARY_NAME packaging + PACKAGE_NAME comp-c ) test_expect_eq("${ROCM_PACKAGE_COMPONENTS}" "comp-a;comp-b;comp-c") @@ -44,8 +47,8 @@ rocm_package_setup_client_component( DEPENDS COMPONENT comp-c ) test_expect_eq("${ROCM_PACKAGE_COMPONENTS}" "comp-a;comp-b;comp-c;client-a") -test_expect_eq("${CPACK_DEBIAN_CLIENT-A_PACKAGE_NAME}" "-client-a") -test_expect_eq("${CPACK_RPM_CLIENT-A_PACKAGE_NAME}" "-client-a") +test_expect_undef(CPACK_DEBIAN_CLIENT-A_PACKAGE_NAME) +test_expect_undef(CPACK_RPM_CLIENT-A_PACKAGE_NAME) test_expect_eq("${CPACK_DEBIAN_CLIENT-A_PACKAGE_DEPENDS}" "") test_expect_eq("${CPACK_RPM_CLIENT-A_PACKAGE_REQUIRES}" "") test_expect_eq("${ROCM_PACKAGE_COMPONENT_DEPENDENCIES}" @@ -54,7 +57,7 @@ test_expect_eq("${ROCM_PACKAGE_COMPONENT_DEPENDENCIES}" set(CPACK_PACKAGE_NAME "packtest") set(CPACK_PACKAGE_VERSION 1.0.0) -rocm_set_comp_cpackvar(FALSE "${ROCM_PACKAGE_COMPONENTS};clients") +rocm_set_comp_cpackvar(FALSE "" "${ROCM_PACKAGE_COMPONENTS};clients") test_expect_eq("${CPACK_COMPONENTS_ALL}" "runtime;comp-a;comp-b;comp-c;client-a;clients") test_expect_eq("${CPACK_DEBIAN_RUNTIME_PACKAGE_NAME}" "packtest") diff --git a/test/test.cmake b/test/test.cmake index 42430d26..3200c0c9 100755 --- a/test/test.cmake +++ b/test/test.cmake @@ -49,6 +49,12 @@ macro(test_expect_eq X Y) endif() endmacro() +macro(test_expect_undef X) + if(DEFINED "${X}") + message(FATAL_ERROR "EXPECT FAILURE: ${X} IS DEFINED ${ARGN}") + endif() +endmacro() + macro(test_expect_matches X Y) if("${X}" STREQUAL "" OR NOT "${X}" MATCHES "${Y}") message(FATAL_ERROR "EXPECT FAILURE: ${X} NOT MATCHES ${Y} ${ARGN}") From 24634d12a19156edc9e4c14a56d810a1b73cd28e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 13:21:59 -0600 Subject: [PATCH 02/17] Bump sphinxcontrib-moderncmakedomain from 3.19 to 3.29.0 in /docs (#193) Bumps [sphinxcontrib-moderncmakedomain](https://github.com/scikit-build/moderncmakedomain) from 3.19 to 3.29.0. - [Release notes](https://github.com/scikit-build/moderncmakedomain/releases) - [Commits](https://github.com/scikit-build/moderncmakedomain/compare/v3.19...v3.29.0) --- updated-dependencies: - dependency-name: sphinxcontrib-moderncmakedomain dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/requirements.in | 2 +- docs/requirements.txt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/requirements.in b/docs/requirements.in index daacbe30..c5601602 100644 --- a/docs/requirements.in +++ b/docs/requirements.in @@ -1,2 +1,2 @@ -sphinxcontrib-moderncmakedomain==3.19 +sphinxcontrib-moderncmakedomain==3.29.0 rocm-docs-core==0.38.1 diff --git a/docs/requirements.txt b/docs/requirements.txt index bc500f7c..d645b04c 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -115,6 +115,7 @@ sphinx==5.3.0 # sphinx-design # sphinx-external-toc # sphinx-notfound-page + # sphinxcontrib-moderncmakedomain sphinx-book-theme==1.0.1 # via rocm-docs-core sphinx-copybutton==0.5.2 @@ -133,7 +134,7 @@ sphinxcontrib-htmlhelp==2.0.1 # via sphinx sphinxcontrib-jsmath==1.0.1 # via sphinx -sphinxcontrib-moderncmakedomain==3.19 +sphinxcontrib-moderncmakedomain==3.29.0 # via -r requirements.in sphinxcontrib-qthelp==1.0.3 # via sphinx From 008acef9c13cce224ffbf24ed4d1b472ea8e434c Mon Sep 17 00:00:00 2001 From: Ahsan Saghir <142340507+ahsan-ca@users.noreply.github.com> Date: Fri, 14 Jun 2024 17:27:56 -0400 Subject: [PATCH 03/17] Turn ROCM_SYMLINK_LIBS OFF by default (#199) --- share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake b/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake index 2d406866..8f4fc5f9 100644 --- a/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake +++ b/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake @@ -116,7 +116,7 @@ function(rocm_install) endif() endfunction() -option(ROCM_SYMLINK_LIBS "Create backwards compatibility symlink for library files." ON) +option(ROCM_SYMLINK_LIBS "Create backwards compatibility symlink for library files." OFF) function(rocm_install_targets) set(options PRIVATE) From 9d0956527b6fd108af0a0ef88f6b9bdb0da61c0b Mon Sep 17 00:00:00 2001 From: Sam Wu <22262939+samjwu@users.noreply.github.com> Date: Tue, 25 Jun 2024 10:16:32 -0600 Subject: [PATCH 04/17] Update Read the Docs configuration to use Python 3.10 and latest rocm-docs-core (#194) * Update Read the Docs configuration to use Python 3.10 and latest rocm-docs-core * Update doc reqs used by tests * Update test.yml Test already installs docs/requirements.txt * Use python 3.10 and ubuntu 22 in test * Wrap 3.10 in quotes to avoid interpreting as 3.1 * Revert to ubu20 --- .github/workflows/test.yml | 9 +- .readthedocs.yaml | 2 +- docs/requirements.in | 2 +- docs/requirements.txt | 72 +++++++------ test/docsphinx/docs/.sphinx/requirements.in | 3 +- test/docsphinx/docs/.sphinx/requirements.txt | 102 ++++++++++--------- 6 files changed, 96 insertions(+), 94 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 43890cec..3dfcddad 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,10 +14,10 @@ jobs: runs-on: ubuntu-20.04 steps: - uses: actions/checkout@v1 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: "3.10" - name: Install dependencies run: | python -m pip install --upgrade setuptools pip wheel @@ -44,10 +44,10 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Set up Python 3.9 + - name: Set up Python 3.10 uses: actions/setup-python@v2 with: - python-version: 3.9 + python-version: "3.10" - name: Setup cmake uses: jwlawson/actions-setup-cmake@v1.9 with: @@ -57,7 +57,6 @@ jobs: python -m pip install --upgrade setuptools pip wheel python -m pip install cget ninja python -m pip install -r docs/requirements.txt - python -m pip install -r test/docsphinx/docs/.sphinx/requirements.txt - name: Install Doxygen uses: ssciwr/doxygen-install@v1 with: diff --git a/.readthedocs.yaml b/.readthedocs.yaml index 584eeb31..ae3ebe3e 100644 --- a/.readthedocs.yaml +++ b/.readthedocs.yaml @@ -15,4 +15,4 @@ python: build: os: ubuntu-22.04 tools: - python: "3.8" + python: "3.10" diff --git a/docs/requirements.in b/docs/requirements.in index c5601602..480de5db 100644 --- a/docs/requirements.in +++ b/docs/requirements.in @@ -1,2 +1,2 @@ sphinxcontrib-moderncmakedomain==3.29.0 -rocm-docs-core==0.38.1 +rocm-docs-core==1.4.0 diff --git a/docs/requirements.txt b/docs/requirements.txt index d645b04c..cf77425a 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -1,14 +1,14 @@ # -# This file is autogenerated by pip-compile with Python 3.8 +# This file is autogenerated by pip-compile with Python 3.10 # by the following command: # # pip-compile requirements.in # -accessible-pygments==0.0.4 +accessible-pygments==0.0.5 # via pydata-sphinx-theme -alabaster==0.7.13 +alabaster==0.7.16 # via sphinx -babel==2.14.0 +babel==2.15.0 # via # pydata-sphinx-theme # sphinx @@ -16,7 +16,7 @@ beautifulsoup4==4.12.3 # via pydata-sphinx-theme breathe==4.35.0 # via rocm-docs-core -certifi==2023.11.17 +certifi==2024.6.2 # via requests cffi==1.16.0 # via @@ -26,11 +26,11 @@ charset-normalizer==3.3.2 # via requests click==8.1.7 # via sphinx-external-toc -cryptography==41.0.7 +cryptography==42.0.8 # via pyjwt deprecated==1.2.14 # via pygithub -docutils==0.19 +docutils==0.21.2 # via # breathe # myst-parser @@ -40,41 +40,41 @@ fastjsonschema==2.19.1 # via rocm-docs-core gitdb==4.0.11 # via gitpython -gitpython==3.1.41 +gitpython==3.1.43 # via rocm-docs-core -idna==3.6 +idna==3.7 # via requests imagesize==1.4.1 # via sphinx -jinja2==3.1.3 +jinja2==3.1.4 # via # myst-parser # sphinx -markdown-it-py==2.2.0 +markdown-it-py==3.0.0 # via # mdit-py-plugins # myst-parser -markupsafe==2.1.3 +markupsafe==2.1.5 # via jinja2 -mdit-py-plugins==0.3.5 +mdit-py-plugins==0.4.1 # via myst-parser mdurl==0.1.2 # via markdown-it-py -myst-parser==1.0.0 +myst-parser==3.0.1 # via rocm-docs-core -packaging==23.2 +packaging==24.0 # via # pydata-sphinx-theme # sphinx -pycparser==2.21 +pycparser==2.22 # via cffi -pydata-sphinx-theme==0.14.4 +pydata-sphinx-theme==0.15.3 # via # rocm-docs-core # sphinx-book-theme -pygithub==2.1.1 +pygithub==2.3.0 # via rocm-docs-core -pygments==2.17.2 +pygments==2.18.0 # via # accessible-pygments # pydata-sphinx-theme @@ -83,28 +83,24 @@ pyjwt[crypto]==2.8.0 # via pygithub pynacl==1.5.0 # via pygithub -python-dateutil==2.8.2 - # via pygithub pyyaml==6.0.1 # via # myst-parser # rocm-docs-core # sphinx-external-toc -requests==2.31.0 +requests==2.32.3 # via # pygithub # sphinx -rocm-docs-core==0.38.1 +rocm-docs-core==1.4.0 # via -r requirements.in -six==1.16.0 - # via python-dateutil smmap==5.0.1 # via gitdb snowballstemmer==2.2.0 # via sphinx soupsieve==2.5 # via beautifulsoup4 -sphinx==5.3.0 +sphinx==7.3.7 # via # breathe # myst-parser @@ -116,35 +112,37 @@ sphinx==5.3.0 # sphinx-external-toc # sphinx-notfound-page # sphinxcontrib-moderncmakedomain -sphinx-book-theme==1.0.1 +sphinx-book-theme==1.1.2 # via rocm-docs-core sphinx-copybutton==0.5.2 # via rocm-docs-core -sphinx-design==0.5.0 +sphinx-design==0.6.0 # via rocm-docs-core -sphinx-external-toc==0.3.1 +sphinx-external-toc==1.0.1 # via rocm-docs-core -sphinx-notfound-page==1.0.0 +sphinx-notfound-page==1.0.2 # via rocm-docs-core -sphinxcontrib-applehelp==1.0.4 +sphinxcontrib-applehelp==1.0.8 # via sphinx -sphinxcontrib-devhelp==1.0.2 +sphinxcontrib-devhelp==1.0.6 # via sphinx -sphinxcontrib-htmlhelp==2.0.1 +sphinxcontrib-htmlhelp==2.0.5 # via sphinx sphinxcontrib-jsmath==1.0.1 # via sphinx sphinxcontrib-moderncmakedomain==3.29.0 # via -r requirements.in -sphinxcontrib-qthelp==1.0.3 +sphinxcontrib-qthelp==1.0.7 + # via sphinx +sphinxcontrib-serializinghtml==1.1.10 # via sphinx -sphinxcontrib-serializinghtml==1.1.5 +tomli==2.0.1 # via sphinx -typing-extensions==4.9.0 +typing-extensions==4.12.2 # via # pydata-sphinx-theme # pygithub -urllib3==2.1.0 +urllib3==2.2.1 # via # pygithub # requests diff --git a/test/docsphinx/docs/.sphinx/requirements.in b/test/docsphinx/docs/.sphinx/requirements.in index c6a88564..44c838b8 100644 --- a/test/docsphinx/docs/.sphinx/requirements.in +++ b/test/docsphinx/docs/.sphinx/requirements.in @@ -1 +1,2 @@ -rocm-docs-core==0.20.0 +sphinxcontrib-moderncmakedomain==3.29.0 +rocm-docs-core==1.4.0 diff --git a/test/docsphinx/docs/.sphinx/requirements.txt b/test/docsphinx/docs/.sphinx/requirements.txt index 5e81171a..cdb9d84f 100644 --- a/test/docsphinx/docs/.sphinx/requirements.txt +++ b/test/docsphinx/docs/.sphinx/requirements.txt @@ -2,79 +2,79 @@ # This file is autogenerated by pip-compile with Python 3.10 # by the following command: # -# pip-compile docs/.sphinx/requirements.in +# pip-compile requirements.in # -accessible-pygments==0.0.4 +accessible-pygments==0.0.5 # via pydata-sphinx-theme -alabaster==0.7.13 +alabaster==0.7.16 # via sphinx -babel==2.12.1 +babel==2.15.0 # via # pydata-sphinx-theme # sphinx -beautifulsoup4==4.12.2 +beautifulsoup4==4.12.3 # via pydata-sphinx-theme breathe==4.35.0 # via rocm-docs-core -certifi==2023.7.22 +certifi==2024.6.2 # via requests -cffi==1.15.1 +cffi==1.16.0 # via # cryptography # pynacl -charset-normalizer==3.2.0 +charset-normalizer==3.3.2 # via requests click==8.1.7 # via sphinx-external-toc -cryptography==41.0.3 +cryptography==42.0.8 # via pyjwt deprecated==1.2.14 # via pygithub -docutils==0.19 +docutils==0.21.2 # via # breathe # myst-parser # pydata-sphinx-theme # sphinx -fastjsonschema==2.18.0 +fastjsonschema==2.19.1 # via rocm-docs-core -gitdb==4.0.10 +gitdb==4.0.11 # via gitpython -gitpython==3.1.32 +gitpython==3.1.43 # via rocm-docs-core -idna==3.4 +idna==3.7 # via requests imagesize==1.4.1 # via sphinx -jinja2==3.1.2 +jinja2==3.1.4 # via # myst-parser # sphinx -markdown-it-py==2.2.0 +markdown-it-py==3.0.0 # via # mdit-py-plugins # myst-parser -markupsafe==2.1.3 +markupsafe==2.1.5 # via jinja2 -mdit-py-plugins==0.3.5 +mdit-py-plugins==0.4.1 # via myst-parser mdurl==0.1.2 # via markdown-it-py -myst-parser==1.0.0 +myst-parser==3.0.1 # via rocm-docs-core -packaging==23.1 +packaging==24.0 # via # pydata-sphinx-theme # sphinx -pycparser==2.21 +pycparser==2.22 # via cffi -pydata-sphinx-theme==0.13.3 +pydata-sphinx-theme==0.15.3 # via # rocm-docs-core # sphinx-book-theme -pygithub==1.59.1 +pygithub==2.3.0 # via rocm-docs-core -pygments==2.16.1 +pygments==2.18.0 # via # accessible-pygments # pydata-sphinx-theme @@ -88,19 +88,19 @@ pyyaml==6.0.1 # myst-parser # rocm-docs-core # sphinx-external-toc -requests==2.31.0 +requests==2.32.3 # via # pygithub # sphinx -rocm-docs-core==0.20.0 - # via -r docs/.sphinx/requirements.in -smmap==5.0.0 +rocm-docs-core==1.4.0 + # via -r requirements.in +smmap==5.0.1 # via gitdb snowballstemmer==2.2.0 # via sphinx -soupsieve==2.4.1 +soupsieve==2.5 # via beautifulsoup4 -sphinx==5.3.0 +sphinx==7.3.7 # via # breathe # myst-parser @@ -111,36 +111,40 @@ sphinx==5.3.0 # sphinx-design # sphinx-external-toc # sphinx-notfound-page - # sphinxcontrib-applehelp - # sphinxcontrib-devhelp - # sphinxcontrib-htmlhelp - # sphinxcontrib-qthelp - # sphinxcontrib-serializinghtml -sphinx-book-theme==1.0.1 + # sphinxcontrib-moderncmakedomain +sphinx-book-theme==1.1.2 # via rocm-docs-core sphinx-copybutton==0.5.2 # via rocm-docs-core -sphinx-design==0.5.0 +sphinx-design==0.6.0 # via rocm-docs-core -sphinx-external-toc==0.3.1 +sphinx-external-toc==1.0.1 # via rocm-docs-core -sphinx-notfound-page==0.8.3 +sphinx-notfound-page==1.0.2 # via rocm-docs-core -sphinxcontrib-applehelp==1.0.7 +sphinxcontrib-applehelp==1.0.8 # via sphinx -sphinxcontrib-devhelp==1.0.5 +sphinxcontrib-devhelp==1.0.6 # via sphinx -sphinxcontrib-htmlhelp==2.0.4 +sphinxcontrib-htmlhelp==2.0.5 # via sphinx sphinxcontrib-jsmath==1.0.1 # via sphinx -sphinxcontrib-qthelp==1.0.6 +sphinxcontrib-moderncmakedomain==3.29.0 + # via -r requirements.in +sphinxcontrib-qthelp==1.0.7 # via sphinx -sphinxcontrib-serializinghtml==1.1.8 +sphinxcontrib-serializinghtml==1.1.10 # via sphinx -typing-extensions==4.7.1 - # via pydata-sphinx-theme -urllib3==2.0.4 - # via requests -wrapt==1.15.0 +tomli==2.0.1 + # via sphinx +typing-extensions==4.12.2 + # via + # pydata-sphinx-theme + # pygithub +urllib3==2.2.1 + # via + # pygithub + # requests +wrapt==1.16.0 # via deprecated From 9475601d064d012e3419f211c727cf1dceb05ed7 Mon Sep 17 00:00:00 2001 From: Ahsan Saghir <142340507+ahsan-ca@users.noreply.github.com> Date: Tue, 25 Jun 2024 14:36:36 -0400 Subject: [PATCH 05/17] Update RPATH to binaries for PRIVATE lib changes (#197) * Update RPATHs * Remove debug messages and re-indent comments * Use CMP0095 NEW policy for paths and update BIN_INSTALL_DIR paths for private binaries * Remove setting CMP0095 to NEW --- .../cmake/ROCMInstallTargets.cmake | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake b/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake index 8f4fc5f9..72fdb3bb 100644 --- a/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake +++ b/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake @@ -134,7 +134,7 @@ function(rocm_install_targets) if(PARSE_PREFIX) set(PREFIX_DIR ${PARSE_PREFIX}) if(PARSE_PRIVATE) - set(BIN_INSTALL_DIR ${PARSE_PREFIX}/${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME}) + set(BIN_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/bin) set(LIB_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/lib) set(INCLUDE_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/include) else() @@ -144,7 +144,7 @@ function(rocm_install_targets) endif() elseif(ENABLE_ASAN_PACKAGING) if(PARSE_PRIVATE) - set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}/asan/${PROJECT_NAME}) + set(BIN_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan/${PROJECT_NAME}/bin) set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan/${PROJECT_NAME}/lib) set(INCLUDE_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan/${PROJECT_NAME}/include) else() @@ -154,7 +154,7 @@ function(rocm_install_targets) endif() else() if(PARSE_PRIVATE) - set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}/${PROJECT_NAME}) + set(BIN_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/bin) set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/lib) set(INCLUDE_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/include) else() @@ -200,24 +200,19 @@ function(rocm_install_targets) foreach(TARGET IN LISTS PARSE_TARGETS) get_target_property(T_TYPE ${TARGET} TYPE) - if(NOT PARSE_PRIVATE AND NOT T_TYPE STREQUAL "INTERFACE_LIBRARY") - # TODO: Create a function to set INSTALL_RPATH - if(POLICY CMP0095) - set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "${ORIGIN}/${PROJECT_NAME}/lib") + if(NOT T_TYPE STREQUAL "INTERFACE_LIBRARY") + set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../lib") + if(PARSE_PRIVATE) + # Adding RPATH to private binaries to point to public libraries. + set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../") else() - set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "\\\${ORIGIN}/${PROJECT_NAME}/lib") + # Adding RPATH to public binaries to point to private libraries. + set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../lib/${PROJECT_NAME}/lib") endif() endif() + set(export_arg EXPORT ${EXPORT_FILE}) if(T_TYPE STREQUAL "EXECUTABLE") - if(PARSE_PRIVATE) - if(POLICY CMP0095) - set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "${ORIGIN}/../lib/${PROJECT_NAME}/lib") - else() - set_property(TARGET ${TARGET} APPEND PROPERTY - INSTALL_RPATH "\\\${ORIGIN}/../lib/${PROJECT_NAME}/lib") - endif() - endif() unset(export_arg) endif() install( From dfaa4ddba4dbb2e1c6e9964ce610e2a12fd93f39 Mon Sep 17 00:00:00 2001 From: Ahsan Saghir <142340507+ahsan-ca@users.noreply.github.com> Date: Tue, 25 Jun 2024 15:32:23 -0400 Subject: [PATCH 06/17] Add RPATH to tests to point to private libraries. (#200) * Add RPATH to tests to point to private libraries. * Fix relative path to lib --------- Co-authored-by: Lauren Wrubleski --- share/rocmcmakebuildtools/cmake/ROCMTest.cmake | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/share/rocmcmakebuildtools/cmake/ROCMTest.cmake b/share/rocmcmakebuildtools/cmake/ROCMTest.cmake index 8d5a7231..f534ea42 100644 --- a/share/rocmcmakebuildtools/cmake/ROCMTest.cmake +++ b/share/rocmcmakebuildtools/cmake/ROCMTest.cmake @@ -221,11 +221,9 @@ function(rocm_install_test) set(INSTALL_PREFIX "$") if(PARSE_TARGETS) foreach(TARGET ${PARSE_TARGETS}) - if(POLICY CMP0095) - set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "\${ORIGIN}/../../../lib") - else() - set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "\\\${ORIGIN}/../../../lib") - endif() + set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../../../lib") + # Adding RPATH to public tests to point to private libraries. + set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../../../lib/${PROJECT_NAME}/lib") endforeach() install( TARGETS ${PARSE_TARGETS} From 84e35103b7389bffabfe1757081c7a444872cca6 Mon Sep 17 00:00:00 2001 From: Lauren Wrubleski Date: Thu, 27 Jun 2024 16:35:36 -0600 Subject: [PATCH 07/17] change ordering of suffixes (#201) (cherry picked from commit bd28d0fbebfe4026687360adff43e981e34db844) --- share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake b/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake index c55968d2..593af6aa 100755 --- a/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake +++ b/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake @@ -500,13 +500,13 @@ macro(rocm_compute_component_package_name COMPONENT_NAME BASE_NAME NAME_SUFFIX H OR CPACK_RPM_${_component_name_upper}_PACKAGE_NAME STREQUAL "" ) set(CPACK_RPM_${_component_name_upper}_PACKAGE_NAME - "${BASE_NAME}${_rpm_component_partial}${_component_suffix}") + "${BASE_NAME}${_component_suffix}${_rpm_component_partial}") endif() if(NOT DEFINED CPACK_DEBIAN_${_component_name_upper}_PACKAGE_NAME OR CPACK_DEBIAN_${_component_name_upper}_PACKAGE_NAME STREQUAL "" ) set(CPACK_DEBIAN_${_component_name_upper}_PACKAGE_NAME - "${BASE_NAME}${_deb_component_partial}${_component_suffix}") + "${BASE_NAME}${_component_suffix}${_deb_component_partial}") endif() # clean up temporary variables From 5a862812cf5625b1c9f2c90c6b0dc28514902bec Mon Sep 17 00:00:00 2001 From: Lauren Wrubleski Date: Thu, 27 Jun 2024 16:35:54 -0600 Subject: [PATCH 08/17] fix names for header-only components when built statically (#202) --- share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake b/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake index 593af6aa..3733c74a 100755 --- a/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake +++ b/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake @@ -475,7 +475,7 @@ macro(rocm_compute_component_package_name COMPONENT_NAME BASE_NAME NAME_SUFFIX H else() if(ENABLE_ASAN_PACKAGING) set(_component_suffix asan) - elseif(NOT ${HEADER_ONLY} AND NOT ${BUILD_SHARED_LIBS}) + elseif(NOT ${BUILD_SHARED_LIBS}) set(_component_suffix static) endif() endif() From aa86563e9b521d33f8888a5f71500812fbc6f52e Mon Sep 17 00:00:00 2001 From: Ahsan Saghir <142340507+ahsan-ca@users.noreply.github.com> Date: Tue, 9 Jul 2024 18:46:06 -0400 Subject: [PATCH 09/17] Cherry-pick private lib changes into release 6.2 (#205) * Add flag to move libraries under project name (#188) Co-authored-by: Paul Fultz II * Turn ROCM_SYMLINK_LIBS OFF by default (#199) * Update RPATH to binaries for PRIVATE lib changes (#197) * Update RPATHs * Remove debug messages and re-indent comments * Use CMP0095 NEW policy for paths and update BIN_INSTALL_DIR paths for private binaries * Remove setting CMP0095 to NEW * Add RPATH to tests to point to private libraries. (#200) * Add RPATH to tests to point to private libraries. * Fix relative path to lib --------- Co-authored-by: Lauren Wrubleski --------- Co-authored-by: Paul Fultz II Co-authored-by: Lauren Wrubleski --- .../cmake/ROCMInstallTargets.cmake | 56 +++++++++++++++---- .../rocmcmakebuildtools/cmake/ROCMTest.cmake | 8 +-- test/libprivate/CMakeLists.txt | 51 +++++++++++++++++ test/libprivate/LICENSE | 3 + test/libprivate/importtarget.cmake | 3 + test/libprivate/include/simpleprivate.h | 12 ++++ test/libprivate/main.cpp | 6 ++ test/libprivate/simpleprivate.cpp | 7 +++ test/pass/libprivate.cmake | 11 ++++ 9 files changed, 140 insertions(+), 17 deletions(-) create mode 100644 test/libprivate/CMakeLists.txt create mode 100644 test/libprivate/LICENSE create mode 100644 test/libprivate/importtarget.cmake create mode 100644 test/libprivate/include/simpleprivate.h create mode 100644 test/libprivate/main.cpp create mode 100644 test/libprivate/simpleprivate.cpp create mode 100644 test/pass/libprivate.cmake diff --git a/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake b/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake index 463c482c..72fdb3bb 100644 --- a/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake +++ b/share/rocmcmakebuildtools/cmake/ROCMInstallTargets.cmake @@ -116,10 +116,10 @@ function(rocm_install) endif() endfunction() -option(ROCM_SYMLINK_LIBS "Create backwards compatibility symlink for library files." ON) +option(ROCM_SYMLINK_LIBS "Create backwards compatibility symlink for library files." OFF) function(rocm_install_targets) - set(options) + set(options PRIVATE) set(oneValueArgs PREFIX EXPORT COMPONENT) set(multiValueArgs TARGETS INCLUDE) @@ -133,17 +133,35 @@ function(rocm_install_targets) if(PARSE_PREFIX) set(PREFIX_DIR ${PARSE_PREFIX}) - set(BIN_INSTALL_DIR ${PARSE_PREFIX}/${CMAKE_INSTALL_BINDIR}) - set(LIB_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}) - set(INCLUDE_INSTALL_DIR ${PARSE_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) + if(PARSE_PRIVATE) + set(BIN_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/bin) + set(LIB_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/lib) + set(INCLUDE_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/include) + else() + set(BIN_INSTALL_DIR ${PARSE_PREFIX}/${CMAKE_INSTALL_BINDIR}) + set(LIB_INSTALL_DIR ${PARSE_PREFIX}/${ROCM_INSTALL_LIBDIR}) + set(INCLUDE_INSTALL_DIR ${PARSE_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}) + endif() elseif(ENABLE_ASAN_PACKAGING) - set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}/asan) - set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan) - set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) + if(PARSE_PRIVATE) + set(BIN_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan/${PROJECT_NAME}/bin) + set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan/${PROJECT_NAME}/lib) + set(INCLUDE_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan/${PROJECT_NAME}/include) + else() + set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}/asan) + set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/asan) + set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) + endif() else() - set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) - set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}) - set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) + if(PARSE_PRIVATE) + set(BIN_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/bin) + set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/lib) + set(INCLUDE_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}/${PROJECT_NAME}/include) + else() + set(BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR}) + set(LIB_INSTALL_DIR ${ROCM_INSTALL_LIBDIR}) + set(INCLUDE_INSTALL_DIR ${CMAKE_INSTALL_INCLUDEDIR}) + endif() endif() foreach(TARGET ${PARSE_TARGETS}) @@ -182,6 +200,17 @@ function(rocm_install_targets) foreach(TARGET IN LISTS PARSE_TARGETS) get_target_property(T_TYPE ${TARGET} TYPE) + if(NOT T_TYPE STREQUAL "INTERFACE_LIBRARY") + set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../lib") + if(PARSE_PRIVATE) + # Adding RPATH to private binaries to point to public libraries. + set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../") + else() + # Adding RPATH to public binaries to point to private libraries. + set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../lib/${PROJECT_NAME}/lib") + endif() + endif() + set(export_arg EXPORT ${EXPORT_FILE}) if(T_TYPE STREQUAL "EXECUTABLE") unset(export_arg) @@ -216,7 +245,10 @@ function(rocm_install_targets) NAMELINK_ONLY ) endif() - if(ROCM_SYMLINK_LIBS AND NOT WIN32 AND T_TYPE MATCHES ".*_LIBRARY" + if(ROCM_SYMLINK_LIBS AND PARSE_PRIVATE) + message(WARNING "ROCM_SYMLINK_LIBS is not supported with PRIVATE.") + endif() + if(ROCM_SYMLINK_LIBS AND NOT PARSE_PRIVATE AND NOT WIN32 AND T_TYPE MATCHES ".*_LIBRARY" AND NOT T_TYPE STREQUAL "INTERFACE_LIBRARY") string(TOLOWER "${PROJECT_NAME}" LINK_SUBDIR) file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TARGET}_symlink.cmake diff --git a/share/rocmcmakebuildtools/cmake/ROCMTest.cmake b/share/rocmcmakebuildtools/cmake/ROCMTest.cmake index 8d5a7231..f534ea42 100644 --- a/share/rocmcmakebuildtools/cmake/ROCMTest.cmake +++ b/share/rocmcmakebuildtools/cmake/ROCMTest.cmake @@ -221,11 +221,9 @@ function(rocm_install_test) set(INSTALL_PREFIX "$") if(PARSE_TARGETS) foreach(TARGET ${PARSE_TARGETS}) - if(POLICY CMP0095) - set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "\${ORIGIN}/../../../lib") - else() - set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "\\\${ORIGIN}/../../../lib") - endif() + set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../../../lib") + # Adding RPATH to public tests to point to private libraries. + set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../../../lib/${PROJECT_NAME}/lib") endforeach() install( TARGETS ${PARSE_TARGETS} diff --git a/test/libprivate/CMakeLists.txt b/test/libprivate/CMakeLists.txt new file mode 100644 index 00000000..42d68594 --- /dev/null +++ b/test/libprivate/CMakeLists.txt @@ -0,0 +1,51 @@ +################################################################################ +# Copyright (C) 2024 Advanced Micro Devices, Inc. +################################################################################ + + +cmake_minimum_required (VERSION 3.5) +project(libprivate CXX) + +find_package(ROCmCMakeBuildTools) + +include(ROCMInstallTargets) +include(ROCMPackageConfigHelpers) +include(ROCMSetupVersion) +include(ROCMInstallSymlinks) +include(ROCMCreatePackage) + +rocm_setup_version(VERSION 1.0.0) + +if(ROCM_PREFIX) +rocm_create_package( + NAME simple-private + PREFIX ${ROCM_PREFIX} + MAINTAINER "Amd amd@amd.com" + PTH + LDCONFIG) +else() +rocm_create_package( + NAME simple-private + MAINTAINER "Amd amd@amd.com" + PTH + LDCONFIG) +endif() + +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) + +add_library(simple_private simpleprivate.cpp) +#rocm_set_soversion(simple-private 1.1.2) + +add_executable(simple_private_main main.cpp) +target_link_libraries(simple_private_main simple_private) + +if(ROCM_PREFIX) + rocm_install_targets(PRIVATE TARGETS simple_private simple_private_main INCLUDE include PREFIX ${ROCM_PREFIX}) + rocm_export_targets(TARGETS simple_private INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/importtarget.cmake PREFIX ${ROCM_PREFIX}) + rocm_install_symlink_subdir(${ROCM_PREFIX}) +else() + rocm_install_targets(PRIVATE TARGETS simple_private simple_private_main INCLUDE include) + rocm_export_targets(TARGETS simple_private INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/importtarget.cmake) +endif() diff --git a/test/libprivate/LICENSE b/test/libprivate/LICENSE new file mode 100644 index 00000000..6d0ea731 --- /dev/null +++ b/test/libprivate/LICENSE @@ -0,0 +1,3 @@ +This is a placeholder license file for the purposes of testing, and is not the license for this repository or the files +contained in this directory. The license for rocm-cmake (including all files in this directory) can be located at +"https://github.com/RadeonOpenCompute/rocm-cmake/blob/master/LICENSE". \ No newline at end of file diff --git a/test/libprivate/importtarget.cmake b/test/libprivate/importtarget.cmake new file mode 100644 index 00000000..76a90f8b --- /dev/null +++ b/test/libprivate/importtarget.cmake @@ -0,0 +1,3 @@ +# ###################################################################################################################### +# Copyright (C) 2024 Advanced Micro Devices, Inc. +# ###################################################################################################################### diff --git a/test/libprivate/include/simpleprivate.h b/test/libprivate/include/simpleprivate.h new file mode 100644 index 00000000..520359d5 --- /dev/null +++ b/test/libprivate/include/simpleprivate.h @@ -0,0 +1,12 @@ +/******************************************************************************* + * Copyright (C) 2024 Advanced Micro Devices, Inc. + ******************************************************************************/ + + +#ifndef GUARD_SIMPLE_PRIVATE_H +#define GUARD_SIMPLE_PRIVATE_H + +void simple_private(); + + +#endif diff --git a/test/libprivate/main.cpp b/test/libprivate/main.cpp new file mode 100644 index 00000000..f8b9e7d7 --- /dev/null +++ b/test/libprivate/main.cpp @@ -0,0 +1,6 @@ + +void simple_private(); + +int main() { + simple_private(); +} diff --git a/test/libprivate/simpleprivate.cpp b/test/libprivate/simpleprivate.cpp new file mode 100644 index 00000000..33f0f31e --- /dev/null +++ b/test/libprivate/simpleprivate.cpp @@ -0,0 +1,7 @@ +/******************************************************************************* + * Copyright (C) 2024 Advanced Micro Devices, Inc. + ******************************************************************************/ + + +void simple_private() +{} diff --git a/test/pass/libprivate.cmake b/test/pass/libprivate.cmake new file mode 100644 index 00000000..e2992175 --- /dev/null +++ b/test/pass/libprivate.cmake @@ -0,0 +1,11 @@ +# ###################################################################################################################### +# Copyright (C) 2024 Advanced Micro Devices, Inc. +# ###################################################################################################################### + +install_dir( + ${TEST_DIR}/libprivate + CMAKE_ARGS -DROCM_SYMLINK_LIBS=OFF -DROCM_PREFIX=rocm + TARGETS package) +test_expect_file(${PREFIX}/lib/libprivate/include/simpleprivate.h) +test_expect_file(${PREFIX}/lib/libprivate/lib/libsimple_private.a) +install_dir(${TEST_DIR}/libprivate) From fe531bc268ad715cd77ab31afe443dd12b2b1d2c Mon Sep 17 00:00:00 2001 From: Sam Wu <22262939+samjwu@users.noreply.github.com> Date: Mon, 15 Jul 2024 09:22:59 -0600 Subject: [PATCH 10/17] Update version in CMakeLists.txt to match changelog (#210) * Update version in CMakeLists.txt to match changelog * Fix markdownlint formatting in changelog --- CHANGELOG.md | 110 ++++++++++++++++++++++++++++++++++++------------- CMakeLists.txt | 2 +- 2 files changed, 83 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87354422..1ddfe3fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,104 +1,146 @@ # Change Log for rocm-cmake ## [(Unreleased) rocm-cmake 0.13.0 for ROCm 6.2.0] + ### Changed + - ROCmCreatePackage: Accepts a suffix parameter, automatically generating it for static or ASAN builds. - Package names will no longer be pulled from `CPACK__PACKAGE_NAME` - Runtime packages will no longer be generated for static builds + ## [rocm-cmake 0.12.0 for ROCm 6.1.0] + ### Added + - ROCMTest: Add rpath to installed tests - AOCMCreatePackage: Allow additional provides on header-only packages - ROCMSphinxDoc: Allow separate source and config directories + ### Changed + - Renamed CMake package to ROCmCMakeBuildTools. A wrapper has been provided to ensure that `find_package(ROCM)` continues to work, but it is recommended that developers switch to `find_package(ROCmCMakeBuildTools)` - ROCMInstallTargets: Stopped installing executables in ASAN builds + ### Fixed + - ROCMClangTidy: Fixed invalid list index in clang tidy - Fixed test failures when `ROCM_CMAKE_GENERATOR` is an empty string ## [rocm-cmake 0.11.0 for ROCm 6.0.0] + ### Changed + - ROCMSphinxDoc: Improved validation, documentation and rocm-docs-core integration. - Rename CMake package to ROCmCMakeBuildTools + ### Fixed + - ROCMClangTidy: Fixed extra make flags passed for clang tidy. - ROCMTest: Fixed issues when using module in a subdirectory. ## [rocm-cmake 0.10.0 for ROCm 5.7.0] + ### Added + - Added ROCMTest module - ROCMCreatePackage: Added support for ASAN packages ## [rocm-cmake 0.9.0 for ROCm 5.6.0] + ### Added + - Added the option ROCM_HEADER_WRAPPER_WERROR - - Compile-time C macro in the wrapper headers causes errors to be emitted instead of warnings. - - Configure-time CMake option sets the default for the C macro. + - Compile-time C macro in the wrapper headers causes errors to be emitted instead of warnings. + - Configure-time CMake option sets the default for the C macro. ## [rocm-cmake 0.8.1 for ROCm 5.5] + ### Fixed + - ROCMInstallTargets: Added compatibility symlinks for included cmake files in `/lib/cmake/`. + ### Changed + - ROCMHeaderWrapper: The wrapper header deprecation message is now a deprecation warning. ## [rocm-cmake 0.8.0 for ROCm 5.4] + ### Fixed + - ROCMCreatePackage: Fixed error in prerm scripts that could break package upgrades when using the `PTH` option. - Removed unnecessary requirement for having C and C++ compilers available when building rocm-cmake from source. + ### Known issues + - This release did not have a unique version number. ## [rocm-cmake 0.8.0 for ROCm 5.3] + ### Fixed + - Fixed error in prerm scripts created by `rocm_create_package` that could break uninstall for packages using the `PTH` option. + ### Changed + - `ROCM_USE_DEV_COMPONENT` set to on by default for all platforms. This means that Windows will now generate runtime and devel packages by default - ROCMInstallTargets now defaults `CMAKE_INSTALL_LIBDIR` to `lib` if not otherwise specified. - Changed default Debian compression type to xz and enabled multi-threaded package compression. - `rocm_create_package` will no longer warn upon failure to determine version of program rpmbuild. ## [0.7.3] + ### Added + - Header wrapper functionality included. This is to support the change in header file locations in ROCm 5.2, while providing backwards compatibility via header file wrappers. The associated deprecation warning can be disabled by defining `ROCM_NO_WRAPPER_HEADER_WARNING` before including the wrapper header. + ### Fixed + - Fixed spurious failures in `rocm_check_target_ids` for target ids with target features when `-Werror` is enabled. The `HAVE_` result variable has been renamed to `COMPILER_HAS_TARGET_ID_`. ## [0.7.2] + - `rocm_create_package` now will attempt to set a default `CPACK_GENERATOR` based on the `ROCM_PKGTYPE` environment variable if one is not already set. ## [0.7.1] + ### Added + - `CLANG_TIDY_USE_COLOR` variable added to control the color output from `clang-tidy`, by default this is `On`. - If `CPACK_RESOURCE_FILE_LICENSE` is not set, `rocm_create_package` will now automatically attempt to find a LICENSE, LICENSE.txt, or LICENSE.md file in the top-level CMake source directory. If one is found, it is set up as the license file for the package. ## [0.7.0] + ### Added + - Component packaging functionality: - - `rocm_package_setup_component` sets up a component for packaging, with the given name and values for the component and associated package. + - `rocm_package_setup_component` sets up a component for packaging, with the given name and values for the component and associated package. - - The variable `ROCM_PACKAGE_COMPONENTS` stores a list of the components which have been set up with `rocm_package_setup_component`. - - `rocm_package_add_rpm_dependencies` adds any number of dependencies to the RPM package for an optional specified component, including version checks (e.g. `foo >= 1.0`) - - `rocm_package_add_deb_dependencies` adds any number of dependencies to the DEB package for an optional specified component, including version checks (e.g. `foo >= 1.0`) - - Note that this version format matches RPM, it is reformatted to the Debian package format. This is to reduce code duplication. - - `rocm_package_add_dependencies` is a convenience wrapper which calls both `rocm_add_rpm_dependencies` and `rocm_add_deb_dependencies` to add any number of dependencies to both packages for an optional specified component. + - The variable `ROCM_PACKAGE_COMPONENTS` stores a list of the components which have been set up with `rocm_package_setup_component`. + - `rocm_package_add_rpm_dependencies` adds any number of dependencies to the RPM package for an optional specified component, including version checks (e.g. `foo >= 1.0`) + - `rocm_package_add_deb_dependencies` adds any number of dependencies to the DEB package for an optional specified component, including version checks (e.g. `foo >= 1.0`) + - Note that this version format matches RPM, it is reformatted to the Debian package format. This is to reduce code duplication. + - `rocm_package_add_dependencies` is a convenience wrapper which calls both `rocm_add_rpm_dependencies` and `rocm_add_deb_dependencies` to add any number of dependencies to both packages for an optional specified component. - Client packaging functions: - - `rocm_package_setup_client_component` is a convenience wrapper which adds the library as a runtime dependency if shared libraries were built, and sets the parent of the client package to `clients`. + - `rocm_package_setup_client_component` is a convenience wrapper which adds the library as a runtime dependency if shared libraries were built, and sets the parent of the client package to `clients`. - Utility functions: - - `rocm_join_if_set` joins any number of non-empty strings to the end of a given variable interspersed with a specified glue string, setting that variable if it was previously empty - - `rocm_find_program_version` checks to see if the given command is available, and if it is available that the version matches some criteria. The detected version is returned in ``, and whether it matches all given criteria in `_OK`. - - `` defaults to `_VERSION` if not specified. + - `rocm_join_if_set` joins any number of non-empty strings to the end of a given variable interspersed with a specified glue string, setting that variable if it was previously empty + - `rocm_find_program_version` checks to see if the given command is available, and if it is available that the version matches some criteria. The detected version is returned in ``, and whether it matches all given criteria in `_OK`. + - `` defaults to `_VERSION` if not specified. + ### Changed + - If `ROCM_PACKAGE_COMPONENTS` is set (either manually or by `rocm_package_setup_component`), then the components listed in `ROCM_PACKAGE_COMPONENTS` will be built as separate packages. - `rocm_read_os_release` and `rocm_set_os_id` moved to the utilities file. As this file is included in `ROCMCreatePackage.cmake`, this change is backwards compatible. - `rocm_install_symlink_subdir` now accepts a `COMPONENT` argument, which controls the component that the symlinks are installed into. ## [0.6.2] + ### Changed + - If the ROCm platform version that is being built for is less than version 4.5.0, `ROCM_DEP_ROCMCORE` is automatically disabled. - The ROCm platform version is determined by: - the user-set CMake variable `ROCM_PLATFORM_VERSION`; otherwise @@ -107,44 +149,56 @@ - If the ROCm platform version is not set, then it is assumed to be greater than 4.5.0. ## [0.6.1] + ### Added + - Modules added to generate documentation: - - `ROCMDocs` - - `ROCMDoxygenDoc` - - `ROCMSphinxDoc` + - `ROCMDocs` + - `ROCMDoxygenDoc` + - `ROCMSphinxDoc` + ## [0.6.0] + ### Added + - `ADDONS` flag added to `rocm_enable_cppcheck` in order to run with addons - The cache variable `ROCM_USE_DEV_COMPONENT` may be set to `OFF` to build with legacy behaviour. - - On Windows, this variable defaults to `OFF`. + - On Windows, this variable defaults to `OFF`. - `rocm_install_targets` can now install to a specific component using COMPONENT argument. - `rocm_install` is a wrapper on `install`: - - If the installation mode is TARGETS, call `rocm_install_targets` with the same arguments. - - If `ROCM_USE_DEV_COMPONENT` is `OFF` or COMPONENT is specified, call `install` with the same arguments. - - Otherwise, insert the correct arguments to install everything except libraries to the `devel` package, and install libraries to the base package with namelinks in the `devel` package. + - If the installation mode is TARGETS, call `rocm_install_targets` with the same arguments. + - If `ROCM_USE_DEV_COMPONENT` is `OFF` or COMPONENT is specified, call `install` with the same arguments. + - Otherwise, insert the correct arguments to install everything except libraries to the `devel` package, and install libraries to the base package with namelinks in the `devel` package. + ### Changed + - If `ROCM_USE_DEV_COMPONENT` is `ON`: - - `rocm_install_targets`: - - Unless COMPONENT is specified, library targets will be installed to the default package and namelinked in the devel package. - - Unless COMPONENT is specified, everything else (including any files/folders specified by INCLUDE) will be installed to the devel package. - - If COMPONENT was specified in the call to `rocm_install_targets`, that component is used instead of the above behaviour. - - `rocm_export_targets`: - - All cmake files will be installed to the devel package. - - `rocm_create_package`: - - Package generation will be performed component-wise, and automatically include the devel component, even if the COMPONENTS argument was not provided. - - If provided with the `HEADER_ONLY` option (accepting no arguments), then only the devel package will be generated. The devel package will also have the "Provides" field populated with the name/version of the runtime package for backwards compatibility. This provides field is introduced as a deprecated feature, and will be removed in a future release. + - `rocm_install_targets`: + - Unless COMPONENT is specified, library targets will be installed to the default package and namelinked in the devel package. + - Unless COMPONENT is specified, everything else (including any files/folders specified by INCLUDE) will be installed to the devel package. + - If COMPONENT was specified in the call to `rocm_install_targets`, that component is used instead of the above behaviour. + - `rocm_export_targets`: + - All cmake files will be installed to the devel package. + - `rocm_create_package`: + - Package generation will be performed component-wise, and automatically include the devel component, even if the COMPONENTS argument was not provided. + - If provided with the `HEADER_ONLY` option (accepting no arguments), then only the devel package will be generated. The devel package will also have the "Provides" field populated with the name/version of the runtime package for backwards compatibility. This provides field is introduced as a deprecated feature, and will be removed in a future release. - Corrects semantic versioning to SameMajorVersion compatibility (e.g. 0.6 is compatible if 0.5 is requested). - Moved ROCMConfigVersion.cmake file to share/rocm/cmake directory for better compatibility with automatic installation. - Correct CHANGELOG.md formatting ## [0.5.1] + ### Added + - Add ROCMConfigVersion.cmake file so cmake can check the version - Switched to semantic versioning ## [0.5] + ### Added + - Change Log added and version number incremented ## [0.4] + Pre Change Log versions diff --git a/CMakeLists.txt b/CMakeLists.txt index 330c8eed..01b04bf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/share/rocmcmakebuildtool include(ROCMCreatePackage) include(ROCMSetupVersion) -rocm_setup_version(VERSION 0.12.0) +rocm_setup_version(VERSION 0.13.0) include(CMakePackageConfigHelpers) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/ROCmCMakeBuildToolsConfigVersion.cmake From a45296218ee5afa6a0443ef825bca2fc9558ea62 Mon Sep 17 00:00:00 2001 From: Sam Wu <22262939+samjwu@users.noreply.github.com> Date: Mon, 15 Jul 2024 16:38:24 -0600 Subject: [PATCH 11/17] Update version number and changelog for ROCm 6.1 (#169) (#209) * Update version number and changelog for ROCm 6.1 (#169) * Update version in CMakeLists.txt to match changelog (#210) * Update version in CMakeLists.txt to match changelog * Fix markdownlint formatting in changelog --------- Co-authored-by: Cory Bloor --- CHANGELOG.md | 110 ++++++++++++++++++++++++++++++++++++------------- CMakeLists.txt | 2 +- 2 files changed, 83 insertions(+), 29 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 87354422..1ddfe3fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,104 +1,146 @@ # Change Log for rocm-cmake ## [(Unreleased) rocm-cmake 0.13.0 for ROCm 6.2.0] + ### Changed + - ROCmCreatePackage: Accepts a suffix parameter, automatically generating it for static or ASAN builds. - Package names will no longer be pulled from `CPACK__PACKAGE_NAME` - Runtime packages will no longer be generated for static builds + ## [rocm-cmake 0.12.0 for ROCm 6.1.0] + ### Added + - ROCMTest: Add rpath to installed tests - AOCMCreatePackage: Allow additional provides on header-only packages - ROCMSphinxDoc: Allow separate source and config directories + ### Changed + - Renamed CMake package to ROCmCMakeBuildTools. A wrapper has been provided to ensure that `find_package(ROCM)` continues to work, but it is recommended that developers switch to `find_package(ROCmCMakeBuildTools)` - ROCMInstallTargets: Stopped installing executables in ASAN builds + ### Fixed + - ROCMClangTidy: Fixed invalid list index in clang tidy - Fixed test failures when `ROCM_CMAKE_GENERATOR` is an empty string ## [rocm-cmake 0.11.0 for ROCm 6.0.0] + ### Changed + - ROCMSphinxDoc: Improved validation, documentation and rocm-docs-core integration. - Rename CMake package to ROCmCMakeBuildTools + ### Fixed + - ROCMClangTidy: Fixed extra make flags passed for clang tidy. - ROCMTest: Fixed issues when using module in a subdirectory. ## [rocm-cmake 0.10.0 for ROCm 5.7.0] + ### Added + - Added ROCMTest module - ROCMCreatePackage: Added support for ASAN packages ## [rocm-cmake 0.9.0 for ROCm 5.6.0] + ### Added + - Added the option ROCM_HEADER_WRAPPER_WERROR - - Compile-time C macro in the wrapper headers causes errors to be emitted instead of warnings. - - Configure-time CMake option sets the default for the C macro. + - Compile-time C macro in the wrapper headers causes errors to be emitted instead of warnings. + - Configure-time CMake option sets the default for the C macro. ## [rocm-cmake 0.8.1 for ROCm 5.5] + ### Fixed + - ROCMInstallTargets: Added compatibility symlinks for included cmake files in `/lib/cmake/`. + ### Changed + - ROCMHeaderWrapper: The wrapper header deprecation message is now a deprecation warning. ## [rocm-cmake 0.8.0 for ROCm 5.4] + ### Fixed + - ROCMCreatePackage: Fixed error in prerm scripts that could break package upgrades when using the `PTH` option. - Removed unnecessary requirement for having C and C++ compilers available when building rocm-cmake from source. + ### Known issues + - This release did not have a unique version number. ## [rocm-cmake 0.8.0 for ROCm 5.3] + ### Fixed + - Fixed error in prerm scripts created by `rocm_create_package` that could break uninstall for packages using the `PTH` option. + ### Changed + - `ROCM_USE_DEV_COMPONENT` set to on by default for all platforms. This means that Windows will now generate runtime and devel packages by default - ROCMInstallTargets now defaults `CMAKE_INSTALL_LIBDIR` to `lib` if not otherwise specified. - Changed default Debian compression type to xz and enabled multi-threaded package compression. - `rocm_create_package` will no longer warn upon failure to determine version of program rpmbuild. ## [0.7.3] + ### Added + - Header wrapper functionality included. This is to support the change in header file locations in ROCm 5.2, while providing backwards compatibility via header file wrappers. The associated deprecation warning can be disabled by defining `ROCM_NO_WRAPPER_HEADER_WARNING` before including the wrapper header. + ### Fixed + - Fixed spurious failures in `rocm_check_target_ids` for target ids with target features when `-Werror` is enabled. The `HAVE_` result variable has been renamed to `COMPILER_HAS_TARGET_ID_`. ## [0.7.2] + - `rocm_create_package` now will attempt to set a default `CPACK_GENERATOR` based on the `ROCM_PKGTYPE` environment variable if one is not already set. ## [0.7.1] + ### Added + - `CLANG_TIDY_USE_COLOR` variable added to control the color output from `clang-tidy`, by default this is `On`. - If `CPACK_RESOURCE_FILE_LICENSE` is not set, `rocm_create_package` will now automatically attempt to find a LICENSE, LICENSE.txt, or LICENSE.md file in the top-level CMake source directory. If one is found, it is set up as the license file for the package. ## [0.7.0] + ### Added + - Component packaging functionality: - - `rocm_package_setup_component` sets up a component for packaging, with the given name and values for the component and associated package. + - `rocm_package_setup_component` sets up a component for packaging, with the given name and values for the component and associated package. - - The variable `ROCM_PACKAGE_COMPONENTS` stores a list of the components which have been set up with `rocm_package_setup_component`. - - `rocm_package_add_rpm_dependencies` adds any number of dependencies to the RPM package for an optional specified component, including version checks (e.g. `foo >= 1.0`) - - `rocm_package_add_deb_dependencies` adds any number of dependencies to the DEB package for an optional specified component, including version checks (e.g. `foo >= 1.0`) - - Note that this version format matches RPM, it is reformatted to the Debian package format. This is to reduce code duplication. - - `rocm_package_add_dependencies` is a convenience wrapper which calls both `rocm_add_rpm_dependencies` and `rocm_add_deb_dependencies` to add any number of dependencies to both packages for an optional specified component. + - The variable `ROCM_PACKAGE_COMPONENTS` stores a list of the components which have been set up with `rocm_package_setup_component`. + - `rocm_package_add_rpm_dependencies` adds any number of dependencies to the RPM package for an optional specified component, including version checks (e.g. `foo >= 1.0`) + - `rocm_package_add_deb_dependencies` adds any number of dependencies to the DEB package for an optional specified component, including version checks (e.g. `foo >= 1.0`) + - Note that this version format matches RPM, it is reformatted to the Debian package format. This is to reduce code duplication. + - `rocm_package_add_dependencies` is a convenience wrapper which calls both `rocm_add_rpm_dependencies` and `rocm_add_deb_dependencies` to add any number of dependencies to both packages for an optional specified component. - Client packaging functions: - - `rocm_package_setup_client_component` is a convenience wrapper which adds the library as a runtime dependency if shared libraries were built, and sets the parent of the client package to `clients`. + - `rocm_package_setup_client_component` is a convenience wrapper which adds the library as a runtime dependency if shared libraries were built, and sets the parent of the client package to `clients`. - Utility functions: - - `rocm_join_if_set` joins any number of non-empty strings to the end of a given variable interspersed with a specified glue string, setting that variable if it was previously empty - - `rocm_find_program_version` checks to see if the given command is available, and if it is available that the version matches some criteria. The detected version is returned in ``, and whether it matches all given criteria in `_OK`. - - `` defaults to `_VERSION` if not specified. + - `rocm_join_if_set` joins any number of non-empty strings to the end of a given variable interspersed with a specified glue string, setting that variable if it was previously empty + - `rocm_find_program_version` checks to see if the given command is available, and if it is available that the version matches some criteria. The detected version is returned in ``, and whether it matches all given criteria in `_OK`. + - `` defaults to `_VERSION` if not specified. + ### Changed + - If `ROCM_PACKAGE_COMPONENTS` is set (either manually or by `rocm_package_setup_component`), then the components listed in `ROCM_PACKAGE_COMPONENTS` will be built as separate packages. - `rocm_read_os_release` and `rocm_set_os_id` moved to the utilities file. As this file is included in `ROCMCreatePackage.cmake`, this change is backwards compatible. - `rocm_install_symlink_subdir` now accepts a `COMPONENT` argument, which controls the component that the symlinks are installed into. ## [0.6.2] + ### Changed + - If the ROCm platform version that is being built for is less than version 4.5.0, `ROCM_DEP_ROCMCORE` is automatically disabled. - The ROCm platform version is determined by: - the user-set CMake variable `ROCM_PLATFORM_VERSION`; otherwise @@ -107,44 +149,56 @@ - If the ROCm platform version is not set, then it is assumed to be greater than 4.5.0. ## [0.6.1] + ### Added + - Modules added to generate documentation: - - `ROCMDocs` - - `ROCMDoxygenDoc` - - `ROCMSphinxDoc` + - `ROCMDocs` + - `ROCMDoxygenDoc` + - `ROCMSphinxDoc` + ## [0.6.0] + ### Added + - `ADDONS` flag added to `rocm_enable_cppcheck` in order to run with addons - The cache variable `ROCM_USE_DEV_COMPONENT` may be set to `OFF` to build with legacy behaviour. - - On Windows, this variable defaults to `OFF`. + - On Windows, this variable defaults to `OFF`. - `rocm_install_targets` can now install to a specific component using COMPONENT argument. - `rocm_install` is a wrapper on `install`: - - If the installation mode is TARGETS, call `rocm_install_targets` with the same arguments. - - If `ROCM_USE_DEV_COMPONENT` is `OFF` or COMPONENT is specified, call `install` with the same arguments. - - Otherwise, insert the correct arguments to install everything except libraries to the `devel` package, and install libraries to the base package with namelinks in the `devel` package. + - If the installation mode is TARGETS, call `rocm_install_targets` with the same arguments. + - If `ROCM_USE_DEV_COMPONENT` is `OFF` or COMPONENT is specified, call `install` with the same arguments. + - Otherwise, insert the correct arguments to install everything except libraries to the `devel` package, and install libraries to the base package with namelinks in the `devel` package. + ### Changed + - If `ROCM_USE_DEV_COMPONENT` is `ON`: - - `rocm_install_targets`: - - Unless COMPONENT is specified, library targets will be installed to the default package and namelinked in the devel package. - - Unless COMPONENT is specified, everything else (including any files/folders specified by INCLUDE) will be installed to the devel package. - - If COMPONENT was specified in the call to `rocm_install_targets`, that component is used instead of the above behaviour. - - `rocm_export_targets`: - - All cmake files will be installed to the devel package. - - `rocm_create_package`: - - Package generation will be performed component-wise, and automatically include the devel component, even if the COMPONENTS argument was not provided. - - If provided with the `HEADER_ONLY` option (accepting no arguments), then only the devel package will be generated. The devel package will also have the "Provides" field populated with the name/version of the runtime package for backwards compatibility. This provides field is introduced as a deprecated feature, and will be removed in a future release. + - `rocm_install_targets`: + - Unless COMPONENT is specified, library targets will be installed to the default package and namelinked in the devel package. + - Unless COMPONENT is specified, everything else (including any files/folders specified by INCLUDE) will be installed to the devel package. + - If COMPONENT was specified in the call to `rocm_install_targets`, that component is used instead of the above behaviour. + - `rocm_export_targets`: + - All cmake files will be installed to the devel package. + - `rocm_create_package`: + - Package generation will be performed component-wise, and automatically include the devel component, even if the COMPONENTS argument was not provided. + - If provided with the `HEADER_ONLY` option (accepting no arguments), then only the devel package will be generated. The devel package will also have the "Provides" field populated with the name/version of the runtime package for backwards compatibility. This provides field is introduced as a deprecated feature, and will be removed in a future release. - Corrects semantic versioning to SameMajorVersion compatibility (e.g. 0.6 is compatible if 0.5 is requested). - Moved ROCMConfigVersion.cmake file to share/rocm/cmake directory for better compatibility with automatic installation. - Correct CHANGELOG.md formatting ## [0.5.1] + ### Added + - Add ROCMConfigVersion.cmake file so cmake can check the version - Switched to semantic versioning ## [0.5] + ### Added + - Change Log added and version number incremented ## [0.4] + Pre Change Log versions diff --git a/CMakeLists.txt b/CMakeLists.txt index b5a38199..01b04bf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/share/rocmcmakebuildtool include(ROCMCreatePackage) include(ROCMSetupVersion) -rocm_setup_version(VERSION 0.11.0) +rocm_setup_version(VERSION 0.13.0) include(CMakePackageConfigHelpers) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/ROCmCMakeBuildToolsConfigVersion.cmake From 0f3cadab979fa15a5c97d90a565fcbbecb3e5992 Mon Sep 17 00:00:00 2001 From: Lauren Wrubleski Date: Fri, 19 Jul 2024 03:10:08 -0600 Subject: [PATCH 12/17] Don't set `CPACK_RPM_MAIN_COMPONENT' for ASAN builds Setting `CPACK_RPM_MAIN_COMPONENT` to any component causes the package name for that component to be automatically generated from `CPACK_PACKAGE_NAME` (ignoring the other work we've done to correct the name), which in particular causes the runtime packages for ASAN builds to not be generated with the ASAN suffix. In order to minimize the impact, I'm disabling this call only in the case that we're doing an ASAN build, I don't want to break any other spots where it is actually working correctly, but I think we should investigate removing this entirely. --- share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake b/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake index 3733c74a..1cab2d8d 100755 --- a/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake +++ b/share/rocmcmakebuildtools/cmake/ROCMCreatePackage.cmake @@ -531,7 +531,9 @@ macro(rocm_set_comp_cpackvar HEADER_ONLY NAME_SUFFIX components) set(CPACK_DEBIAN_RUNTIME_FILE_NAME "DEB-DEFAULT") endif() if (NOT ${HEADER_ONLY} AND BUILD_SHARED_LIBS) - set(CPACK_RPM_MAIN_COMPONENT "runtime") + if (NOT ENABLE_ASAN_PACKAGING) + set(CPACK_RPM_MAIN_COMPONENT "runtime") + endif() list(APPEND CPACK_COMPONENTS_ALL runtime) endif() endif() From b662b92c56c61a827f8461f9d6f3abd88dd1b71f Mon Sep 17 00:00:00 2001 From: Cory Bloor Date: Fri, 2 Aug 2024 11:24:40 -0600 Subject: [PATCH 13/17] Update version for ROCm 6.3 dev cycle (#215) --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 01b04bf6..4100ac21 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/share/rocmcmakebuildtool include(ROCMCreatePackage) include(ROCMSetupVersion) -rocm_setup_version(VERSION 0.13.0) +rocm_setup_version(VERSION 0.14.0) include(CMakePackageConfigHelpers) write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/ROCmCMakeBuildToolsConfigVersion.cmake From f1d1dc927fbf74634b92a944bba2a31bf9aaccd8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 9 Aug 2024 11:04:24 -0600 Subject: [PATCH 14/17] Bump rocm-docs-core from 1.4.0 to 1.6.2 in /docs (#220) Bumps [rocm-docs-core](https://github.com/ROCm/rocm-docs-core) from 1.4.0 to 1.6.2. - [Release notes](https://github.com/ROCm/rocm-docs-core/releases) - [Changelog](https://github.com/ROCm/rocm-docs-core/blob/v1.6.2/CHANGELOG.md) - [Commits](https://github.com/ROCm/rocm-docs-core/compare/v1.4.0...v1.6.2) --- updated-dependencies: - dependency-name: rocm-docs-core dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- docs/requirements.in | 2 +- docs/requirements.txt | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/requirements.in b/docs/requirements.in index 480de5db..09a5a3a8 100644 --- a/docs/requirements.in +++ b/docs/requirements.in @@ -1,2 +1,2 @@ sphinxcontrib-moderncmakedomain==3.29.0 -rocm-docs-core==1.4.0 +rocm-docs-core==1.6.2 diff --git a/docs/requirements.txt b/docs/requirements.txt index cf77425a..9747429e 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -92,7 +92,7 @@ requests==2.32.3 # via # pygithub # sphinx -rocm-docs-core==1.4.0 +rocm-docs-core==1.6.2 # via -r requirements.in smmap==5.0.1 # via gitdb @@ -136,8 +136,6 @@ sphinxcontrib-qthelp==1.0.7 # via sphinx sphinxcontrib-serializinghtml==1.1.10 # via sphinx -tomli==2.0.1 - # via sphinx typing-extensions==4.12.2 # via # pydata-sphinx-theme From e494a5096d0d3f8da3fe14a42e8c2a0df185db4e Mon Sep 17 00:00:00 2001 From: Joseph Macaranas <145489236+amd-jmacaran@users.noreply.github.com> Date: Wed, 14 Aug 2024 01:36:52 -0400 Subject: [PATCH 15/17] External CI: Add triggers for mainline branch (#211) --- .azuredevops/rocm-ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.azuredevops/rocm-ci.yml b/.azuredevops/rocm-ci.yml index 096c97c3..0e26f7df 100644 --- a/.azuredevops/rocm-ci.yml +++ b/.azuredevops/rocm-ci.yml @@ -14,6 +14,7 @@ trigger: branches: include: - develop + - mainline paths: exclude: - .github @@ -26,6 +27,7 @@ pr: branches: include: - develop + - mainline paths: exclude: - .github From f3e11e7d55b413929f63eb2e2d2dc196e2d09b16 Mon Sep 17 00:00:00 2001 From: Lauren Wrubleski Date: Fri, 16 Aug 2024 18:58:33 -0600 Subject: [PATCH 16/17] Update `macos` runner (#219) The `macos-11` runner is deprecated by GitHub: https://github.blog/changelog/2024-05-20-actions-upcoming-changes-to-github-hosted-macos-runners/ We should switch to a later `macos` runner, I have selected 12 here --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3dfcddad..6d8e68bb 100755 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -33,7 +33,7 @@ jobs: matrix: platform: - ubuntu-20.04 - - macos-11 + - macos-12 - windows-2019 cmake-version: - 3.20.0 From fcd8a82789214f21abb3231f9c23faa9b9755fd6 Mon Sep 17 00:00:00 2001 From: randyh62 <42045079+randyh62@users.noreply.github.com> Date: Fri, 16 Aug 2024 18:06:17 -0700 Subject: [PATCH 17/17] doc reorg with src folder (#195) * doc reorg with src folder * leo's comments * added Files and Content * Update codeowners for docs * reorg based on Paul's feedback --------- Co-authored-by: Sam Wu <22262939+samjwu@users.noreply.github.com> --- .github/CODEOWNERS | 3 +- docs/src/_toc.yml.in | 26 ++--- docs/src/contents.rst | 85 ++++++++++++++ docs/src/index.rst | 109 ++++-------------- docs/src/reference/ROCMAnalyzers.rst | 13 ++- docs/src/reference/ROCMCheckTargetIds.rst | 9 +- docs/src/reference/ROCMClangTidy.rst | 9 +- docs/src/reference/ROCMClients.rst | 9 +- docs/src/reference/ROCMCppCheck.rst | 9 +- docs/src/reference/ROCMCreatePackage.rst | 9 +- docs/src/reference/ROCMDocs.rst | 9 +- docs/src/reference/ROCMDoxygenDoc.rst | 9 +- docs/src/reference/ROCMHeaderWrapper.rst | 9 +- docs/src/reference/ROCMInstallSymlinks.rst | 9 +- docs/src/reference/ROCMInstallTargets.rst | 9 +- .../reference/ROCMPackageConfigHelpers.rst | 9 +- docs/src/reference/ROCMSetupVersion.rst | 9 +- docs/src/reference/ROCMSphinxDoc.rst | 9 +- docs/src/reference/ROCMTest.rst | 9 +- docs/src/reference/ROCMUtilities.rst | 9 +- 20 files changed, 251 insertions(+), 120 deletions(-) create mode 100644 docs/src/contents.rst diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 380ece0f..ce4d4faf 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,5 +1,6 @@ * @pfultz2 @lawruble13 @cgmb # Documentation files -docs/* @ROCm/rocm-documentation @pfultz2 @lawruble13 @cgmb +docs/ @ROCm/rocm-documentation @pfultz2 @lawruble13 @cgmb *.md @ROCm/rocm-documentation @pfultz2 @lawruble13 @cgmb *.rst @ROCm/rocm-documentation @pfultz2 @lawruble13 @cgmb +.readthedocs.yaml @ROCm/rocm-documentation @pfultz2 @lawruble13 @cgmb diff --git a/docs/src/_toc.yml.in b/docs/src/_toc.yml.in index 23256060..173a83e0 100644 --- a/docs/src/_toc.yml.in +++ b/docs/src/_toc.yml.in @@ -10,24 +10,20 @@ defaults: maxdepth: 6 root: index.rst subtrees: - - caption: Basic Common Functionality + - caption: Installation + entries: + - file: reference/ROCMInstallTargets.rst + - file: reference/ROCMInstallSymlinks.rst + - file: reference/ROCMHeaderWrapper.rst + - file: reference/ROCMCreatePackage.rst + - file: reference/ROCMClients.rst + - file: reference/ROCMPackageConfigHelpers.rst + - caption: Basic functions entries: - file: reference/ROCMCheckTargetIds.rst - file: reference/ROCMSetupVersion.rst - file: reference/ROCMAnalyzers.rst - - caption: Installation & Packaging - entries: - - file: reference/ROCMInstallTargets.rst - subtrees: - - entries: - - file: reference/ROCMInstallSymlinks.rst - - file: reference/ROCMHeaderWrapper.rst - - file: reference/ROCMCreatePackage.rst - subtrees: - - entries: - - file: reference/ROCMClients.rst - - file: reference/ROCMPackageConfigHelpers.rst - - caption: Standard Tooling + - caption: Standard tooling entries: - file: reference/ROCMClangTidy.rst - file: reference/ROCMCppCheck.rst @@ -37,7 +33,7 @@ subtrees: - file: reference/ROCMDocs.rst - file: reference/ROCMDoxygenDoc.rst - file: reference/ROCMSphinxDoc.rst - - caption: Internal usage + - caption: Internal use entries: - file: reference/ROCMUtilities.rst - caption: About diff --git a/docs/src/contents.rst b/docs/src/contents.rst new file mode 100644 index 00000000..e040b2b6 --- /dev/null +++ b/docs/src/contents.rst @@ -0,0 +1,85 @@ +.. rocm-cmake documentation master file, created by + sphinx-quickstart on Thu Sep 16 18:46:06 2021. + You can adapt this file completely to your liking, but it should at least + contain the root `toctree` directive. +.. highlight:: cmake + +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _contents: + +**************************************************** +Modules and functions +**************************************************** + +- :ref:`rocmanalyzers` + + :any:`rocm_mark_as_analyzer` + + :any:`ROCM_ENABLE_GH_ANNOTATIONS` +- :ref:`rocmchecktargetids` + + :any:`rocm_check_target_ids` +- :ref:`rocmclangtidy` + + :any:`rocm_enable_clang_tidy` + + :any:`rocm_clang_tidy_check` + + :any:`CLANG_TIDY_EXE` + + :any:`CLANG_TIDY_CACHE` + + :any:`CLANG_TIDY_CACHE_SIZE` + + :any:`CLANG_TIDY_DEPEND_ON_TARGET` +- :ref:`rocmclients` + + :any:`rocm_package_setup_client_component` +- :ref:`rocmcppcheck` + + :any:`rocm_enable_cppcheck` + + :any:`CPPCHECK_EXE` + + :any:`CPPCHECK_BUILD_DIR` +- :ref:`rocmcreatepackage` + + :any:`rocm_create_package` + + :any:`rocm_package_add_rpm_dependencies` + + :any:`rocm_package_add_deb_dependencies` + + :any:`rocm_package_add_dependencies` + + :any:`rocm_package_setup_component` +- :ref:`rocmdocs` + + :any:`rocm_mark_as_doc` + + :any:`rocm_clean_doc_output` +- :ref:`rocmdoxygendoc` + + :any:`rocm_add_doxygen_doc` + + :any:`DOXYGEN_EXECUTABLE` + + :any:`DOT_EXECUTABLE` +- :ref:`rocminstallsymlinks` + + :any:`rocm_install_symlink_subdir` +- :ref:`rocminstalltargets` + + :any:`rocm_install` + + :any:`rocm_install_targets` + + :any:`rocm_export_targets` +- :ref:`rocmconfighelpers` + + :any:`rocm_configure_package_config_file` +- :ref:`rocmsetupversion` + + :any:`rocm_get_version` + + :any:`rocm_setup_version` +- :ref:`rocmsphinxdoc` + + :any:`rocm_add_doxygen_doc` + + :any:`SPHINX_EXECUTABLE` + + :any:`SPHINX_${BUILDER}_DIR` +- :ref:`rocmtest` + + :any:`rocm_enable_test_package` + + :any:`rocm_add_test` + + :any:`rocm_add_test_executable` + + :any:`rocm_test_header` + + :any:`rocm_test_headers` + + :any:`rocm_install_test` + + :any:`rocm_mark_as_test` + + :any:`rocm_link_test_dependencies` + + :any:`rocm_test_link_libraries` + + :any:`CTEST_PARALLEL_LEVEL` + + :any:`CTEST_TIMEOUT` + + :any:`ROCM_TEST_GDB` +- :ref:`rocmutilities` + + :any:`rocm_join_if_set` + + :any:`rocm_defer` + + :any:`rocm_find_program_version` + +Index and tables +================ + +* :ref:`genindex` +* :ref:`search` \ No newline at end of file diff --git a/docs/src/index.rst b/docs/src/index.rst index 7bf69845..7671c11c 100755 --- a/docs/src/index.rst +++ b/docs/src/index.rst @@ -4,103 +4,40 @@ contain the root `toctree` directive. .. highlight:: cmake -ROCm CMake Build Tools -====================== +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD -Summary -------- +.. _rocm-cmake: -ROCm CMake Build Tools (also stylized as "ROCmCMakeBuildTools" and previously -known as "rocm-cmake") is a collection of functions that unify and simplify the -CMake code of the ROCm components, as well as ensuring consistency across these -components. +**************************************************** +ROCm CMake build tools +**************************************************** -Usage ------ +ROCm CMake build tools (also known as "rocm-cmake") is a collection of functions +that unify and simplify the CMake code of ROCm components, as well as ensuring +consistency across these different components. ROCm CMake build tools are primarily +used when building a library, and as such are not runtime dependencies for any generated +libraries, packages, or executables. -The ROCm CMake Build Tools are primarily used at build time of a library, and -as such are not runtime dependencies for any generated libraries, packages, -or executables. +The build tools can be included into a CMake project by running: -The tools can be included into a CMake project by running:: +.. code-block:: shell find_package(ROCmCMakeBuildTools) # or find_package(ROCM) # deprecated, but included for backwards compatibility Once the tools have been included in this manner, individual files may be -included by running ``include()``. The file names, and the -functions, variables, and macros accessible using each file are listed below. +included by running ``include()``. The file names, the +functions, variables, and macros accessible using each file are described in +this documentation. -Files & Contents -~~~~~~~~~~~~~~~~ +You can access the build tools on the `ROCm CMake GitHub repository `_. +For a complete listing of the features of ROCm CMake refer to :ref:`contents`. -- :any:`ROCMAnalyzers` - + :any:`rocm_mark_as_analyzer` - + :any:`ROCM_ENABLE_GH_ANNOTATIONS` -- :any:`ROCMCheckTargetIds` - + :any:`rocm_check_target_ids` -- :any:`ROCMClangTidy` - + :any:`rocm_enable_clang_tidy` - + :any:`rocm_clang_tidy_check` - + :any:`CLANG_TIDY_EXE` - + :any:`CLANG_TIDY_CACHE` - + :any:`CLANG_TIDY_CACHE_SIZE` - + :any:`CLANG_TIDY_DEPEND_ON_TARGET` -- :any:`ROCMClients` - + :any:`rocm_package_setup_client_component` -- :any:`ROCMCppCheck` - + :any:`rocm_enable_cppcheck` - + :any:`CPPCHECK_EXE` - + :any:`CPPCHECK_BUILD_DIR` -- :any:`ROCMCreatePackage` - + :any:`rocm_create_package` - + :any:`rocm_package_add_rpm_dependencies` - + :any:`rocm_package_add_deb_dependencies` - + :any:`rocm_package_add_dependencies` - + :any:`rocm_package_setup_component` -- :any:`ROCMDocs` - + :any:`rocm_mark_as_doc` - + :any:`rocm_clean_doc_output` -- :any:`ROCMDoxygenDoc` - + :any:`rocm_add_doxygen_doc` - + :any:`DOXYGEN_EXECUTABLE` - + :any:`DOT_EXECUTABLE` -- :any:`ROCMInstallSymlinks` - + :any:`rocm_install_symlink_subdir` -- :any:`ROCMInstallTargets` - + :any:`rocm_install` - + :any:`rocm_install_targets` - + :any:`rocm_export_targets` -- :any:`ROCMPackageConfigHelpers` - + :any:`rocm_configure_package_config_file` -- :any:`ROCMSetupVersion` - + :any:`rocm_get_version` - + :any:`rocm_setup_version` -- :any:`ROCMSphinxDoc` - + :any:`rocm_add_doxygen_doc` - + :any:`SPHINX_EXECUTABLE` - + :any:`SPHINX_${BUILDER}_DIR` -- :any:`ROCMTest` - + :any:`rocm_enable_test_package` - + :any:`rocm_add_test` - + :any:`rocm_add_test_executable` - + :any:`rocm_test_header` - + :any:`rocm_test_headers` - + :any:`rocm_install_test` - + :any:`rocm_mark_as_test` - + :any:`rocm_link_test_dependencies` - + :any:`rocm_test_link_libraries` - + :any:`CTEST_PARALLEL_LEVEL` - + :any:`CTEST_TIMEOUT` - + :any:`ROCM_TEST_GDB` -- :any:`ROCMUtilities` - + :any:`rocm_join_if_set` - + :any:`rocm_defer` - + :any:`rocm_find_program_version` +To contribute to the documentation, refer to +`Contributing to ROCm `_. -Indices and tables -================== - -* :ref:`genindex` -* :ref:`search` +You can find licensing information on the +`Licensing `_ page. diff --git a/docs/src/reference/ROCMAnalyzers.rst b/docs/src/reference/ROCMAnalyzers.rst index 1a91471d..213045f4 100755 --- a/docs/src/reference/ROCMAnalyzers.rst +++ b/docs/src/reference/ROCMAnalyzers.rst @@ -1,7 +1,14 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmanalyzers: + +**************************************************** ROCMAnalyzers -============= +**************************************************** -This creates a ``analyze`` target which can run all analysis for a project. +This creates an ``analyze`` target which can run all analysis for a project. Commands -------- @@ -19,4 +26,4 @@ Variables .. cmake:variable:: ROCM_ENABLE_GH_ANNOTATIONS -Set this variable to ``ON`` so that analyzers will emit diagnostics in a format that github can use to annotate pull requests. +Set this variable to ``ON`` so that analyzers will emit diagnostics in a format that GitHub can use to annotate pull requests. diff --git a/docs/src/reference/ROCMCheckTargetIds.rst b/docs/src/reference/ROCMCheckTargetIds.rst index 386f60f4..49dcbaa5 100755 --- a/docs/src/reference/ROCMCheckTargetIds.rst +++ b/docs/src/reference/ROCMCheckTargetIds.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmchecktargetids: + +**************************************************** ROCMCheckTargetIds -================== +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMClangTidy.rst b/docs/src/reference/ROCMClangTidy.rst index 22024e26..6363a7b4 100755 --- a/docs/src/reference/ROCMClangTidy.rst +++ b/docs/src/reference/ROCMClangTidy.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmclangtidy: + +**************************************************** ROCMClangTidy -============= +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMClients.rst b/docs/src/reference/ROCMClients.rst index 9384e8d1..8a2914b0 100644 --- a/docs/src/reference/ROCMClients.rst +++ b/docs/src/reference/ROCMClients.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmclients: + +**************************************************** ROCMClients -=========== +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMCppCheck.rst b/docs/src/reference/ROCMCppCheck.rst index 610b7eb1..d892bd23 100755 --- a/docs/src/reference/ROCMCppCheck.rst +++ b/docs/src/reference/ROCMCppCheck.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmcppcheck: + +**************************************************** ROCMCppCheck -============ +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMCreatePackage.rst b/docs/src/reference/ROCMCreatePackage.rst index 5ca4fd58..e980ebfc 100755 --- a/docs/src/reference/ROCMCreatePackage.rst +++ b/docs/src/reference/ROCMCreatePackage.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmcreatepackage: + +**************************************************** ROCMCreatePackage -================= +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMDocs.rst b/docs/src/reference/ROCMDocs.rst index 057c6c5f..e4c04599 100755 --- a/docs/src/reference/ROCMDocs.rst +++ b/docs/src/reference/ROCMDocs.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmdocs: + +**************************************************** ROCMDocs -======== +**************************************************** This creates a ``doc`` target which can run all documentation generation for the project. diff --git a/docs/src/reference/ROCMDoxygenDoc.rst b/docs/src/reference/ROCMDoxygenDoc.rst index 929808f6..52064f95 100755 --- a/docs/src/reference/ROCMDoxygenDoc.rst +++ b/docs/src/reference/ROCMDoxygenDoc.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmdoxygendoc: + +**************************************************** ROCMDoxygenDoc -============== +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMHeaderWrapper.rst b/docs/src/reference/ROCMHeaderWrapper.rst index 665f0b9a..181273f5 100644 --- a/docs/src/reference/ROCMHeaderWrapper.rst +++ b/docs/src/reference/ROCMHeaderWrapper.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmheaderwrapper: + +**************************************************** ROCMHeaderWrapper -================= +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMInstallSymlinks.rst b/docs/src/reference/ROCMInstallSymlinks.rst index 78e529b9..70d226e7 100644 --- a/docs/src/reference/ROCMInstallSymlinks.rst +++ b/docs/src/reference/ROCMInstallSymlinks.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocminstallsymlinks: + +**************************************************** ROCMInstallSymlinks -=================== +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMInstallTargets.rst b/docs/src/reference/ROCMInstallTargets.rst index bf296a96..35678a71 100644 --- a/docs/src/reference/ROCMInstallTargets.rst +++ b/docs/src/reference/ROCMInstallTargets.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocminstalltargets: + +**************************************************** ROCMInstallTargets -================== +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMPackageConfigHelpers.rst b/docs/src/reference/ROCMPackageConfigHelpers.rst index bf89dc9d..b53ff761 100755 --- a/docs/src/reference/ROCMPackageConfigHelpers.rst +++ b/docs/src/reference/ROCMPackageConfigHelpers.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmconfighelpers: + +**************************************************** ROCMPackageConfigHelpers -======================== +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMSetupVersion.rst b/docs/src/reference/ROCMSetupVersion.rst index de5b43a3..9d75cf17 100644 --- a/docs/src/reference/ROCMSetupVersion.rst +++ b/docs/src/reference/ROCMSetupVersion.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmSetupVersion: + +**************************************************** ROCMSetupVersion -================ +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMSphinxDoc.rst b/docs/src/reference/ROCMSphinxDoc.rst index 4fb8cfab..e17b42d0 100755 --- a/docs/src/reference/ROCMSphinxDoc.rst +++ b/docs/src/reference/ROCMSphinxDoc.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmSphinxDoc: + +**************************************************** ROCMSphinxDoc -============= +**************************************************** Commands -------- diff --git a/docs/src/reference/ROCMTest.rst b/docs/src/reference/ROCMTest.rst index abeaa18d..4c01f3ca 100644 --- a/docs/src/reference/ROCMTest.rst +++ b/docs/src/reference/ROCMTest.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmtest: + +**************************************************** ROCMTest -======== +**************************************************** This adds a ``check`` target to build and run the tests using CTest. A ``tests`` target can be used to just build the tests. All the tests are then packaged in the test component. diff --git a/docs/src/reference/ROCMUtilities.rst b/docs/src/reference/ROCMUtilities.rst index ebd8bf33..72861ba1 100644 --- a/docs/src/reference/ROCMUtilities.rst +++ b/docs/src/reference/ROCMUtilities.rst @@ -1,5 +1,12 @@ +.. meta:: + :description: ROCm CMake + :keywords: ROCm, Cmake, library, api, AMD + +.. _rocmutilities: + +**************************************************** ROCMUtilities -============= +**************************************************** Commands --------