Files
compute-runtime/scripts/fedora.spec.in
Artur Harasimiuk e8424f242b don't enforce igc version from CMakeLists.txt
moving this requirement to .spec file. CMake should try building with
any IGC version installed in system. More strict requirement should be
defined at package level.

Change-Id: Ieae656fa0eac4069ee8870a829fe116e66ee5ced
Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2018-07-07 10:16:54 +02:00

76 lines
1.9 KiB
RPMSpec

%global neo_commit_id __NEO_COMMIT_ID__
%global gmmlib_commit_id __GMMLIB_COMMIT_ID__
%global igc_version_required 18.26.612
Name: intel-opencl
Version: __NEO_PACKAGE_VERSION__
Release: __NEO_PACKAGE_RELEASE__%{?dist}
Summary: Intel(R) Graphics Compute Runtime for OpenCL(TM)
Group: System Environment/Libraries
License: MIT
URL: https://github.com/intel/compute-runtime
Source0: https://github.com/intel/compute-runtime/archive/%{neo_commit_id}/neo.tar.gz
Source1: https://github.com/intel/gmmlib/archive/%{gmmlib_commit_id}/gmmlib.tar.gz
%if 0%{?el7}
BuildRequires: centos-release-scl epel-release
BuildRequires: devtoolset-4-gcc-c++ cmake3
BuildRequires: gcc-c++ ninja-build make procps python2 libva-devel
%else
BuildRequires: cmake clang gcc-c++ ninja-build make procps python2 sed libva-devel
%endif
BuildRequires: intel-igc-opencl-devel >= %{igc_version_required}
Requires: intel-igc-opencl >= %{igc_version_required}
%description
%prep
%build
echo "==== BUILD ===="
rm -rf *
mkdir neo gmmlib
tar xzf $RPM_SOURCE_DIR/neo.tar.gz -C neo --strip-components=1
tar xzf $RPM_SOURCE_DIR/gmmlib.tar.gz -C gmmlib --strip-components=1
mkdir build
cd build
%if 0%{?el7}
scl enable devtoolset-4 "cmake3 ../neo -DCMAKE_BUILD_TYPE=Release -DNEO_DRIVER_VERSION=%{version}"
scl enable devtoolset-4 "make -j`nproc` igdrcl_dll"
%else
cmake ../neo -DCMAKE_BUILD_TYPE=Release -DNEO_DRIVER_VERSION=%{version}
make -j`nproc` igdrcl_dll
%endif
echo "==== DONE ===="
%install
echo "==== INSTALL ===="
mkdir -p $RPM_BUILD_ROOT/usr/lib64
mkdir -p $RPM_BUILD_ROOT/etc/OpenCL/vendors
cp $RPM_BUILD_DIR/build/bin/libigdrcl.so $RPM_BUILD_ROOT/usr/lib64/
strip $RPM_BUILD_ROOT/usr/lib64/libigdrcl.so
echo "/usr/lib64/libigdrcl.so" > $RPM_BUILD_ROOT/etc/OpenCL/vendors/intel.icd
echo "==== DONE ===="
%files
%defattr(-,root,root)
/usr/lib64/libigdrcl.so
%config(noreplace)
/etc/OpenCL/vendors/intel.icd
# %doc
# %changelog