%global igc_commit_id 67351f4e52f52eb2e4d68a9a40599a77733b5603 %global llvm_patches_commit_id 17fc4383393b733d156a61617fc28c8ff09e0519 %global major_version 18 %global minor_version 48 %global patch_version 1124 %global package_release 2.experimental Name: intel-igc Version: %{major_version}.%{minor_version}.%{patch_version} Release: %{package_release}%{?dist} Summary: Intel(R) Graphics Compiler for OpenCL(TM) Group: System Environment/Libraries License: MIT URL: https://github.com/intel/intel-graphics-compiler Source0: https://github.com/intel/intel-graphics-compiler/archive/%{igc_commit_id}/igc.tar.gz Source1: https://github.com/intel/llvm-patches/archive/%{llvm_patches_commit_id}/llvm-patches.tar.gz Source2: https://github.com/llvm-mirror/llvm/archive/release_40/llvm-40.tar.gz %if 0%{?el7} BuildRequires: centos-release-scl epel-release BuildRequires: devtoolset-4-gcc-c++ cmake3 ninja-build llvm-toolset-7-clang BuildRequires: gcc-c++ ninja-build make procps flex bison python2 p7zip patch %else BuildRequires: cmake clang gcc-c++ ninja-build make procps flex bison python2 p7zip %endif BuildRequires: intel-opencl-clang-devel >= 4.0.16 %description %package core Summary: Intel(R) Graphics Compiler Core %description core %package opencl Summary: Intel(R) Graphics Compiler Frontend for OpenCL(TM) Requires: %{name}-core = %{version}-%{release} Requires: intel-opencl-clang >= 4.0.16 %description opencl %package opencl-devel Summary: Intel(R) Graphics Compiler development package for OpenCL(TM) Requires: %{name}-opencl = %{version}-%{release} %description opencl-devel %prep echo 0%{?rhel} echo 0%{?fedora} echo 0%{?rhl} echo 0%{?el7} %build echo "==== BUILD ====" rm -rf * mkdir igc common_clang llvm_patches opencl_headers llvm_source clang_source tar xzf $RPM_SOURCE_DIR/igc.tar.gz -C igc --strip-components=1 tar xzf $RPM_SOURCE_DIR/llvm-patches.tar.gz -C llvm_patches --strip-components=1 tar xzf $RPM_SOURCE_DIR/llvm-40.tar.gz -C llvm_source --strip-components=1 mkdir -p $RPM_BUILD_DIR/igc/Clang/Prebuilt/linux-fedora/Release/64/ 7za a $RPM_BUILD_DIR/igc/Clang/Prebuilt/linux-fedora/Release/64/clang.7z /usr/lib64/libopencl_clang.so /usr/share/opencl-clang/* mkdir build cd build %if 0%{?el7} echo building for el7: %{el7} scl enable devtoolset-4 llvm-toolset-7 "cmake3 ../igc -DCMAKE_BUILD_TYPE=Release -DLINUX_DISTRO=fedora -DMAJOR_VERSION=%{major_version} -DMINOR_VERSION=%{minor_version} -DPATCH_VERSION=%{patch_version}" scl enable devtoolset-4 llvm-toolset-7 "make -j`nproc` igc_dll fcl_dll" %else echo building for Fedora cmake ../igc -DCMAKE_BUILD_TYPE=Release -DLINUX_DISTRO=fedora -DMAJOR_VERSION=%{major_version} -DMINOR_VERSION=%{minor_version} -DPATCH_VERSION=%{patch_version} make -j`nproc` igc_dll fcl_dll %endif %install echo "==== INSTALL ====" # install binaries mkdir -p $RPM_BUILD_ROOT/usr/lib64 find $RPM_BUILD_DIR/dump64 -name lib\*.so | xargs -n 1 -I {} cp {} $RPM_BUILD_ROOT/usr/lib64 rm -f $RPM_BUILD_ROOT/usr/lib64/libopencl_clang.so strip $RPM_BUILD_ROOT/usr/lib64/*.so # install for opencl-devel mkdir -p $RPM_BUILD_ROOT/usr/include/igc $RPM_BUILD_ROOT/usr/lib64/pkgconfig cp -a $RPM_BUILD_DIR/igc/IGC/AdaptorOCL/* $RPM_BUILD_ROOT/usr/include/igc/ find $RPM_BUILD_ROOT/usr/include/igc/ -type f \! -iname \*.h | xargs -n 1 rm -f rm -rf $RPM_BUILD_ROOT/usr/include/igc/CLElfLib cp $RPM_BUILD_DIR/build/IGC/igc.opencl.h $RPM_BUILD_ROOT/usr/include/igc/ cp $RPM_BUILD_DIR/build/IGC/igc-opencl.pc $RPM_BUILD_ROOT/usr/lib64/pkgconfig/ echo "==== DONE ====" %files core %defattr(-,root,root) /usr/lib64/libiga64.so /usr/lib64/libigc.so %files opencl %defattr(-,root,root) /usr/lib64/libigdfcl.so %files opencl-devel %defattr(-,root,root) /usr/include/igc/* /usr/lib64/pkgconfig/* # %doc # %changelog