代码拉取完成,页面将自动刷新
# Copyright (C) 2023 Intel Corporation
# SPDX-License-Identifier: MIT
%global pkg_name intel-cm-compiler
%global lib_ver 1.0.144
%global openeuler_release 1
Name: %{pkg_name}
Version: %{lib_ver}
Release: %{openeuler_release}%{?dist}
Summary: Intel(R) C for Metal Compiler
License: MIT
Group: System Environment/Libraries
URL: https://github.com/intel/cm-compiler
Source0: %{name}-%{version}.tar.gz
#This package is x86 only
ExclusiveArch: x86_64
# Details for building intel-cm-compiler tree
#<workspace>
# |- cmclang https://github.com/intel/cm-compiler/archive/22f9dbf8bd44/cmclang.tar.gz
# |- spirv-llvm https://github.com/KhronosGroup/SPIRV-LLVM-Translator/archive/26db0ab3f4ea/spirv-llvm.tar.gz
# |- vc-intrinsics https://github.com/intel/vc-intrinsics/archive/v0.14.0/vc-intrinsics.tar.gz
BuildRequires: bison cmake make patch gcc-c++ flex python3
BuildRequires: pkg-config libxml2-devel git valgrind
%description
Intel(R) C for Metal Compiler -- CM Frontend lib
The Intel(R) C for Metal compiler is a open source compiler that implements C
for Metal programming language. C for Metal is a new GPU kernel programming
language for Intel(R) Graphics.
%package -n intel-igc-cm
Summary: Intel(R) C for Metal Compiler
Requires: intel-igc-core >= 1.0.12812
%description -n intel-igc-cm
Intel(R) C for Metal Compiler -- CM Frontend lib
The Intel(R) C for Metal compiler is a open source compiler that implements C
for Metal programming language. C for Metal is a new GPU kernel programming
language for Intel(R) Graphics.
%prep
%autosetup -n %{name}-%{version}
%build
export CFLAGS="${RPM_OPT_FLAGS}"
export CXXFLAGS="${RPM_OPT_FLAGS}"
mkdir build-llvm
mkdir install
pushd build-llvm
cmake ../cmclang/llvm \
-Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_builddir}/install \
-DLLVM_INCLUDE_TOOLS=OFF \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_INSTALL_TOOLCHAIN_ONLY=OFF \
-DLLVM_ENABLE_TERMINFO=OFF \
-DLLVM_ENABLE_Z3_SOLVER=OFF \
-DLLVM_TARGETS_TO_BUILD="X86"
%make_build
make install
popd
mkdir build-vcint
pushd build-vcint
cmake ../vc-intrinsics \
-Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_builddir}/install \
-DLLVM_DIR=%{_builddir}/install/lib/cmake/llvm
%make_build
make install
popd
mkdir build-spirv
pushd build-spirv
cmake ../spirv-llvm \
-Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_builddir}/install \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DLLVM_DIR=%{_builddir}/install/lib/cmake/llvm
%make_build
make install
popd
mkdir build_cmclang
pushd build_cmclang
cmake ../cmclang/clang \
-Wno-dev \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=%{_builddir}/install \
-DCLANG_ANALYZER_ENABLE_Z3_SOLVER=FALSE \
-DLLVMGenXIntrinsics_DIR=%{_builddir}/install/lib/cmake/LLVMGenXIntrinsics \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_DIR=%{_builddir}/install/lib/cmake/llvm \
-DSPIRV_TRANSLATOR_DIR=%{_builddir}/install \
-DFEWRAPPER_VERSION=%{version}
%make_build
make install
popd
%install
mkdir -p %{buildroot}%{_libdir}
mkdir -p %{buildroot}%{_bindir}
cp -aR %{_builddir}/install/lib/libclangFEWrapper.so* %{buildroot}%{_libdir}
cp -aR %{_builddir}/install/bin/cmc %{buildroot}%{_bindir}
rm -f cmclang/clang/lib/Headers/cm/include/*.txt
mkdir -p %{buildroot}%{_includedir}
cp -R cmclang/clang/lib/Headers/cm/include/* %{buildroot}%{_includedir}
%files -n intel-igc-cm
%defattr(-,root,root)
%license cmclang/clang/LICENSE.TXT
%{_bindir}/cmc
%{_libdir}/libclangFEWrapper.so*
%{_includedir}/*
%changelog
* Fri Dec 8 2023 Aubrey Li <aubrey.li@linux.intel.com> - 1.0.144-1
- Initial spec file
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。