From 41be0a653d07a5615427237194f4c73eeb4627b8 Mon Sep 17 00:00:00 2001 From: Aubrey Li Date: Tue, 28 Nov 2023 14:27:55 +0800 Subject: [PATCH 1/2] Intel graphics compiler package version 1.0.14828.26 Add Intel graphics compiler package files Signed-off-by: Aubrey Li --- download | 1 + igc.spec | 124 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 125 insertions(+) create mode 100644 download create mode 100644 igc.spec diff --git a/download b/download new file mode 100644 index 0000000..0bf1e0e --- /dev/null +++ b/download @@ -0,0 +1 @@ +e665e57967f076267a68045ed454fc96 igc-1.0.14828.26.tar.gz diff --git a/igc.spec b/igc.spec new file mode 100644 index 0000000..2a75135 --- /dev/null +++ b/igc.spec @@ -0,0 +1,124 @@ +# Copyright (C) 2023 Intel Corporation +# SPDX-License-Identifier: MIT +# +# This package is downstreamed from Intel GPU RHEL9.2 Package repository: +# https://dgpu-docs.intel.com/driver/installation.html#rhel-install-steps + +%global lib_ver 1.0.14828.26 +%global anolis_release 1 +%global so_ver 14 + +Name: intel-graphics-compiler +Version: %{lib_ver} +Release: %{anolis_release}%{?dist} +Summary: Intel(R) Graphics Compiler for OpenCL(TM) +License: MIT +Group: System Environment/Libraries +URL: https://github.com/intel/intel-graphics-compiler +Source0: igc-%{version}.tar.gz + +#This package is x86 only +ExclusiveArch: x86_64 + +# Details for building igc tree +# +# |- igc https://github.com/intel/intel-graphics-compiler, tag: igc-1.0.14828.26 +# |- vc-intrinsics https://github.com/intel/vc-intrinsics, tag: v0.13.0 +# |- SPIRV-Tools https://github.com/KhronosGroup/SPIRV-Tools, main/8ee3ae5244f5 +# |- SPIRV-Headers https://github.com/KhronosGroup/SPIRV-Headers, main/be3c81e3fdd1 +# |- llvm-project https://github.com/llvm/llvm-project, release/14.x, tag: llvmorg-14.0.5 +# |- llvm/projects/opencl-clang https://github.com/intel/opencl-clang, ocl-open-140/980f1691c5ba +# |- llvm/projects/llvm-spirv https://github.com/KhronosGroup/SPIRV-LLVM-Translator, llvm_release_140/9f4955693403 + +BuildRequires: cmake gcc-c++ make patch flex bison python3 pkg-config +BuildRequires: libxml2-devel git valgrind python3-mako spirv-tools-devel + +%description +Intel(R) Graphics compiler for OpenCL(TM) +The Intel(R) Graphics Compiler for OpenCL(TM) is an llvm based compiler +for OpenCL(TM) targeting Intel Gen graphics hardware architecture. + +%package -n intel-igc-core +Summary: Intel(R) Graphics Compiler Core +%description -n intel-igc-core +Intel graphics compiler for OpenCL -- core libs +The Intel(R) Graphics Compiler for OpenCL(TM) is an llvm based compiler +for OpenCL(TM) targeting Intel Gen graphics hardware architecture. +This package includes the core libraries. + +%package -n intel-igc-opencl +Summary: Intel(R) Graphics Compiler Frontend +Requires: intel-igc-core = %{version} +%description -n intel-igc-opencl +Intel graphics compiler for OpenCL -- OpenCL library +The Intel(R) Graphics Compiler for OpenCL(TM) is an llvm based compiler +for OpenCL(TM) targeting Intel Gen graphics hardware architecture. +This package includes the library for OpenCL. + +%package -n intel-igc-opencl-devel +Summary: Intel(R) Graphics Compiler development package +Requires: intel-igc-opencl = %{version} +%description -n intel-igc-opencl-devel +Intel graphics compiler for OpenCL -- OpenCL development files +The Intel(R) Graphics Compiler for OpenCL(TM) is an llvm based compiler +for OpenCL(TM) targeting Intel Gen graphics hardware architecture. +This package includes files for IGC OpenCL development. + +%prep +%autosetup -p1 -n igc-%{version} + +%build +mkdir build +pushd build +cmake ../igc \ + -Wno-dev \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=%{_prefix} \ + -DLLVM_ENABLE_Z3_SOLVER=OFF \ + -DIGC_OPTION__ARCHITECTURE_TARGET=Linux64 \ + -DIGC_OPTION__LLVM_MODE=Source \ + -DIGC_OPTION__LLVM_SOURCES_DIR=%{_builddir}/igc-%{version}/llvm-project/ \ + -DIGC_OPTION__SPIRV_TOOLS_MODE=Source \ + -DLLVM_EXTERNAL_SPIRV_HEADERS_SOURCE_DIR=%{_builddir}/igc-%{version}/SPIRV-Headers +%make_build +popd + +%install +pushd build +%make_install +rm -fv $RPM_BUILD_ROOT/usr/bin/GenX_IR +rm -fv $RPM_BUILD_ROOT/usr/bin/clang-%{so_ver} +rm -fv $RPM_BUILD_ROOT/usr/bin/lld +# Change permissions otherwise opencl install will fail +chmod +x $RPM_BUILD_ROOT/usr/lib64/libopencl-clang.so.%{so_ver} +popd + +%files -n intel-igc-core +%defattr(-,root,root) +%license ./igc/LICENSE.md +/usr/lib64/libiga64.so.* +/usr/lib64/libigc.so.* +/usr/bin/iga64 + +%files -n intel-igc-opencl +%defattr(-,root,root) +%license ./igc/LICENSE.md +/usr/lib64/libopencl-clang.so.%{so_ver} +/usr/lib64/libigdfcl.so.* +/usr/include/opencl-c.h +/usr/include/opencl-c-base.h + +%files -n intel-igc-opencl-devel +%defattr(-,root,root) +/usr/include/igc/* +/usr/include/iga/* +/usr/include/visa/* +/usr/lib64/libiga64.so +/usr/lib64/libigc.so +/usr/lib64/libigdfcl.so +/usr/lib64/pkgconfig/* +/usr/lib64/igc/NOTICES.txt + +%changelog +* Thu Nov 16 2023 Aubrey Li - 1.0.14828.26-1 +- Initial spec file -- Gitee From 36913d685646ab9bf309fa1ab14dd2a25ae79e95 Mon Sep 17 00:00:00 2001 From: Aubrey Li Date: Thu, 7 Dec 2023 15:01:24 +0800 Subject: [PATCH 2/2] Change CFLAGS and CXXFLAGS to bypass all warnings as errors Change CFLAGS and CXXFLAGS to bypass all warnings as errors on Anolis23 Signed-off-by: Aubrey Li --- igc.spec | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/igc.spec b/igc.spec index 2a75135..7112037 100644 --- a/igc.spec +++ b/igc.spec @@ -68,6 +68,12 @@ This package includes files for IGC OpenCL development. %autosetup -p1 -n igc-%{version} %build +export CFLAGS="$CFLAGS -Wno-unused-but-set-variable -Wno-unused-variable" +export CXXFLAGS="$CXXFLAGS -Wno-reorder -Wno-restrict -Wno-catch-value -Wno-unused-but-set-variable -Wno-class-memaccess -Wno-parentheses -Wno-unused-variable -Wno-unused-function -Wno-comment -Wno-pessimizing-move -Wno-range-loop-construct -Wno-sequence-point -Wno-misleading-indentation -Wno-int-in-bool-context -Wno-delete-non-virtual-dtor -Wno-sizeof-array-div -Wno-stringop-truncation -Wno-nonnull-compare -Wno-array-bounds -Wno-odr -Wno-unused-local-typedefs" + +export CFLAGS=`echo $CFLAGS | %{__sed} 's/ -flto=auto -ffat-lto-objects//'` +export CXXFLAGS=`echo $CXXFLAGS | %{__sed} 's/ -flto=auto -ffat-lto-objects//'` + mkdir build pushd build cmake ../igc \ -- Gitee