27 Star 0 Fork 1

src-openEuler/intel-cm-compiler

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
intel-cm-compiler.spec 3.54 KB
一键复制 编辑 原始数据 按行查看 历史
# 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
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/intel-cm-compiler.git
git@gitee.com:src-openeuler/intel-cm-compiler.git
src-openeuler
intel-cm-compiler
intel-cm-compiler
master

搜索帮助