SHA256
1
0
forked from ROCm/hipblaslt

1 Commits
fixes ... main

Author SHA256 Message Date
8a82d7908e Make package build on SUSE
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-30 09:49:31 +02:00

View File

@@ -4,12 +4,15 @@
%global hipblaslt_name hipblaslt
%endif
%if 0%{?suse_version}
%{?sle15_python_module_pythons}
%{?!python_module:%define python_module() python3-%{**}}
%{!?python_exec: %define python_exec python3}
%if 0%{?python_flavor:1}
%define rocm_python_bin %{expand:%{__%python_flavor}}
%else
%define python_exec python3
%define python_expand python3
%define rocm_python_bin python3
%endif
%if 0%{?sle_version} > 160000
ExclusiveArch: do_not_build
%endif
%global upstreamname hipBLASLt
@@ -71,7 +74,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
@@ -113,7 +116,12 @@ 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_ninja:BuildRequires: ninja}
%else # %suse_version
BuildRequires: python3-devel
BuildRequires: python3dist(setuptools)
BuildRequires: python3dist(pyyaml)
@@ -202,7 +210,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 +225,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
@@ -236,7 +245,7 @@ sed -i -e '/joblib/d' tensilelite/requirements.*
cd tensilelite
TL=$PWD
%python_exec setup.py install --root $TL
%{python_exec} setup.py install --root $TL
cd ..
# Should not have to do this
@@ -249,13 +258,9 @@ export TENSILE_ROCM_OFFLOAD_BUNDLER_PATH=${CLANG_PATH}/clang-offload-bundler
# Look for the just built tensilelite
export PATH=${TL}/%{_bindir}:$PATH
%if 0%{?suse_version}
%{python_expand} export PYTHONPATH=${TL}%{python_sitelib}:$PYTHONPATH
%{python_expand} export Tensile_DIR=${TL}%{python_sitelib}/Tensile
%else
export PYTHONPATH=${TL}%{python3_sitelib}:$PYTHONPATH
export Tensile_DIR=${TL}%{python3_sitelib}/Tensile
%endif
%{?python_expand} export PYTHONPATH=${TL}%{python3_sitelib}:$PYTHONPATH
%{?python_expand} export Tensile_DIR=${TL}%{python3_sitelib}/Tensile
export LLVM_DIR=%{rocmllvm_cmakedir}
# Uncomment and see if the path is sane
# TensileGetPath
@@ -278,9 +283,7 @@ export Tensile_DIR=${TL}%{python3_sitelib}/Tensile
-DTensile_LIBRARY_FORMAT=msgpack \
-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 +318,12 @@ fi
%endif
%changelog
* Tue Jun 17 2025 Egbert Eich <eich@suse.com> - 6.4.1-5
- 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 +332,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