SHA256
1
0
forked from ROCm/hipblaslt

1 Commits
main ... fixes

Author SHA256 Message Date
96097bcb02 Use distro specific macros to hide some distribution differences.
On SLE-15 exclusively use python 3.6 This is since joblib is
not even available on PackageHub.
Improve tensile format handling - currently, YAML is not
supported by hipblaslt.

Signed-off-by: Egbert Eich <eich@suse.com>
2025-06-24 18:53:58 +02:00

View File

@@ -1,15 +1,15 @@
%if 0%{?suse_version}
%global hipblaslt_name libhipblaslt0
%else
%global hipblaslt_name hipblaslt
%endif
%{rocm_set_libpackage_name hipblaslt -s 0}
%if 0%{?suse_version}
%{?sle15_python_module_pythons}
%{?!python_module:%define python_module() python3-%{**}}
%else
%if 0%{!?suse_version:1}
%define python_exec python3
%define python_expand python3
%define rocm_python_bin python3
%endif
%if 0%{?sle_version} > 160000
ExclusiveArch: do_not_build
%else
%bcond_without msgpack
%endif
%global upstreamname hipBLASLt
@@ -71,7 +71,7 @@
Name: %{hipblaslt_name}
Version: %{rocm_version}
Release: 4%{?dist}
Release: 5%{?dist}
Summary: ROCm general matrix operations beyond BLAS
Url: https://github.com/ROCmSoftwarePlatform/%{upstreamname}
License: MIT
@@ -108,25 +108,30 @@ BuildRequires: zlib-devel
%if 0%{?suse_version}
BuildRequires: python-rpm-macros
BuildRequires: %{python_module joblib}
BuildRequires: %{python_module msgpack}
%{?with_msgpack:BuildRequires: %{python_module msgpack}}
BuildRequires: %{python_module PyYAML}
BuildRequires: %{python_module setuptools}
BuildRequires: msgpack-cxx-devel
%global tensile_verbose 2
%else
BuildRequires: %{python_module dataclasses if %python-base < 3.11}
BuildRequires: %{python_module ujson}
BuildRequires: %{python_module distro}
BuildRequires: %{python_module simplejson}
%{?with_msgpack:BuildRequires: msgpack-cxx-devel}
%{?with_ninja:BuildRequires: ninja}
%else # %suse_version
BuildRequires: python3-devel
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(pyyaml)
%if 0%{?rhel}
%global tensile_verbose 2
%else
%global tensile_verbose 1
%if 0%{!?rhel}
BuildRequires: python3dist(joblib)
%endif
# https://github.com/ROCm/hipBLASLt/issues/1734
%if %{with msgpack}
BuildRequires: python3dist(msgpack)
BuildRequires: msgpack-devel
%endif
%{?with_ninja:BuildRequires: ninja-build}
%endif
%rocm_set_tensile
%if %{with test}
BuildRequires: blas-static
@@ -136,15 +141,7 @@ BuildRequires: gmock-devel
BuildRequires: lapack-static
%endif
%if %{with ninja}
%if 0%{?fedora}
BuildRequires: ninja-build
%endif
%if 0%{?suse_version}
BuildRequires: ninja
%define __builder ninja
%endif
%endif
%rocm_set_ninja
Provides: hipblaslt = %{version}-%{release}
Provides: bundled(python-tensile) = %{tensile_version}
@@ -202,7 +199,8 @@ sed -i -e 's@set(CMAKE_INSTALL_LIBDIR@#set(CMAKE_INSTALL_LIBDIR@' CMakeLists.txt
sed -i -e 's@virtualenv_install@#virtualenv_install@' CMakeLists.txt
# do not mess with prefix path
sed -i -e 's@APPEND CMAKE_PREFIX_PATH@APPEND NO_CMAKE_PREFIX_PATH@' CMakeLists.txt
# Remove orjson from requirements list as fallbacks exist
sed -i -e '/orjson/d' tensilelite/requirements.txt
# For debugging
# set threads to 1
# sed -i -e 's@default=-1@default=1@' tensilelite/Tensile/TensileCreateLibrary.py
@@ -216,13 +214,13 @@ sed -i -e 's@APPEND CMAKE_PREFIX_PATH@APPEND NO_CMAKE_PREFIX_PATH@' C
sed -i -e 's@-lgfortran -lflang -lflangrti@-lgfortran@' clients/gtest/CMakeLists.txt
%endif
%if 0%{?suse_version} >= 1600
%if %{with msgpack} && 0%{?suse_version} >= 1600
sed -i -e 's@msgpack REQUIRED@msgpack-cxx REQUIRED@' tensilelite/Tensile/Source/lib/CMakeLists.txt
%endif
%if 0%{?sle_version} == 150600
sed -i 's@#!/usr/bin/env python3@#!/usr/bin/python3.11@' tensilelite/Tensile/bin/Tensile*
sed -i 's@python3@python3.11@' clients/common/hipblaslt_gentest.py cmake/virtualenv.cmake tensilelite/Tensile/Ops/gen_assembly.sh
%if 0%{?rocm_python_bin:1}
sed -i 's@#!/usr/bin/env python3@#!%rocm_python_bin@' tensilelite/Tensile/bin/Tensile*
sed -i 's@python3@%{basename:%rocm_python_bin}@' clients/common/hipblaslt_gentest.py cmake/virtualenv.cmake tensilelite/Tensile/Ops/gen_assembly.sh
%endif
sed -i 's@find_package(LLVM REQUIRED CONFIG)@find_package(LLVM REQUIRED CONFIG PATHS "%{rocmllvm_cmakedir}")@' tensilelite/Tensile/Source/lib/CMakeLists.txt
@@ -256,6 +254,7 @@ export PATH=${TL}/%{_bindir}:$PATH
export PYTHONPATH=${TL}%{python3_sitelib}:$PYTHONPATH
export Tensile_DIR=${TL}%{python3_sitelib}/Tensile
%endif
export LLVM_DIR=%{rocmllvm_cmakedir}
# Uncomment and see if the path is sane
# TensileGetPath
@@ -275,12 +274,10 @@ export Tensile_DIR=${TL}%{python3_sitelib}/Tensile
-DROCM_SYMLINK_LIBS=OFF \
-DBUILD_WITH_TENSILE=ON \
-DTensile_COMPILER=%{rocmllvm_bindir}/clang++ \
-DTensile_LIBRARY_FORMAT=msgpack \
-DTensile_LIBRARY_FORMAT=%{tensile_library_format} \
-DTensile_VERBOSE=%{tensile_verbose} \
-DVIRTUALENV_BIN_DIR=%{_bindir} \
%if 0%{?sle_version} == 150600
-DPYTHON_EXECUTABLE:FILEPATH=python3.11 \
%endif
%{?rocm_python_bin:-DPYTHON_EXECUTABLE:FILEPATH=%{basename:%rocm_python_bin}} \
%{nil}
%cmake_build
@@ -315,6 +312,13 @@ fi
%endif
%changelog
* Tue Jun 17 2025 Egbert Eich <eich@suse.com> - 6.4.1-5
- Use distro specific macros to hide some distribution differences.
- On SLE-15 exclusively use python 3.6
This is since joblib is not even available on PackageHub
- Improve tensile format handling - currently, YAML is not
supported by hipblaslt.
* Tue Jun 17 2025 Tom Rix <Tom.Rix@amd.com> - 6.4.1-4
- Use Gentoo fix for gfx12*
@@ -323,6 +327,7 @@ fi
* Mon Jun 9 2025 Tom Rix <Tom.Rix@amd.com> - 6.4.1-2
- Fix fedora build dependencies
- Remove suse check for using ldconfig.
* Thu May 22 2025 Jeremy Newton <alexjnewt at hotmail dot com> - 6.4.1-1
- Update to 6.4.1