SHA256
1
0
forked from ROCm/rocblas

7 Commits

Author SHA256 Message Date
1bfcab0293 Use distro specific macros to hide some distribution differences
Signed-off-by: Egbert Eich <eich@suse.com>
2025-07-03 18:08:21 +02:00
216f9d4756 Consolidate python dependencies for SUSE
Signed-off-by: Egbert Eich <eich@suse.com>
2025-07-03 18:08:21 +02:00
2a13359556 Add conditional for tensile library format
Signed-off-by: Egbert Eich <eich@suse.com>
2025-07-03 18:08:21 +02:00
669d97c4e6 Add rpmlintrc
This suppresses errors incorrectly generated for tensile modules.

Signed-off-by: Egbert Eich <eich@suse.com>
2025-07-03 18:08:21 +02:00
9d12c41c8a Restructure spec file
Move bcond_with* settings to the top.

Signed-off-by: Egbert Eich <eich@suse.com>
2025-07-03 18:08:21 +02:00
67a6c9e2bc Fix build and runtime dependencies of test package
Signed-off-by: Egbert Eich <eich@suse.com>
2025-07-03 18:08:21 +02:00
3a6378ba01 Split builds for core library and tensile modules
Build and package core library and arch dependent
tensile modules separately to parallelize the build.

Signed-off-by: Egbert Eich <eich@suse.com>
2025-07-03 18:08:21 +02:00
2 changed files with 31 additions and 42 deletions

3
rocblas.rpmlintrc Normal file
View File

@@ -0,0 +1,3 @@
# librocblas4-arch-.* are no shared libraries but modules loaded onto the GPU.
addFilter("rocblas-arch-.*: W: shared-lib-without-dependency-information")
addFilter("rocblas-arch-.*: E: shlib-fixed-dependency.")

View File

