File compute-runtime.spec of Package intel-compute-runtime
%define realname compute-runtime
# Newer versions have no support for Gen8, Gen9 and Gen11
%define realver 24.35.30872.36
%define srcext tar.gz
# Common info
Name: intel-opencl
Version: %{realver}
Release: wiz%{?extraver:0.}1%{?dist}
License: MIT
Group: System/Libraries
URL: https://github.com/intel/compute-runtime
Summary: Intel(R) Graphics Compute Runtime for OpenCL(TM)
# Install-time parameters
Requires: igc
Provides: intel-compute-runtime = %{version}-%{release}
Obsoletes: intel-compute-runtime < %{version}-%{release}
# Build-time parameters
BuildRequires: cmake >= 3.13
BuildRequires: pkg-config
BuildRequires: ninja
BuildRequires: gcc-c++
BuildRequires: pkgconfig(igc-opencl)
BuildRequires: pkgconfig(igdgmm)
%if 0%{?suse_version}
BuildRequires: pkgconfig(libva) >= 1.0.0
%endif
BuildRoot: %{_tmppath}/%{name}-root
Source0: https://github.com/intel/compute-runtime/archive/refs/tags/%{realver}%{?extraver}.%{srcext}#/%{realname}-%{realver}%{?extraver}.%{srcext}
%description
The Intel(R) Graphics Compute Runtime for OpenCL(TM) is a open source project to
converge Intel's development efforts on OpenCL(TM) compute stacks supporting
the GEN graphics hardware architecture.
# Preparation step (unpackung and patching if necessary)
%prep
%setup -q -n %{realname}-%{realver}%{?extraver}
# Build step (compile/build binaries, documentation, etc)
%build
_CFLAGS='%{optflags} %{?gcc_lto} -include cstdint -Wno-error=deprecated-declarations -Wno-error=alloc-size-larger-than='
_LDFLAGS='-Wl,--as-needed -Wl,--strip-all -Wl,--no-undefined -Wl,-z,noexecstack -Wl,-z,now -Wl,-z,relro %{?gcc_lto}'
cmake -S . -B tmp_build \
-Wno-dev \
-G Ninja \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DCMAKE_INSTALL_LIBDIR=%{_libdir} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS_RELEASE="$_CFLAGS" \
-DCMAKE_C_FLAGS_RELEASE="$_CFLAGS" \
-DCMAKE_EXE_LINKER_FLAGS_RELEASE="$_LDFLAGS" \
-DCMAKE_MODULE_LINKER_FLAGS_RELEASE="$_LDFLAGS" \
-DCMAKE_SHARED_LINKER_FLAGS_RELEASE="$_LDFLAGS" \
-DCMAKE_VERBOSE_MAKEFILE=YES \
\
-DNEO_REVISION=%{version} \
-DDISABLE_WDDM_LINUX=YES \
-DSKIP_UNIT_TESTS=YES
ninja -v -C tmp_build %{?_smp_mflags}
# Install built stuff
%install
DESTDIR=%{buildroot} ninja -v -C tmp_build install
# Cleanup
%clean
[ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
# Files list
%files
%defattr(-,root,root)
%license LICENSE.md
%doc README.md FAQ.md
%dir %{_sysconfdir}/OpenCL/vendors/
%dir %{_sysconfdir}/OpenCL/
%config(noreplace) %{_sysconfdir}/OpenCL/vendors/intel.icd
%{_bindir}/ocloc*
%dir %{_libdir}/intel-opencl
%{_libdir}/intel-opencl/libigdrcl.so
%{_libdir}/libocloc.so
%{_includedir}/ocloc_api.h
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%changelog