# bitcode has no debuginfo
%global debug_package %{nil}
%global llvm_maj_ver 17
%bcond_without compat_build
# If you bump LLVM, please reset bugfix_version to 0; I fork upstream sources,
# but I prepare the initial *.0 tag long before Fedora/EL picks up new LLVM.
# An LLVM update will require uploading new sources, contact mystro256 if FTBFS.
%global bugfix_version 2
%global upstreamname ROCm-Device-Libs
# This might be needed because EL9 llvm is built with clang:
%if 0%{?epel} > 8
%global toolchain clang
%endif
Name: rocm-device-libs
Version: %{llvm_maj_ver}.%{bugfix_version}
Release: 5%{?dist}
Summary: AMD ROCm LLVM bit code libraries
Url: https://github.com/RadeonOpenCompute/ROCm-Device-Libs
License: NCSA
# I fork upstream sources because they don't target stable LLVM, but rather the
# bleeding edge LLVM branch. My fork is a snapshot with bugfixes backported:
Source0: https://github.com/mystro256/%{upstreamname}/archive/refs/tags/%{version}.tar.gz#/%{upstreamname}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: zlib-devel
%if %{with compat_build}
BuildRequires: clang%{llvm_maj_ver}-devel
BuildRequires: clang%{llvm_maj_ver}
BuildRequires: llvm%{llvm_maj_ver}-devel
Requires: clang%{llvm_maj_ver}
Requires: clang%{llvm_maj_ver}-resource-filesystem
%else
BuildRequires: clang-devel
BuildRequires: clang(major) = %{llvm_maj_ver}
BuildRequires: llvm-devel(major) = %{llvm_maj_ver}
Requires: clang(major) = %{llvm_maj_ver}
Requires: clang-resource-filesystem
%endif
#Only the following architectures are useful for ROCm packages:
ExclusiveArch: x86_64 aarch64 ppc64le
%description
This package contains a set of AMD specific device-side language runtime
libraries in the form of bit code. Specifically:
- Open Compute library controls
- Open Compute Math library
- Open Compute Kernel library
- OpenCL built-in library
- HIP built-in library
- Heterogeneous Compute built-in library
%prep
%autosetup -p1 -n %{upstreamname}-%{version}
%build
%if %{with compat_build}
export PATH=%{_libdir}/llvm%{llvm_maj_ver}/bin:$PATH
%endif
%cmake -DCMAKE_BUILD_TYPE="RELEASE"
%cmake_build
%install
%cmake_install
%check
%ctest
%files
%license LICENSE.TXT
%doc README.md doc/*.md
# No need to install this twice:
%exclude %{_docdir}/ROCm-Device-Libs/LICENSE.TXT
%{_libdir}/cmake/AMDDeviceLibs
%if %{with compat_build}
%{_prefix}/lib/clang/%{llvm_maj_ver}/amdgcn
%else
%clang_resource_dir/amdgcn
%endif
%changelog
* Thu Mar 7 2024 Tom Rix <trix@redhat.com> - 17.2-5
- adjust the amdgcn location
* Wed Mar 6 2024 Tom Rix <trix@redhat.com> - 17.2-4
- add with compat_build to use the llvm17
* Fri Jan 26 2024 Fedora Release Engineering <releng@fedoraproject.org> - 17.2-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Mon Jan 22 2024 Fedora Release Engineering <releng@fedoraproject.org> - 17.2-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Thu Dec 14 2023 Jeremy Newton <alexjnewt at hotmail dot com> - 17.2-1
- Update to 17.2
* Fri Oct 20 2023 Jeremy Newton <alexjnewt at hotmail dot com> - 17.1-1
- Update to 17.1
* Wed Sep 06 2023 Tulio Magno Quites Machado Filho <tuliom@redhat.com> - 17.0-2
- Rebuild against LLVM 17.0.0
* Tue Aug 15 2023 Jeremy Newton <alexjnewt at hotmail dot com> - 17.0-1
- Update to 17.0
* Tue Aug 08 2023 Jeremy Newton <alexjnewt at hotmail dot com> - 16.4-1
- Update to 16.4
* Fri Jul 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 16.3-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Tue Jul 18 2023 Jeremy Newton <alexjnewt at hotmail dot com> - 16.3-1
- Update to 16.3
* Thu Jun 01 2023 Jeremy Newton <alexjnewt at hotmail dot com> - 16.2-1
- Update to 16.2
* Wed Apr 19 2023 Jeremy Newton <alexjnewt at hotmail dot com> - 16.1-1
- Update to 16.1
* Wed Mar 29 2023 Jeremy Newton <alexjnewt at hotmail dot com> - 16.0-1
- Update to 16.0 (forked sources for Fedora)
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 5.4.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Sun Dec 18 2022 Jeremy Newton <alexjnewt at hotmail dot com> - 5.4.1-1
- Update to 5.4.1
* Mon Oct 03 2022 Jeremy Newton <alexjnewt at hotmail dot com> - 5.3.0-1
- Update to 5.3.0
* Tue Sep 13 2022 Nikita Popov <npopov@redhat.com> - 5.2.0-3
- Rebuild against LLVM 15
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 5.2.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sun Jul 03 2022 Jeremy Newton <alexjnewt at hotmail dot com> - 5.2.0-1
- Update to 5.2.0
* Wed Jun 08 2022 Jeremy Newton <alexjnewt at hotmail dot com> - 5.1.0-4
- Update FHS patch (adapted from Debian)
* Tue Apr 05 2022 Jeremy Newton <alexjnewt at hotmail dot com> - 5.1.0-3
- Enable ppc64le
* Thu Mar 31 2022 Jeremy Newton <alexjnewt at hotmail dot com> - 5.1.0-2
- Add clang specific major version requires
- BR a specific clang/llvm major version combination
* Thu Mar 31 2022 Jeremy Newton <alexjnewt at hotmail dot com> - 5.1.0-1
- Update to 5.1.0
- Add llvm version requirement to make sure the right version is used
* Fri Feb 11 2022 Jeremy Newton <alexjnewt at hotmail dot com> - 5.0.0-1
- Update to 5.0.0
* Mon Jan 17 2022 Jeremy Newton <alexjnewt at hotmail dot com> - 4.5.2-1
- Initial package