@@ -6,16 +6,12 @@
%{rocm_set_libpackage_name rocblas -s 4}
%if 0%{?suse_version}
# OBS replaces @BUILD_FLAVOR@ by each value of 'package'
# in the file _multibuild resulting in a separate build.
%global flavor @BUILD_FLAVOR@%{?nil}
%if "%{?flavor}" != ""
%define _flavor %{flavor}
%define __flavor %(a=%flavor; a=${a/_minus/-}; a=${a/_plus/+}; echo ${a/_/:})
%endif
%define use_flavors 1
# On SUSE build the .so module only - tensile modules are built in a separate package
%bcond_with tensile_package
%define build_tensile_separately 1
%else
%define use_flavors 0
%define build_tensile_separately 0
%endif
%global toolchain rocm
@@ -37,7 +33,7 @@
%endif
%bcond_with test
%if %{with test} && 0%{!?_flavor:1}
%if %{with test} && %{without tensile_package}
%global build_test ON
%global __brp_check_rpaths %{nil}
%else
@@ -120,15 +116,11 @@
%bcond_with generic
%global rocm_gpu_list_generic "gfx9-generic;gfx9-4-generic;gfx10-1-generic;gfx10-3-generic;gfx11-generic;gfx12-generic"
%if 0%{!?_flavor:1} || "%{?_flavor}" == "all"
%if %{with generic}
%global gpu_list %{rocm_gpu_list_generic}
%else
%global gpu_list %{rocm_gpu_list_default}
%endif
%else
%global gpu_list %_flavor
%endif
# gfx950 is an experimental target
# Enabling will short circuit the normal build.
@@ -139,7 +131,7 @@
# $ module purge
%bcond_with gfx950
%if %{with gfx950} && 0%{?_flavor:1}
%if %{with gfx950} && %{with tensile_package}
ExclusiveArch: do_not_build
%endif
@@ -152,24 +144,19 @@ License: MIT AND BSD-3-Clause
Source0: %{url}/archive/refs/tags/rocm-%{rocm_version}.tar.gz#/%{upstreamname}-%{rocm_version}.tar.gz
Source1: rocblas.rpmlintrc
Source2: _multibuild
Patch2: 0001-fixup-install-of-tensile-output.patch
Patch3: Modify-CMakeLists.txt-files-to-allow-to-build-modules-independently.patch
Patch4: 0001-offload-compress-option.patch
Patch6: 0001-option-to-disable-roctracer-logging.patch
%if 0%{use_flavors}
%(for i in `sed -ne "/package/s@ *<package>\([^<]*\)</package>@\1@p" %{S:2}`;\
do echo "Requires: rocblas-tensile-$i = %version";\
done)
%if 0%{build_tensile_separately}
Requires: rocblas-tensile = %version
%if %{with check}
# If %check is enabled, we need to serialize the builds which will introduce
# a circular dependency. The flag below causes OBS to ignore this.
#
#!BuildIgnore: %name
%(for i in `sed -ne "/package/s@ *<package>\([^<]*\)</package>@\1@p" %{S:2}`;\
do echo "BuildRequires: rocblas-tensile-$i = %version";\
done)
BuildRequires: rocblas-tensile = %version
%endif
%endif
BuildRequires: cmake
@@ -184,11 +171,9 @@ BuildRequires: rocm-rpm-macros-modules
%if %{with tensile}
%if 0%{?suse_version}
BuildRequires: %{python_module tensile-devel}
%if %{suse_version} < 1699
BuildRequires: python3-tensile-devel
BuildRequires: python3-joblib
%else # suse_version 1699
BuildRequires: python311-tensile-devel
BuildRequires: %{python_module joblib}
%endif # suse_version < 1699
%{?with_msgpack:BuildRequires: msgpack-cxx-devel}
%else # ?suse_version
@@ -248,12 +233,12 @@ Provides: rocblas-devel = %{version}-%{release}
%description devel
%{summary}
%package -n rocblas-tensile-%{?_flavor}
Summary: ROCBlas Tensile Module for %{?__flavor} Architecture
%package -n rocblas-tensile
Summary: ROCBlas Tensile Modules
Requires: %{name} = %version
%description -n rocblas-tensile-%{?_flavor}
BLAS architecture modules for %{?__flavor} AMDGPU architectures
%description -n rocblas-tensile
BLAS architecture modules for all AMDGPU architectures
%if %{with test}
%package test
@@ -284,7 +269,7 @@ Conflicts: %{name}-devel
%description gfx950-devel
%{summary}
%if %{with test} && 0%{!?_flavor:1}
%if %{with test} && %{without tensile_package}
%package gfx950-test
Summary: The gfx950 rocBLAS test package
Requires: %{name}-gfx950%{?_isa} = %{version}-%{release}
@@ -355,7 +340,7 @@ module load rocm/gfx950
%else
%if %use_flavors && 0%{!?_flavor:1}
%if %{build_tensile_separately} && %{without tensile_package}
export TENSILE_SKIP_LIBRARY=true
%endif
@@ -366,13 +351,13 @@ export TENSILE_SKIP_LIBRARY=true
%endif
%cmake_build %{?_flavor:TENSILE_LIBRARY_TARGET}
%cmake_build %{?with_tensile_package:TENSILE_LIBRARY_TARGET}
%if %{with gfx950}
module purge
%endif
%install
%if 0%{?_flavor:1}
%if %{with tensile_package}
DESTDIR=%{buildroot} /usr/bin/cmake -P build/library/src/TensileInstall/cmake_install.cmake
%else
%cmake_install
@@ -383,7 +368,7 @@ fi
%endif
%check
%if 0%{!?flavor:1}
%if %{without tensile_package}
%if %{with test}
%if %{with check}
export LD_LIBRARY_PATH=%{rocm_builddir}/library/src:$LD_LIBRARY_PATH
@@ -411,12 +396,12 @@ export LD_LIBRARY_PATH=%{rocm_builddir}/library/src:$LD_LIBRARY_PATH
%else
%if 0%{!?_flavor:1}
%if %{without tensile_package}
%files
%license LICENSE.md
%{_libdir}/librocblas.so.4{,.*}
%if %{with tensile}
%if ! %{?use_flavors}
%if ! %{build_tensile_separately}
%dir %{_libdir}/rocblas
%dir %{_libdir}/rocblas/library
%{_libdir}/rocblas/library/Kernels*
@@ -437,17 +422,17 @@ export LD_LIBRARY_PATH=%{rocm_builddir}/library/src:$LD_LIBRARY_PATH
%{_bindir}/rocblas*
%endif
%else # ?_flavor
%else # ?tensile_package
%if %{with tensile}
%files -n rocblas-tensile-%{?_flavor}
%files -n rocblas-tensile
%dir %{_libdir}/rocblas
%dir %{_libdir}/rocblas/library
%{_libdir}/rocblas/library/Kernels*
%{_libdir}/rocblas/library/Tensile*
%endif
%endif # ?_flavor
%endif # ?tensile_package
%endif # gfx950
%changelog
@@ -455,9 +440,10 @@ export LD_LIBRARY_PATH=%{rocm_builddir}/library/src:$LD_LIBRARY_PATH
- Build and package core library and arch dependent
tensile modules separately to parallelize the build.
- Fix build and runtime dependencies of test package.
- Use distro specific macros to hide some distribution differences.
- Restructure spec file (move bcond_with* settings to
the top).
- Add rpmlintrc for SUSE.
- Use distro specific macros to hide some distribution differences.
* Wed Jun 11 2025 Tom Rix <Tom.Rix@amd.com> - 6.4.0-8
- Remove suse check for using ldconfig