Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f6aa29ef5b |
@@ -0,0 +1,80 @@
|
||||
From: Egbert Eich <eich@suse.com>
|
||||
Date: Wed Apr 30 16:18:49 2025 +0200
|
||||
Subject: Modify CMakeLists.txt files to allow to build modules independently
|
||||
Patch-mainline: Not yet
|
||||
Git-commit: f4724507a2770b2ed5ecc633aa406ad70a675e6f
|
||||
References:
|
||||
|
||||
Signed-off-by: Egbert Eich <eich@suse.com>
|
||||
Signed-off-by: Egbert Eich <eich@suse.de>
|
||||
---
|
||||
library/src/CMakeLists.txt | 24 +++++-------------------
|
||||
library/src/TensileInstall/CMakeLists.txt | 19 +++++++++++++++++++
|
||||
2 files changed, 24 insertions(+), 19 deletions(-)
|
||||
diff --git a/library/src/CMakeLists.txt b/library/src/CMakeLists.txt
|
||||
index 35342e1..efa732c 100644
|
||||
--- a/library/src/CMakeLists.txt
|
||||
+++ b/library/src/CMakeLists.txt
|
||||
@@ -97,7 +97,9 @@ if( BUILD_WITH_TENSILE )
|
||||
set_target_properties( TensileHost PROPERTIES OUTPUT_NAME rocblas-tensile CXX_EXTENSIONS NO )
|
||||
|
||||
# Tensile host depends on libs build target
|
||||
- add_dependencies( TensileHost TENSILE_LIBRARY_TARGET )
|
||||
+ if(NOT DEFINED ENV{TENSILE_SKIP_LIBRARY} OR NOT $ENV{TENSILE_SKIP_LIBRARY})
|
||||
+ add_dependencies( TensileHost TENSILE_LIBRARY_TARGET )
|
||||
+ endif()
|
||||
|
||||
if( ROCBLAS_SHARED_LIBS )
|
||||
set( BUILD_SHARED_LIBS ON )
|
||||
@@ -823,24 +825,8 @@ rocm_install_targets(
|
||||
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
-if( BUILD_WITH_TENSILE )
|
||||
- if (WIN32)
|
||||
- set( ROCBLAS_TENSILE_LIBRARY_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}/bin/rocblas" CACHE PATH "path to tensile library" )
|
||||
- else()
|
||||
- set( ROCBLAS_TENSILE_LIBRARY_DIR "${CMAKE_INSTALL_LIBDIR}/rocblas" CACHE PATH "path to tensile library" )
|
||||
- endif()
|
||||
- # For ASAN package, Tensile library files(which are not shared libraries) are not required
|
||||
- if( NOT ENABLE_ASAN_PACKAGING )
|
||||
- if( BUILD_SHARED_LIBS )
|
||||
- set( TENSILE_DATA_COMPONENT_NAME ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} )
|
||||
- else()
|
||||
- set( TENSILE_DATA_COMPONENT_NAME devel )
|
||||
- endif()
|
||||
- rocm_install(
|
||||
- DIRECTORY ${CMAKE_BINARY_DIR}/Tensile/library
|
||||
- DESTINATION ${ROCBLAS_TENSILE_LIBRARY_DIR}
|
||||
- COMPONENT ${TENSILE_DATA_COMPONENT_NAME}) # Use this cmake variable to be compatible with rocm-cmake 0.6 and 0.7
|
||||
- endif()
|
||||
+if(NOT DEFINED ENV{TENSILE_SKIP_LIBRARY} OR NOT $ENV{TENSILE_SKIP_LIBRARY})
|
||||
+ add_subdirectory( TensileInstall )
|
||||
endif()
|
||||
|
||||
if(NOT WIN32)
|
||||
diff --git a/library/src/TensileInstall/CMakeLists.txt b/library/src/TensileInstall/CMakeLists.txt
|
||||
new file mode 100644
|
||||
index 0000000..fa39e9f
|
||||
--- /dev/null
|
||||
+++ b/library/src/TensileInstall/CMakeLists.txt
|
||||
@@ -0,0 +1,19 @@
|
||||
+if( BUILD_WITH_TENSILE )
|
||||
+ if (WIN32)
|
||||
+ set( ROCBLAS_TENSILE_LIBRARY_DIR "\${CPACK_PACKAGING_INSTALL_PREFIX}/bin/rocblas" CACHE PATH "path to tensile library" )
|
||||
+ else()
|
||||
+ set( ROCBLAS_TENSILE_LIBRARY_DIR "${CMAKE_INSTALL_LIBDIR}/rocblas" CACHE PATH "path to tensile library" )
|
||||
+ endif()
|
||||
+ # For ASAN package, Tensile library files(which are not shared libraries) are not required
|
||||
+ if( NOT ENABLE_ASAN_PACKAGING )
|
||||
+ if( BUILD_SHARED_LIBS )
|
||||
+ set( TENSILE_DATA_COMPONENT_NAME ${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME} )
|
||||
+ else()
|
||||
+ set( TENSILE_DATA_COMPONENT_NAME devel )
|
||||
+ endif()
|
||||
+ rocm_install(
|
||||
+ DIRECTORY ${CMAKE_BINARY_DIR}/Tensile/library
|
||||
+ DESTINATION ${ROCBLAS_TENSILE_LIBRARY_DIR}
|
||||
+ COMPONENT ${TENSILE_DATA_COMPONENT_NAME}) # Use this cmake variable to be compatible with rocm-cmake 0.6 and 0.7
|
||||
+ endif()
|
||||
+endif()
|
||||
64
rocblas.spec
64
rocblas.spec
@@ -9,6 +9,15 @@
|
||||
%global rocm_patch 2
|
||||
%global rocm_version %{rocm_release}.%{rocm_patch}
|
||||
|
||||
%if 0%{?suse_version}
|
||||
# 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 build_tensile_separately 0
|
||||
%endif
|
||||
|
||||
%global toolchain rocm
|
||||
# hipcc does not support some clang flags
|
||||
%global build_cxxflags %(echo %{optflags} | sed -e 's/-fstack-protector-strong/-Xarch_host -fstack-protector-strong/' -e 's/-fcf-protection/-Xarch_host -fcf-protection/' -e 's/-mtls-dialect=gnu2//')
|
||||
@@ -28,7 +37,7 @@
|
||||
%endif
|
||||
|
||||
%bcond_with test
|
||||
%if %{with test}
|
||||
%if %{with test} && %{without tensile_package}
|
||||
%global build_test ON
|
||||
%global __brp_check_rpaths %{nil}
|
||||
%else
|
||||
@@ -124,7 +133,7 @@
|
||||
|
||||
Name: %{rocblas_name}
|
||||
Version: %{rocm_version}
|
||||
Release: 4%{?dist}
|
||||
Release: 5%{?dist}
|
||||
Summary: BLAS implementation for ROCm
|
||||
Url: https://github.com/ROCmSoftwarePlatform/%{upstreamname}
|
||||
License: MIT AND BSD-3-Clause
|
||||
@@ -132,9 +141,21 @@ License: MIT AND BSD-3-Clause
|
||||
Source0: %{url}/archive/refs/tags/rocm-%{rocm_version}.tar.gz#/%{upstreamname}-%{rocm_version}.tar.gz
|
||||
Source1: rocblas.rpmlintrc
|
||||
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%{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
|
||||
BuildRequires: rocblas-tensile = %version
|
||||
%endif
|
||||
%endif
|
||||
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: rocm-cmake
|
||||
@@ -228,7 +249,14 @@ Provides: rocblas-devel = %{version}-%{release}
|
||||
%description devel
|
||||
%{summary}
|
||||
|
||||
%if %{with test}
|
||||
%package -n rocblas-tensile
|
||||
Summary: ROCBlas Tensile Modules
|
||||
Requires: %{name} = %version
|
||||
|
||||
%description -n rocblas-tensile
|
||||
BLAS architecture modules for all AMDGPU architectures
|
||||
|
||||
%if %{with test} && %{without tensile_package}
|
||||
%package test
|
||||
Summary: Tests for %{name}
|
||||
Requires: diffutils
|
||||
@@ -284,21 +312,30 @@ if [ ${CORES} = 1 ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
%if %{build_tensile_separately} && %{without tensile_package}
|
||||
export TENSILE_SKIP_LIBRARY=true
|
||||
%endif
|
||||
|
||||
%cmake %{cmake_generator} %{cmake_config} \
|
||||
-DGPU_TARGETS=%{gpu_list} \
|
||||
-DBUILD_WITH_TENSILE=%{build_tensile} \
|
||||
-DCMAKE_INSTALL_LIBDIR=%_libdir \
|
||||
|
||||
%cmake_build
|
||||
%cmake_build %{?with_tensile_package:TENSILE_LIBRARY_TARGET}
|
||||
|
||||
%install
|
||||
%if %{with tensile_package}
|
||||
DESTDIR=%{buildroot} /usr/bin/cmake -P build/library/src/TensileInstall/cmake_install.cmake
|
||||
%else
|
||||
%cmake_install
|
||||
|
||||
if [ -f %{buildroot}%{_prefix}/share/doc/rocblas/LICENSE.md ]; then
|
||||
rm %{buildroot}%{_prefix}/share/doc/rocblas/LICENSE.md
|
||||
fi
|
||||
%endif
|
||||
|
||||
%check
|
||||
%if %{without tensile_package}
|
||||
%if %{with test}
|
||||
%if %{with check}
|
||||
%if 0%{?suse_version}
|
||||
@@ -310,16 +347,20 @@ export LD_LIBRARY_PATH=%{_vpath_builddir}/library/src:$LD_LIBRARY_PATH
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%if %{without tensile_package}
|
||||
%files
|
||||
%license LICENSE.md
|
||||
%{_libdir}/librocblas.so.4{,.*}
|
||||
%if %{with tensile}
|
||||
%if ! %{build_tensile_separately}
|
||||
%dir %{_libdir}/rocblas
|
||||
%dir %{_libdir}/rocblas/library
|
||||
%{_libdir}/rocblas/library/Kernels*
|
||||
%{_libdir}/rocblas/library/Tensile*
|
||||
%endif
|
||||
%endif # with tensile
|
||||
|
||||
%files devel
|
||||
%doc README.md
|
||||
@@ -334,6 +375,18 @@ export LD_LIBRARY_PATH=%{_vpath_builddir}/library/src:$LD_LIBRARY_PATH
|
||||
%{_bindir}/rocblas*
|
||||
%endif
|
||||
|
||||
%else # ?tensile_package
|
||||
|
||||
%if %{with tensile}
|
||||
%files -n rocblas-tensile
|
||||
%dir %{_libdir}/rocblas
|
||||
%dir %{_libdir}/rocblas/library
|
||||
%{_libdir}/rocblas/library/Kernels*
|
||||
%{_libdir}/rocblas/library/Tensile*
|
||||
%endif
|
||||
|
||||
%endif # ?tensile_package
|
||||
|
||||
%changelog
|
||||
* Fri Aug 1 2025 Egbert Eich <eich@suse.com> - 6.4.2-5
|
||||
- Fix build and runtime dependencies of test package.
|
||||
@@ -343,6 +396,9 @@ export LD_LIBRARY_PATH=%{_vpath_builddir}/library/src:$LD_LIBRARY_PATH
|
||||
- Enable msgpack on SUSE, restructure build requires and build settings.
|
||||
- Consoldiate Python module BuildRequires for SUSE.
|
||||
- Restructure tensile verbosity option.
|
||||
- Build and package core library and arch dependent
|
||||
tensile modules separately to parallelize the build.
|
||||
Add: Modify-CMakeLists.txt-files-to-allow-to-build-modules-independently.patch
|
||||
|
||||
* Tue Jul 29 2025 Tom Rix <Tom.Rix@amd.com> - 6.4.2-4
|
||||
- Remove -mtls-dialect cflag
|
||||
|
||||
Reference in New Issue
Block a user