# Part of ROCM Stack, see rocm-llvm for build order # rocm-cmake # rocm-llvm # rocm-runtime # rocm-core # rocminfo # rocm-amd-opencl #Build Time of this package ~ 0 minutes 58 seconds %if 0%{?suse_version} # 15.6 # rocm-runtime.x86_64: E: shlib-policy-name-error (Badness: 10000) libhsa-runtime64-1 # Your package contains a single shared library but is not named after its SONAME. %global runtime_name libhsa-runtime64-1 %else %global runtime_name rocm%{rocm_release}-runtime %endif %global forge_name rocm-runtime %define libname %mklibname %{runtime_name} %define develname %mklibname %{runtime_name} -d #Image support is x86 only %ifarch x86_64 %global enableimage 1 %endif %global rocm_release 6.4 %global rocm_patch 3 %global rocm_version %{rocm_release}.%{rocm_patch} #Really not build with system tools %bcond_with system_tools Name: rocm-runtime Version: %{rocm_version} Release: %mkrel 1 Summary: ROCm Runtime Library License: NCSA URL: https://github.com/ROCm/ROCR-Runtime Source0: %{url}/archive/rocm-%{version}.tar.gz#/%{forge_name}-%{version}.tar.gz Patch0: rocm-runtime-no-.text-gc.patch Patch1: rocm-runtime-aarch64.patch ExclusiveArch: x86_64 aarch64 BuildRequires: cmake BuildRequires: ninja BuildRequires: pkgconfig(libelf) BuildRequires: pkgconfig(libdrm) BuildRequires: pkgconfig(libdrm_amdgpu) BuildRequires: pkgconfig(libffi) BuildRequires: pkgconfig(numa) %if %{with system_tools} BuildRequires: clang-devel BuildRequires: cmake(LLD) BuildRequires: llvm-devel %else #with rocm-llvm from squidf spec not generate debug info, ??? #define debug_package %{nil} #squidf version #BuildRequires: rocm%{rocm_release}-llvm #BuildRequires: rocm%{rocm_release}-llvm-static BuildRequires: rocm%{rocm_release}-lld BuildRequires: rocm%{rocm_release}-llvm-devel BuildRequires: pkgconfig(libedit) BuildRequires: pkgconfig(libxml-2.0) %endif BuildRequires: rocm%{rocm_release}-macros BuildRequires: rocm%{rocm_release}-device-libs BuildRequires: vim-common #BuildRequires: xxd %description The ROCm Runtime Library is a thin, user-mode API that exposes the necessary interfaces to access and interact with graphics hardware driven by the AMDGPU driver set and the AMDKFD kernel driver. Together they enable programmers to directly harness the power of AMD discrete graphics devices by allowing host applications to launch compute kernels directly to the graphics hardware. %package -n %{libname} Summary: ROCm Runtime Library %description -n %{libname} The ROCm Runtime Library is a thin, user-mode API that exposes the necessary interfaces to access and interact with graphics hardware driven by the AMDGPU driver set and the AMDKFD kernel driver. Together they enable programmers to directly harness the power of AMD discrete graphics devices by allowing host applications to launch compute kernels directly to the graphics hardware. Provides: rocm-runtime = %{version}-%{release} Obsoletes: hsakmt < 6.3 Provides: hsakmt = %{version}-%{release} %package -n %{develname} Summary: ROCm Runtime development files Requires: %{libname} = %{version}-%{release} Provides: hsakmt-devel = %{version}-%{release} Obsoletes: hsakmt-devel < 6.3 Provides: rocm-runtime-devel = %{version}-%{release} %description -n %{develname} ROCm Runtime development files %prep %autosetup -n ROCR-Runtime-rocm-%{version} -p1 %define amd_device_libs_prefix %{rocm_prefix}/lib/clang/%{rocmllvm_version} sed -i -e 's,-cl-std=CL2.0,-cl-std=CL2.0 --hip-device-lib-path=%{amd_device_libs_prefix}/amdgcn/bitcode,g' runtime/hsa-runtime/image/blit_src/CMakeLists.txt # gcc 15 include cstdint sed -i '/#include .*/a#include ' runtime/hsa-runtime/core/inc/amd_elf_image.hpp %build export OCL_BITCODE_DIR=%{amd_device_libs_prefix}/amdgcn/bitcode %cmake -G Ninja -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DCMAKE_INSTALL_LIBDIR=%{rocm_prefix}/lib \ -DCMAKE_INSTALL_INCLUDEDIR=%{rocm_prefix}/include \ -DINCLUDE_PATH_COMPATIBILITY=OFF \ -DCMAKE_SHARED_LINKER_FLAGS=-ldrm \ %{?!enableimage:-DIMAGE_SUPPORT=OFF} \ -DLLVM_LIBDIR="%{rocm_prefix}/lib/cmake/AMDDeviceLibs" \ %if %{without system_tools} -DCMAKE_AR=%rocmllvm_bindir/llvm-ar \ -DCMAKE_C_COMPILER=%rocmllvm_bindir/clang \ -DCMAKE_CXX_COMPILER=%rocmllvm_bindir/clang++ \ -DCMAKE_LINKER=%rocmllvm_bindir/ld.lld \ -DCMAKE_RANLIB=%rocmllvm_bindir/llvm-ranlib \ -DCMAKE_PREFIX_PATH=%{rocmllvm_cmakedir}/.. %endif %if %{without system_tools} CXXFLAGS="$CXXFLAGS -I%{rocm_prefix}/lib" %endif %cmake_build %install %cmake_install %files -n %{libname} %doc README.md %license LICENSE.txt %{rocm_prefix}/lib/libhsa-runtime64.so.1{,.*} %exclude %{_docdir}/hsa-runtime64/LICENSE.md %files -n %{develname} %{rocm_prefix}/include/hsa/ %{rocm_prefix}/include/hsakmt/ %{rocm_prefix}/lib/libhsa-runtime64.so %{rocm_prefix}/lib/cmake/hsa-runtime64/ %{rocm_prefix}/lib/cmake/hsakmt/ %{rocm_prefix}/lib/libhsakmt.a %{rocm_prefix}/lib/pkgconfig/libhsakmt.pc