## START: Set by rpmautospec ## (rpmautospec version 0.7.3) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 12; 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 %global commit 655929aa2d8c2ddff8428c8e11a1ef2c65f5dd5d %global shortcommit %(c=%{commit}; echo ${c:0:7}) # not compatible with newer clang versions %if 0%{?fedora} >= 38 || 0%{?rhel} >= 8 %global llvm_compat 15 %endif Name: intel-opencl-clang Version: 15.0.0 Release: %autorelease Summary: Library to compile OpenCL C kernels to SPIR-V modules License: NCSA URL: https://github.com/intel/opencl-clang Source0: %{url}/archive/%{commit}/%{name}-%{shortcommit}.tar.gz BuildRequires: cmake BuildRequires: clang%{?llvm_compat} BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: make BuildRequires: llvm%{?llvm_compat}-devel BuildRequires: clang%{?llvm_compat}-devel %if %{?llvm_compat} == 15 BuildRequires: spirv-llvm15.0-translator-devel %else BuildRequires: spirv-llvm-translator%{?llvm_compat}-devel %endif BuildRequires: zlib-devel %description opencl-clang is a thin wrapper library around clang. The library has OpenCL-oriented API and is capable to compile OpenCL C kernels to SPIR-V modules. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel This package contains libraries and header files for developing against %{name} %prep %autosetup -n opencl-clang-%{commit} -p1 sed -i 's/$/$/' cl_headers/CMakeLists.txt %build %cmake \ -DPREFERRED_LLVM_VERSION='%(rpm -q --qf '%%{version}' llvm%{?llvm_compat}-devel | cut -d. -f1 | sed "s/$/.0.0/")' \ -DLLVM_DIR=%{_libdir}/llvm%{?llvm_compat}/lib/cmake/llvm/ %cmake_build %install %cmake_install # This is ugly, but a combined behavior of LLVM_DIR=*/lib/* and LLVM_LIBDIR_SUFFIX=64 is borked %ifnarch i686 mkdir -p %{buildroot}%{_libdir}/ cp %{buildroot}/usr/lib/libopencl-clang.so.* %{buildroot}%{_libdir}/ cp %{buildroot}/usr/lib/libopencl-clang.so %{buildroot}%{_libdir}/ rm %{buildroot}/usr/lib/libopencl-clang.so.* rm %{buildroot}/usr/lib/libopencl-clang.so %endif %files %license LICENSE %{_libdir}/libopencl-clang.so.* %files devel %{_libdir}/libopencl-clang.so %{_includedir}/cclang/common_clang.h %{_includedir}/cclang/opencl-c.h %{_includedir}/cclang/opencl-c-base.h %{_includedir}/cclang/module.modulemap %changelog ## START: Generated by rpmautospec * Thu Jul 18 2024 Fedora Release Engineering - 15.0.0-12 - Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild * Thu May 23 2024 František Zatloukal - 15.0.0-11 - Rebase * Wed Jan 24 2024 Fedora Release Engineering - 15.0.0-10 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Sat Jan 20 2024 Fedora Release Engineering - 15.0.0-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild * Thu Oct 05 2023 František Zatloukal - 15.0.0-8 - Do not shuffle libraries on 32 bit build * Thu Oct 05 2023 František Zatloukal - 15.0.0-7 - Add forgotten patch * Thu Oct 05 2023 František Zatloukal - 15.0.0-6 - Rebase, switch to llvm 15 (Fixes RHBZ#2225928) * Thu Jul 20 2023 Fedora Release Engineering - 15.0.0-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild * Thu Jan 19 2023 Fedora Release Engineering - 15.0.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild * Mon Sep 26 2022 Frantisek Zatloukal - 15.0.0-2 - Rebuild for spirv-llvm-translator against llvm 15 * Fri Sep 16 2022 Frantisek Zatloukal - 15.0.0-1 - Update to llvm 15 * Thu Jul 21 2022 Fedora Release Engineering - 14.0.0-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild * Fri Jul 08 2022 Frantisek Zatloukal - 14.0.0-2 - Bump to a later commit with bunch of fixes * Thu Mar 31 2022 Frantisek Zatloukal - 14.0.0-1 - Update to llvm 14 * Mon Dec 06 2021 Frantisek Zatloukal - 13.0.0-1 - Initial package ## END: Generated by rpmautospec