#Cmake macro is called within sourcedir but HIP assumes it's called from build %define __cmake_in_source_build 1 %global upstreamname hipamd Name: rocm-hip Version: 5.1.0 Release: 4%{?dist} Summary: ROCm HIP Runtime Url: https://github.com/RadeonOpenCompute/hipamd License: MIT Source0: https://github.com/ROCm-Developer-Tools/%{upstreamname}/archive/refs/tags/rocm-%{version}.tar.gz#/%{upstreamname}-%{version}.tar.gz Source1: https://github.com/ROCm-Developer-Tools/HIP/archive/refs/tags/rocm-%{version}.tar.gz#/HIP-%{version}.tar.gz #Issue causing debug symbols to not generate: #https://github.com/ROCm-Developer-Tools/hipamd/issues/24 Patch1: 0001-Revert-hip-Fix-and-install-cmake-targets-for-hip-pac.patch Patch2: 0002-Revert-hip-Switch-to-component-based-packaging.patch #To allow unbunbled ROCclr/OCL Patch3: 0001-Use-installed-rocclr-if-available.patch Patch4: 0002-Fix-CL-icd-header-include.patch #Use GNUInstallDirs: Patch5: 0001-Use-GNUInstallDirs.patch BuildRequires: clang-devel BuildRequires: cmake BuildRequires: git BuildRequires: libffi-devel BuildRequires: libglvnd-devel BuildRequires: llvm-devel BuildRequires: perl BuildRequires: rocclr-devel BuildRequires: rocminfo BuildRequires: rocm-comgr-devel BuildRequires: zlib-devel Requires: rocm-comgr #Only the following architectures are supported: # The kernel support only exists for x86_64, aarch64, and ppc64le # 32bit userspace is excluded based on current Fedora policies ExclusiveArch: x86_64 aarch64 ppc64le %description HIP is a C++ Runtime API and Kernel Language that allows developers to create portable applications for AMD and NVIDIA GPUs from single source code. %package devel Summary: ROCm HIP development package Requires: %{name}%{?_isa} = %{version}-%{release} %description devel The AMD ROCm HIP development package. %prep %autosetup -p1 -a 1 -n %{upstreamname}-rocm-%{version} #FIXME: soname is broken when building from tar, upstream is fixing the issue: sed -i 's/-${HIP_VERSION_GITHASH}//' CMakeLists.txt #HIP requires RPATH #https://github.com/ROCm-Developer-Tools/hipamd/issues/22 sed -i "/CMAKE_INSTALL_RPATH/d" CMakeLists.txt %build #Set location of clang++ for hipconfig perl script run by cmake: export HIP_CLANG_PATH=%{_bindir} mkdir build cd build %cmake -S.. -B. \ -DHIP_COMMON_DIR=$(pwd)/../HIP-rocm-%{version} \ -DCMAKE_INSTALL_LIBDIR=%{_lib} \ -DHIP_COMPILER=clang \ -DCMAKE_BUILD_TYPE=RelWithDebInfo %cmake_build %install cd build %cmake_install #FIXME: hip installs some cmake modules incorrectly: mkdir -p %{buildroot}%{_datadir}/cmake mv %{buildroot}%{_prefix}/cmake %{buildroot}%{_datadir}/cmake/Modules %files %doc README.md %license LICENSE.txt #FIXME: hipInfo shouldn't be hidden, nor in libdir: %{_libdir}/.hipInfo %{_libdir}/libamdhip64.so.5{,.*} %{_libdir}/libhiprtc-builtins.so.5{,.*} %files devel %{_bindir}/* #FIXME: hipVersion shouldn't be hidden, nor in bindir: %{_bindir}/.hipVersion %{_includedir}/hip %{_libdir}/libamdhip64.so %{_libdir}/libhiprtc-builtins.so %{_datadir}/cmake/Modules/FindHIP* %{_libdir}/cmake/hip %{_libdir}/cmake/hip-lang %changelog * Sat May 07 2022 Jeremy Newton - 5.1.0-4 - Fix OCL header include, so opencl can fully unbundle ocl-icd - Rework rocclr patches - Add patch for gnuinstalldirs - Fix cmake module path * Wed Apr 20 2022 Jeremy Newton - 5.1.0-3 - Unbundle ROCm OpenCL and ROCclr * Tue Apr 05 2022 Jeremy Newton - 5.1.0-2 - Enable ppc64le * Fri Apr 01 2022 Jeremy Newton - 5.1.0-1 - Update to 5.1.0 * Sat Mar 12 2022 Jeremy Newton - 5.0.2-1 - Initial package