## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 7; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %global upstreamname rocBLAS %global rocm_release 6.2 %global rocm_patch 1 %global rocm_version %{rocm_release}.%{rocm_patch} %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/') # $gpu will be evaluated in the loops below %global _vpath_builddir %{_vendor}-%{_target_os}-build-${gpu} %bcond_without debug %if %{with debug} %global build_type DEBUG %else %global build_type RELEASE %endif %bcond_without compress %if %{with compress} %global build_compress ON %else %global build_compress OFF %endif %bcond_with test %if %{with test} %global build_test ON %global __brp_check_rpaths %{nil} %else %global build_test OFF %endif %if 0%{?rhel} # RHEL does not have a working tensile %bcond_with tensile %else %bcond_without tensile %endif %if %{with tensile} %global build_tensile ON %else %global build_tensile OFF %endif %if 0%{?rhel} && 0%{?rhel} < 10 # On CS9: /usr/bin/debugedit: Cannot handle 8-byte build ID %global debug_package %{nil} %endif Name: rocblas Version: %{rocm_version} %if 0%{?rhel} && 0%{?rhel} < 10 Release: 1%{?dist} %else Release: %autorelease %endif Summary: BLAS implementation for ROCm Url: https://github.com/ROCmSoftwarePlatform/%{upstreamname} License: MIT AND BSD-3-Clause Source0: %{url}/archive/refs/tags/rocm-%{rocm_version}.tar.gz#/%{upstreamname}-%{rocm_version}.tar.gz Patch2: 0001-fixup-install-of-tensile-output.patch Patch3: 0001-add-gfx1103-support-for-rocBLAS.patch Patch4: 0001-offload-compress-option.patch BuildRequires: cmake BuildRequires: git BuildRequires: rocm-cmake BuildRequires: rocm-comgr-devel BuildRequires: rocm-hip-devel BuildRequires: rocm-runtime-devel BuildRequires: rocm-rpm-macros BuildRequires: rocm-rpm-macros-modules %if %{with tensile} BuildRequires: msgpack-devel BuildRequires: python-tensile %endif %if %{with compress} BuildRequires: pkgconfig(libzstd) %endif %if %{with test} BuildRequires: gtest-devel BuildRequires: blas-devel BuildRequires: libomp-devel BuildRequires: python3-pyyaml BuildRequires: rocminfo BuildRequires: rocm-smi-devel %endif Requires: rocm-rpm-macros-modules # Only x86_64 works right now: ExclusiveArch: x86_64 %description rocBLAS is the AMD library for Basic Linear Algebra Subprograms (BLAS) on the ROCm platform. It is implemented in the HIP programming language and optimized for AMD GPUs. %package devel Summary: Libraries and headers for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel %{summary} %if %{with test} %package test Summary: Tests for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description test %{summary} %endif %prep %autosetup -p1 -n %{upstreamname}-rocm-%{version} sed -i -e 's@set( BLAS_LIBRARY "blas" )@set( BLAS_LIBRARY "cblas" )@' clients/CMakeLists.txt sed -i -e 's@target_link_libraries( rocblas-test PRIVATE ${BLAS_LIBRARY} ${GTEST_BOTH_LIBRARIES} roc::rocblas )@target_link_libraries( rocblas-test PRIVATE cblas ${GTEST_BOTH_LIBRARIES} roc::rocblas )@' clients/gtest/CMakeLists.txt %build # With compat llvm the system clang is wrong CLANG_PATH=`hipconfig --hipclangpath` export TENSILE_ROCM_ASSEMBLER_PATH=${CLANG_PATH}/clang++ export TENSILE_ROCM_OFFLOAD_BUNDLER_PATH=${CLANG_PATH}/clang-offload-bundler # Work around problem with koji's ld export HIPCC_LINK_FLAGS_APPEND=-fuse-ld=lld for gpu in %{rocm_gpu_list} do module load rocm/$gpu %cmake \ -DCMAKE_BUILD_TYPE=%{build_type} \ -DCMAKE_SKIP_RPATH=ON \ -DBUILD_FILE_REORG_BACKWARD_COMPATIBILITY=OFF \ -DROCM_SYMLINK_LIBS=OFF \ -DHIP_PLATFORM=amd \ -DAMDGPU_TARGETS=${ROCM_GPUS} \ -DCMAKE_INSTALL_LIBDIR=$ROCM_LIB \ -DCMAKE_INSTALL_BINDIR=$ROCM_BIN \ -DBUILD_CLIENTS_BENCHMARKS=%{build_test} \ -DBUILD_CLIENTS_TESTS=%{build_test} \ -DBUILD_CLIENTS_TESTS_OPENMP=OFF \ -DBUILD_FORTRAN_CLIENTS=OFF \ -DBLAS_LIBRARY=cblas \ -DBUILD_OFFLOAD_COMPRESS=%{build_compress} \ -DBUILD_WITH_TENSILE=%{build_tensile} \ -DBUILD_WITH_PIP=OFF %cmake_build module purge done %install for gpu in %{rocm_gpu_list} do %cmake_install done echo s@%{buildroot}@@ > br.sed find %{buildroot}%{_libdir} -name '*.so.*.[0-9]' | sed -f br.sed > %{name}.files find %{buildroot}%{_libdir} -name '*.so.[0-9]' | sed -f br.sed >> %{name}.files find %{buildroot}%{_libdir} -name 'library' | sed -f br.sed >> %{name}.files find %{buildroot}%{_libdir} -name '*.so' | sed -f br.sed > %{name}.devel find %{buildroot}%{_libdir} -name '*.cmake' | sed -f br.sed >> %{name}.devel find %{buildroot} -name 'rocblas-*' | sed -f br.sed > %{name}.test find %{buildroot} -name 'rocblas_*' | sed -f br.sed >> %{name}.test %files -f %{name}.files %license LICENSE.md %exclude %{_docdir}/%{name}/LICENSE.md %files devel -f %{name}.devel %doc README.md %{_includedir}/%{name} %if %{with test} %files test -f %{name}.test %endif %changelog ## START: Generated by rpmautospec * Fri Nov 01 2024 Tom Rix - 6.2.1-7 - Remove ninja * Wed Oct 30 2024 Tom Rix - 6.2.1-6 - Disable tensile for rhel * Tue Oct 29 2024 Tom Rix - 6.2.1-5 - Enable tensile * Thu Oct 10 2024 Tom Rix - 6.2.1-4 - Fixes for RHEL 9 * Mon Oct 07 2024 Tom Rix - 6.2.1-3 - Turn off tensiling * Fri Sep 27 2024 Tom Rix - 6.2.1-2 - Offload compress option * Wed Sep 25 2024 Tom Rix - 6.2.1-1 - Update to 6.2.1 * Sat Sep 14 2024 Tom Rix - 6.2.0-3 - Generate file lists * Mon Aug 12 2024 Tom Rix - 6.2.0-2 - Build with Tensile * Sun Aug 11 2024 Tom Rix - 6.2.0-1 - Update for ROCm 6.2 * Fri Jul 19 2024 Fedora Release Engineering - 6.1.2-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Sun Jul 14 2024 Tom Rix - 6.1.2-2 - Tensile is broken on RHEL * Thu Jun 06 2024 Jeremy Newton - 6.1.2-1 - Update to 6.1.2 * Sun May 19 2024 Tom Rix - 6.1.1-2 - Fix devel * Fri May 17 2024 Tom Rix - 6.1.1-1 - Update for 6.1.1 * Thu Apr 04 2024 Tom Rix - 6.0.2-4 - Add experimental build for gfx1103 * Sat Mar 16 2024 Tom Rix - 6.0.2-3 - Work around a problem with koji's ld * Sat Mar 16 2024 Tom Rix - 6.0.2-2 - Workaround tensile problem * Sun Mar 10 2024 Tom Rix - 6.0.2-1 - Update to 6.0.2 * Fri Jan 26 2024 Fedora Release Engineering - 6.0.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sat Jan 20 2024 Tom Rix - 6.0.0-2 - Enable tensile option * Wed Dec 20 2023 Jeremy Newton - 6.0.0-1 - Update to 6.0 * Sun Oct 22 2023 Tom Rix - 5.7.1-3 - Change url - capitalize AND * Sat Oct 21 2023 Tom Rix - 5.7.1-2 - Fix so location - glob gpu family location * Sun Oct 15 2023 Tom Rix - 5.7.1-1 - Update to 5.7.1 - Use rocm-rpm-macros * Sat Oct 7 2023 Tom Rix - 5.7.0-1 - Update to 5.7 - Use WIP rocm-rpm-macros - Convert to environent modules * Sun Oct 1 2023 Tom Rix - 5.6.0-2 - Split the build into gpu families * Sat Sep 23 2023 Tom Rix - 5.6.0-1 - Update to 5.6 * Tue Jun 6 2023 Tom Rix - 5.5.1-1 - Initial package ## END: Generated by rpmautospec