## START: Set by rpmautospec ## (rpmautospec version 0.6.0) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 5; 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 # ROCclr loads comgr at run time by soversion, so this needs to be checked when # updating this package as it's used for the comgr requires for opencl and hip: %global comgr_maj_api_ver 2 # See the file "rocclr/device/comgrctx.cpp" for reference: # https://github.com/ROCm-Developer-Tools/ROCclr/blob/develop/device/comgrctx.cpp#L62 %global rocm_major 6 %global rocm_minor 2 %global rocm_patch 0 %global rocm_release %{rocm_major}.%{rocm_minor} %global rocm_version %{rocm_release}.%{rocm_patch} %bcond_with debug %if %{with debug} %global build_type DEBUG %else %global build_type RelWithDebInfo %endif %if 0%{?fedora} %bcond_without cppheaderparser %else %bcond_with cppheaderparser %endif %if %{with cppheaderparser} %global build_prof_api ON %else %global build_prof_api OFF %endif %if 0%{?rhel} && 0%{?rhel} < 10 # No ocl-icd-devel in cs9 %bcond_with ocl %else %bcond_without ocl %endif %if %{with ocl} %global build_ocl ON %else %global build_ocl OFF %endif Name: rocclr Version: %{rocm_version} %if 0%{?rhel} && 0%{?rhel} < 10 Release: 1%{?dist} %else Release: %autorelease %endif Summary: ROCm Compute Language Runtime Url: https://github.com/ROCm-Developer-Tools/clr License: MIT Source0: https://github.com/ROCm-Developer-Tools/clr/archive/refs/tags/rocm-%{version}.tar.gz#/%{name}-%{version}.tar.gz # TODO: it would be nice to separate this into its own package: Source1: https://github.com/ROCm-Developer-Tools/HIP/archive/refs/tags/rocm-%{version}.tar.gz#/HIP-%{version}.tar.gz # Revert patch: this causes some issues with upstream LLVM 16 (RHBZ#2207599) #https://github.com/ROCm-Developer-Tools/ROCclr/commit/041c00465b7adcee78085dc42253d42d1bb1f250 Patch4: 0001-Revert-SWDEV-325538-Enable-code-object-v5-by-default.patch # a fix for building blender Patch8: 0001-add-long-variants-for-__ffsll.patch # https://github.com/ROCm/clr/pull/69 Patch9: 0001-Check-p2p_agents_list_-before-deleting.patch BuildRequires: cmake BuildRequires: doxygen %if 0%{?fedora} BuildRequires: fdupes %endif BuildRequires: gcc-c++ BuildRequires: hipcc BuildRequires: libffi-devel BuildRequires: perl BuildRequires: perl-generators %if 0%{?rhel} && 0%{?rhel} < 10 BuildRequires: libglvnd-devel %else BuildRequires: pkgconfig(opengl) %endif %if %{with ocl} BuildRequires: pkgconfig(ocl-icd) %endif BuildRequires: pkgconfig(numa) %if %{with cppheaderparser} BuildRequires: python3-cppheaderparser %endif BuildRequires: rocm-comgr-devel BuildRequires: rocm-compilersupport-macros BuildRequires: rocm-runtime-devel >= %{rocm_release} BuildRequires: zlib-devel # ROCclr relies on some x86 intrinsics # 32bit userspace is excluded as it likely doesn't work and is not very useful # Also depends on rocm-runtime which doesn't build non x86 ExclusiveArch: x86_64 %if %{with ocl} # rocclr bundles OpenCL 2.2 headers # Some work is needed to unbundle this, as it fails to compile with latest Provides: bundled(opencl-headers) = 2.2 %endif %description ROCm Compute Language Runtime %if %{with ocl} %package -n rocm-opencl Summary: ROCm OpenCL platform and device tool Requires: comgr(major) = %{comgr_maj_api_ver} Requires: ocl-icd%{?_isa} Requires: opencl-filesystem %description -n rocm-opencl ROCm OpenCL language runtime. Supports offline and in-process/in-memory compilation. %package -n rocm-opencl-devel Summary: ROCm OpenCL development package Requires: rocm-opencl%{?_isa} = %{version}-%{release} Requires: ocl-icd-devel%{?_isa} %description -n rocm-opencl-devel The AMD ROCm OpenCL development package. %package -n rocm-clinfo Summary: ROCm OpenCL platform and device tool %description -n rocm-clinfo A simple ROCm OpenCL application that enumerates all possible platform and device information. %endif %package -n rocm-hip Summary: ROCm HIP platform and device tool Requires: comgr(major) = %{comgr_maj_api_ver} Requires: hipcc %description -n rocm-hip HIP is a C++ Runtime API and Kernel Language that allows developers to create portable applications for AMD and NVIDIA GPUs from the same source code. %package -n rocm-hip-devel Summary: ROCm HIP development package Requires: rocm-hip%{?_isa} = %{version}-%{release} Requires: rocm-comgr-devel Requires: rocm-runtime-devel >= %{rocm_release} Provides: hip-devel = %{version}-%{release} %description -n rocm-hip-devel ROCm HIP development package. %package -n hip-doc Summary: HIP API documentation package BuildArch: noarch %description -n hip-doc This package contains documentation for the hip package %prep %autosetup -N -a 1 -n clr-rocm-%{version} # ROCclr patches %autopatch -p1 # Enable experimental pre vega platforms sed -i 's/\(ROC_ENABLE_PRE_VEGA.*\)false/\1true/' rocclr/utils/flags.hpp # Disable RPATH # https://github.com/ROCm-Developer-Tools/hipamd/issues/22 sed -i '/INSTALL_RPATH/d' \ opencl/tools/clinfo/CMakeLists.txt hipamd/CMakeLists.txt # Upstream doesn't want OpenCL sonames because they don't guarantee API/ABI. # For Fedora, SOVERSION can be major.minor (i.e. rocm_release) as rocm patch # releases are very unlikely to break anything: echo "set_target_properties(amdocl PROPERTIES VERSION %{version} SOVERSION %rocm_release)" \ >> opencl/amdocl/CMakeLists.txt echo "libamdocl64.so.%{rocm_release}" > opencl/config/amdocl64.icd echo "set_target_properties(cltrace PROPERTIES VERSION %{version} SOVERSION %rocm_release)" \ >> opencl/tools/cltrace/CMakeLists.txt # Clean up unused bundled code # Only keep opencl2.2 headers as are they needed for now: ls -d opencl/khronos/* | grep -v headers | xargs rm -r ls -d opencl/khronos/headers/* | grep -v opencl2.2 | xargs rm -r # Unused opencl 2.2 test code: rm -r opencl/khronos/headers/opencl2.2/tests/ # Don't change default C FLAGS and CXX FLAGS: sed -i '/CMAKE_C.*_FLAGS/d' hipamd/src/CMakeLists.txt # Stop cmake from trying to install HIPCC again: sed -i "/install(PROGRAMS.*{[Hh][Ii][Pp][Cc]/d" hipamd/CMakeLists.txt # Disable doxygen timestamps: sed -i 's/^\(HTML_TIMESTAMP.*\)YES/\1NO/' \ HIP-rocm-%{version}/docs/doxygen-input/doxy.cfg %build export PATH=%rocmllvm_prefix/bin:$PATH %cmake \ -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-z,noexecstack \ -DHIP_COMMON_DIR=$(realpath HIP-rocm-%{version}) \ -DCMAKE_INSTALL_LIBDIR=%{_lib} \ -DHIPCC_BIN_DIR=%{_bindir} \ -DHIP_PLATFORM=amd \ -DROCM_PATH=%{_prefix} \ -DBUILD_ICD=OFF \ -DCLR_BUILD_HIP=ON \ -DCLR_BUILD_OCL=%{build_ocl} \ -DFILE_REORG_BACKWARD_COMPATIBILITY=OFF \ -DHIP_ENABLE_ROCPROFILER_REGISTER=OFF \ -DUSE_PROF_API=%{build_prof_api} \ -DCMAKE_BUILD_TYPE=%{build_type} %cmake_build %install %cmake_install %if %{with ocl} # Install OpenCL ICD configuration: install -D -m 644 opencl/config/amdocl64.icd \ %{buildroot}%{_sysconfdir}/OpenCL/vendors/amdocl64.icd # Avoid file conflicts with opencl-headers package: mkdir -p %{buildroot}%{_includedir}/%{name} mv %{buildroot}%{_includedir}/CL %{buildroot}%{_includedir}/%{name}/CL # Avoid file conflicts with clinfo package: mv %{buildroot}%{_bindir}/clinfo %{buildroot}%{_bindir}/rocm-clinfo %endif # Clean up file dupes %if 0%{?fedora} %fdupes %{buildroot}/%{_docdir}/hip %endif # TODO send upstream a patch, libhip should be installed with cmake's 'TARGETS' chmod 755 %{buildroot}%{_libdir}/lib*.so* %if %{with ocl} %files -n rocm-opencl %license opencl/LICENSE.txt %config(noreplace) %{_sysconfdir}/OpenCL/vendors/amdocl64.icd %{_libdir}/libamdocl64.so.%{rocm_major}{,.*} %{_libdir}/libcltrace.so.%{rocm_major}{,.*} #Duplicated files: %exclude %{_docdir}/opencl*/LICENSE* %files -n rocm-opencl-devel %{_libdir}/libamdocl64.so %{_libdir}/libcltrace.so %{_includedir}/%{name} %files -n rocm-clinfo %license opencl/LICENSE.txt %{_bindir}/rocm-clinfo %endif %files -n rocm-hip %license hipamd/LICENSE.txt %{_libdir}/libamdhip64.so.%{rocm_major}{,.*} %{_libdir}/libhiprtc.so.%{rocm_major}{,.*} %{_libdir}/libhiprtc-builtins.so.%{rocm_major}{,.*} %{_datadir}/hip #Duplicated files: %exclude %{_docdir}/hip*/LICENSE* %files -n rocm-hip-devel %{_bindir}/roc-* %{_libdir}/libamdhip64.so %{_libdir}/libhiprtc.so %{_libdir}/libhiprtc-builtins.so %{_libdir}/cmake/hip* %{_bindir}/hipdemangleatp %{_bindir}/hipcc_cmake_linker_helper %{_includedir}/hip %if %{with cppheaderparser} %{_includedir}/hip_prof_str.h %endif # Unnecessary file and is not FHS compliant: %exclude %{_libdir}/.hipInfo # Windows files: %exclude %{_bindir}/*.bat %files -n hip-doc %license HIP-rocm-%{version}/LICENSE.txt %{_docdir}/hip %changelog ## START: Generated by rpmautospec * Wed Sep 11 2024 Tom Rix - 6.2.0-5 - Work around ocl-icd-devel not being in CS9 * Sat Sep 07 2024 Tom Rix - 6.2.0-4 - Reduce build dependencies for RHEL * Mon Sep 02 2024 Tom Rix - 6.2.0-3 - Add --with debug option * Sat Aug 31 2024 Peter Robinson - 6.2.0-2 - Clarify some comments on x86 requirements * Fri Aug 09 2024 Jeremy Newton - 6.2.0-1 - Update to 6.2 * Fri Jul 19 2024 Fedora Release Engineering - 6.1.2-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Thu Jun 06 2024 Jeremy Newton - 6.1.2-1 - Update to 6.1.2 * Mon May 13 2024 Jeremy Newton - 6.1.1-2 - Forgot to commit sources * Mon May 13 2024 Jeremy Newton - 6.1.1-1 - Update to 6.1.1 * Sat Mar 23 2024 Tom Rix - 6.0.2-2 - A bug in how failures are handled * Sun Mar 10 2024 Tom Rix - 6.0.2-1 - Update to 6.0.2 * Wed Mar 06 2024 Tom Rix - 6.0.0-4 - Add a with compat_build * Fri Jan 26 2024 Fedora Release Engineering - 6.0.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Mon Jan 22 2024 Fedora Release Engineering - 6.0.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Wed Dec 20 2023 Jeremy Newton - 6.0.0-1 - Update to 6.0 * Wed Dec 20 2023 Jeremy Newton - 5.7.1-3 - Clean up spec file - drop hip-devel: I'd like to separate "hip" from "rocm-hip", but we should really approach this from a upstream first approach instead of trying to patch in the spec file - make hipcc related lines more obvious, as we will drop it in 6.1 - the fdupes logic is too complex and not worth the up keep - clean up or update various out of date comments - add rocm_major to avoid boiler plate updates in %%files * Fri Oct 20 2023 Jeremy Newton - 5.7.1-1 - Update to 5.7.1 * Tue Oct 03 2023 Jeremy Newton - 5.7.0-1 - Update to 5.7 * Tue Sep 12 2023 Jeremy Newton - 5.6.1-1 - Update to 5.6.1 * Sun Aug 20 2023 Tom Rix - 5.6.0-4 - A better fix for blender 3.6.x and rocFFT * Fri Jul 21 2023 Fedora Release Engineering - 5.6.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Tue Jul 04 2023 Jeremy Newton - 5.6.0-2 - Fix missing requires on rocm-hip-devel package * Thu Jun 29 2023 Jeremy Newton - 5.6.0-1 - Update to 5.6 * Sun Jun 18 2023 Tom Rix - 5.5.1-9 - Fix building upstream blender 3.5.x * Sat Jun 10 2023 Jeremy Newton - 5.5.1-8 - Fix hip-lang-config.cmake bug (upstream patch) * Fri Jun 09 2023 Jeremy Newton - 5.5.1-7 - Fix hip-config.cmake bug (upstream patch) * Fri Jun 02 2023 Jeremy Newton - 5.5.1-6 - Fix rocminfo requires for hip * Tue May 30 2023 Jeremy Newton - 5.5.1-5 - Move some sed patching to patch files, sent some to upstream - Add hipconfig patch for incorrect HIP_CLANG_INCLUDE detection - Using rocm-device-libs 16.2 simplifies hipcc patching - Minor clean up * Tue May 30 2023 Jeremy Newton - 5.5.1-4 - Move libamdhip64.so to rocm-hip to workaround blender issue * Tue May 30 2023 Jeremy Newton - 5.5.1-3 - Add "hip" runtime package; hipcc/hipconfig is required for blender at runtime * Tue May 30 2023 Jeremy Newton - 5.5.1-2 - Add missing perl-generators for generating requires - Fix some issues with hipcc.pl - Add fix build for aarch64 * Sun May 28 2023 Jeremy Newton - 5.5.1-1 - Update to 5.5.1 - Workaround RHBZ#2207599 - Add noexecstack linker option - Add doxygen docs * Tue May 16 2023 Jeremy Newton - 5.5.0-1 - Initial package ## END: Generated by rpmautospec