From 383d02d8f6ccba33e0c083b7c05b867aac768b8f Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Thu, 28 Aug 2025 07:42:40 -0700 Subject: [PATCH 1/5] Add Fedora copyright Signed-off-by: Tom Rix --- rocm-examples.spec | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/rocm-examples.spec b/rocm-examples.spec index 9d669e1..e4f0154 100644 --- a/rocm-examples.spec +++ b/rocm-examples.spec @@ -1,3 +1,24 @@ +# +# Copyright Fedora Project Authors. +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. +# %global upstreamname rocm-examples %global rocm_release 6.4 %global rocm_patch 2 @@ -25,7 +46,7 @@ Name: rocm-examples Version: %{rocm_version} -Release: 2%{?dist} +Release: 3%{?dist} Summary: A collection of examples for the ROCm software stack Url: https://github.com/ROCm/%{upstreamname} License: MIT AND Apache-2.0 @@ -133,6 +154,9 @@ sed -i -e 's@add_subdirectory(module_api)@message("no module_api")@' HIP-Basi %{_bindir}/* %changelog +* Thu Aug 28 2025 Tom Rix - 6.4.2-3 +- Add Fedora copyright + * Wed Jul 30 2025 Tom Rix - 6.4.2-2 - Remove -mtls-dialect cflag From 296596dda146203936443939fb1b095190a58b4c Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Tue, 23 Sep 2025 08:38:42 -0700 Subject: [PATCH 2/5] Update to 7.0.1 Signed-off-by: Tom Rix --- .gitignore | 1 + rocm-examples.spec | 13 +++++++++---- sources | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 243ce07..4dd282e 100644 --- a/.gitignore +++ b/.gitignore @@ -2,3 +2,4 @@ /rocm-examples-6.4.0.tar.gz /rocm-examples-6.4.1.tar.gz /rocm-examples-6.4.2.tar.gz +/rocm-examples-7.0.1.tar.gz diff --git a/rocm-examples.spec b/rocm-examples.spec index e4f0154..1a67054 100644 --- a/rocm-examples.spec +++ b/rocm-examples.spec @@ -20,8 +20,8 @@ # THE SOFTWARE. # %global upstreamname rocm-examples -%global rocm_release 6.4 -%global rocm_patch 2 +%global rocm_release 7.0 +%global rocm_patch 1 %global rocm_version %{rocm_release}.%{rocm_patch} %global toolchain rocm @@ -46,7 +46,7 @@ Name: rocm-examples Version: %{rocm_version} -Release: 3%{?dist} +Release: 1%{?dist} Summary: A collection of examples for the ROCm software stack Url: https://github.com/ROCm/%{upstreamname} License: MIT AND Apache-2.0 @@ -115,7 +115,9 @@ The examples are structured in several categories: # No External, not going to bundle things outside of this project. # Not having glfw-devel turns off building examples that use External/glad -rm -rf External/ +# +# Need to keep CmdParser +rm -rf External/{glad,KHR} # https://github.com/ROCm/rocm-examples/issues/217 for f in `find . -name 'CMakeLists.txt'`; do @@ -154,6 +156,9 @@ sed -i -e 's@add_subdirectory(module_api)@message("no module_api")@' HIP-Basi %{_bindir}/* %changelog +* Sun Sep 21 2025 Tom Rix - 7.0.1-1 +- Update to 7.0.1 + * Thu Aug 28 2025 Tom Rix - 6.4.2-3 - Add Fedora copyright diff --git a/sources b/sources index 2260df9..a3de86c 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rocm-examples-6.4.2.tar.gz) = 487cf15961cf29348d249d757e0204b849f3cd6bce0c201a8de4dda6367dbf62e7287df7c6b6fad534382ead738f68b69202f6c62eec5c037916dd952a24e1d2 +SHA512 (rocm-examples-7.0.1.tar.gz) = dac2532b42f3521b2e2fca4c2762d089ee6970acd65f091217e3021a04c02c7fb3aaf5d2df461c9e4c48e65fdde7bccbbb712c7c973f97bee2ce90503d47e6c7 From bbde55fb1ae180ff4e2ec7fe8fef1c9a8a9aa410 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Mon, 13 Oct 2025 08:07:48 -0700 Subject: [PATCH 3/5] Update to 7.0.2 Signed-off-by: Tom Rix --- .gitignore | 1 + rocm-examples.spec | 5 ++++- sources | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 4dd282e..140de1a 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /rocm-examples-6.4.1.tar.gz /rocm-examples-6.4.2.tar.gz /rocm-examples-7.0.1.tar.gz +/rocm-examples-7.0.2.tar.gz diff --git a/rocm-examples.spec b/rocm-examples.spec index 1a67054..80fec5c 100644 --- a/rocm-examples.spec +++ b/rocm-examples.spec @@ -21,7 +21,7 @@ # %global upstreamname rocm-examples %global rocm_release 7.0 -%global rocm_patch 1 +%global rocm_patch 2 %global rocm_version %{rocm_release}.%{rocm_patch} %global toolchain rocm @@ -156,6 +156,9 @@ sed -i -e 's@add_subdirectory(module_api)@message("no module_api")@' HIP-Basi %{_bindir}/* %changelog +* Sat Oct 11 2025 Tom Rix - 7.0.2-1 +- Update to 7.0.2 + * Sun Sep 21 2025 Tom Rix - 7.0.1-1 - Update to 7.0.1 diff --git a/sources b/sources index a3de86c..3362190 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rocm-examples-7.0.1.tar.gz) = dac2532b42f3521b2e2fca4c2762d089ee6970acd65f091217e3021a04c02c7fb3aaf5d2df461c9e4c48e65fdde7bccbbb712c7c973f97bee2ce90503d47e6c7 +SHA512 (rocm-examples-7.0.2.tar.gz) = 8c04b5d9801c3c0d2c023feecb21674bc5888edd55a62ff29f08dc5093a29fc61c2e9c292ec6dd8382e334929315cfd7f679eb68034fd443ced255b710b79a46 From 81618fd2e52f17848a81401a534a934b822b1029 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Tue, 4 Nov 2025 13:51:10 -0800 Subject: [PATCH 4/5] Update to 7.1.0 Signed-off-by: Tom Rix --- .gitignore | 1 + rocm-examples.spec | 7 +++++-- sources | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 140de1a..3ac48e1 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,4 @@ /rocm-examples-6.4.2.tar.gz /rocm-examples-7.0.1.tar.gz /rocm-examples-7.0.2.tar.gz +/rocm-examples-7.1.0.tar.gz diff --git a/rocm-examples.spec b/rocm-examples.spec index 80fec5c..1e7fdf5 100644 --- a/rocm-examples.spec +++ b/rocm-examples.spec @@ -20,8 +20,8 @@ # THE SOFTWARE. # %global upstreamname rocm-examples -%global rocm_release 7.0 -%global rocm_patch 2 +%global rocm_release 7.1 +%global rocm_patch 0 %global rocm_version %{rocm_release}.%{rocm_patch} %global toolchain rocm @@ -156,6 +156,9 @@ sed -i -e 's@add_subdirectory(module_api)@message("no module_api")@' HIP-Basi %{_bindir}/* %changelog +* Fri Oct 31 2025 Tom Rix - 7.1.0-1 +- Update to 7.1.0 + * Sat Oct 11 2025 Tom Rix - 7.0.2-1 - Update to 7.0.2 diff --git a/sources b/sources index 3362190..f97ee77 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (rocm-examples-7.0.2.tar.gz) = 8c04b5d9801c3c0d2c023feecb21674bc5888edd55a62ff29f08dc5093a29fc61c2e9c292ec6dd8382e334929315cfd7f679eb68034fd443ced255b710b79a46 +SHA512 (rocm-examples-7.1.0.tar.gz) = 905261202d04896a737730f69b383f7d44557d287c90f36144ac8a421ebd104a7d884cce607058e735da80f7ce2a2509eaec0c84d9ca513de6ca18424e049a71 From 0f144a8d07777c3ac4b8faa3d822c488b5f47bc5 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Wed, 31 Dec 2025 07:59:27 -0800 Subject: [PATCH 5/5] Add --with compat Signed-off-by: Tom Rix --- rocm-examples.spec | 81 +++++++++++++++++++++++++++++++++------------- 1 file changed, 58 insertions(+), 23 deletions(-) diff --git a/rocm-examples.spec b/rocm-examples.spec index 1e7fdf5..1278ae5 100644 --- a/rocm-examples.spec +++ b/rocm-examples.spec @@ -24,6 +24,19 @@ %global rocm_patch 0 %global rocm_version %{rocm_release}.%{rocm_patch} +%bcond_with compat +%if %{with compat} +%global pkg_libdir lib +%global pkg_prefix %{_prefix}/lib64/rocm/rocm-%{rocm_release} +%global pkg_suffix -%{rocm_release} +%global pkg_module rocm%{pkg_suffix} +%else +%global pkg_libdir %{_lib} +%global pkg_prefix %{_prefix} +%global pkg_suffix %{nil} +%global pkg_module default +%endif + %global toolchain rocm # hipcc does not support some clang flags @@ -44,9 +57,14 @@ %global _source_payload w7T0.xzdio %global _binary_payload w7T0.xzdio -Name: rocm-examples +# some example cmake's do not like :xnack suffix +# reduce the default list +%global gpu_list %rocm_gpu_list_test +%global _gpu_list gfx1100 + +Name: rocm-examples%{pkg_suffix} Version: %{rocm_version} -Release: 1%{?dist} +Release: 2%{?dist} Summary: A collection of examples for the ROCm software stack Url: https://github.com/ROCm/%{upstreamname} License: MIT AND Apache-2.0 @@ -60,21 +78,22 @@ Source0: %{url}/archive/rocm-%{version}.tar.gz#/%{upstreamname}-%{version BuildRequires: cmake BuildRequires: gcc-c++ -BuildRequires: hipblas-devel -BuildRequires: hipcub-devel -BuildRequires: hipfft-devel -BuildRequires: hipify -BuildRequires: hiprand-devel -BuildRequires: hipsolver-devel -BuildRequires: rocm-comgr-devel -BuildRequires: rocm-hip-devel -BuildRequires: rocm-runtime-devel -BuildRequires: rocm-rpm-macros -BuildRequires: rocblas-devel -BuildRequires: rocfft-devel -BuildRequires: rocsolver-devel -BuildRequires: rocsparse-devel -BuildRequires: rocthrust-devel +BuildRequires: hipblas%{pkg_suffix}-devel +BuildRequires: hipcub%{pkg_suffix}-devel +BuildRequires: hipfft%{pkg_suffix}-devel +BuildRequires: hipify%{pkg_suffix} +BuildRequires: hiprand%{pkg_suffix}-devel +BuildRequires: hipsolver%{pkg_suffix}-devel +BuildRequires: rocm-comgr%{pkg_suffix}-devel +BuildRequires: rocm-compilersupport%{pkg_suffix}-macros +BuildRequires: rocm-hip%{pkg_suffix}-devel +BuildRequires: rocm-runtime%{pkg_suffix}-devel +BuildRequires: rocm-rpm-macros%{pkg_suffix} +BuildRequires: rocblas%{pkg_suffix}-devel +BuildRequires: rocfft%{pkg_suffix}-devel +BuildRequires: rocsolver%{pkg_suffix}-devel +BuildRequires: rocsparse%{pkg_suffix}-devel +BuildRequires: rocthrust%{pkg_suffix}-devel %if 0%{?suse_version} BuildRequires: benchmark-devel @@ -121,10 +140,10 @@ rm -rf External/{glad,KHR} # https://github.com/ROCm/rocm-examples/issues/217 for f in `find . -name 'CMakeLists.txt'`; do - sed -i -e 's@opt/rocm@usr@' $f + sed -i -e 's@/opt/rocm@%{pkg_prefix}@' $f done for f in `find . -name 'Makefile'`; do - sed -i -e 's@opt/rocm@usr@' $f + sed -i -e 's@/opt/rocm@%{pkg_prefix}@' $f done # On SLE 15.6 @@ -137,11 +156,24 @@ sed -i -e 's@add_subdirectory(module_api)@message("no module_api")@' HIP-Basi %endif %endif +# Some custom commands need to use hip_flags +sed -i -e 's@${CMAKE_HIP_COMPILER}@${CMAKE_HIP_COMPILER} -I%{pkg_prefix}/include@' HIP-Basic/llvm_ir_to_executable/CMakeLists.txt + %build + +export ROCM_ROOT=%{pkg_prefix} + %cmake \ - -DCMAKE_CXX_COMPILER=hipcc \ - -DCMAKE_HIP_ARCHITECTURES=%{rocm_gpu_list_default} \ - -DAMDGPU_TARGETS=%{rocm_gpu_list_default} \ + -DCMAKE_C_COMPILER=%rocmllvm_bindir/amdclang \ + -DCMAKE_CXX_COMPILER=%rocmllvm_bindir/amdclang++ \ + -DCMAKE_CXX_FLAGS="-I %{pkg_prefix}/include" \ + -DCMAKE_INSTALL_LIBDIR=%{pkg_libdir} \ + -DCMAKE_INSTALL_PREFIX=%{pkg_prefix} \ + -DCMAKE_HIP_ARCHITECTURES=%{gpu_list} \ + -DCMAKE_HIP_COMPILER=%rocmllvm_bindir/amdclang++ \ + -DCMAKE_HIP_COMPILER_ROCM_ROOT=%{pkg_prefix} \ + -DCMAKE_HIP_FLAGS="-I %{pkg_prefix}/include" \ + -DGPU_TARGETS=%{gpu_list} \ -DCMAKE_BUILD_TYPE=%{build_type} \ -DHIP_PLATFORM=amd @@ -153,9 +185,12 @@ sed -i -e 's@add_subdirectory(module_api)@message("no module_api")@' HIP-Basi %files %license LICENSE.md %doc README.md -%{_bindir}/* +%{pkg_prefix}/bin/* %changelog +* Wed Dec 24 2025 Tom Rix - 7.1.0-2 +- Add --with compat + * Fri Oct 31 2025 Tom Rix - 7.1.0-1 - Update to 7.1.0