!27 [Sync] Sync patch from 2203-SP4
From: @zhenyu--zhao_admin Reviewed-by: @liuf9 Signed-off-by: @liuf9
This commit is contained in:
commit
1a8b8da626
7035
0001-add-interface-and-model-for-Auto-LTO.patch
Normal file
7035
0001-add-interface-and-model-for-Auto-LTO.patch
Normal file
File diff suppressed because it is too large
Load Diff
13554
0002-update-auto-lto-model.patch
Normal file
13554
0002-update-auto-lto-model.patch
Normal file
File diff suppressed because it is too large
Load Diff
BIN
AI4C-v0.2.0-alpha.tar.gz
Normal file
BIN
AI4C-v0.2.0-alpha.tar.gz
Normal file
Binary file not shown.
110
AI4C.spec
Normal file
110
AI4C.spec
Normal file
@ -0,0 +1,110 @@
|
||||
%global pkg_version %{name}-v%{version}-alpha
|
||||
|
||||
%global build_dir %{_builddir}/%{pkg_version}
|
||||
%global build_dir_dep %{build_dir}/third_party
|
||||
%global build_dir_frm %{build_dir}/aiframe/build
|
||||
%global build_libdir %{build_dir_frm}/%{_lib}
|
||||
%global build_includedir %{build_dir_frm}/include
|
||||
%global build_dir_model %{build_libdir}/%{name}
|
||||
|
||||
%global install_libdir %{buildroot}%{_libdir}
|
||||
%global install_dir_model %{install_libdir}/%{name}
|
||||
|
||||
%global max_jobs 16
|
||||
|
||||
Summary: %{name} is a framework which enables compilers compilers to integrate ML-driven compiler optimization.
|
||||
Name: AI4C
|
||||
Version: 0.2.0
|
||||
Release: 1
|
||||
# Package onnxruntime and SafeInt have MIT License.
|
||||
# Package onnx has Apache License 2.0.
|
||||
License: MIT and ASL 2.0 and Boost and BSD
|
||||
URL: https://gitee.com/openeuler/AI4C
|
||||
Source0: %{pkg_version}.tar.gz
|
||||
|
||||
Patch1: 0001-add-interface-and-model-for-Auto-LTO.patch
|
||||
Patch2: 0002-update-auto-lto-model.patch
|
||||
|
||||
BuildRequires: cmake >= 3.13
|
||||
BuildRequires: make
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: abseil-cpp-devel
|
||||
BuildRequires: boost-devel >= 1.66
|
||||
BuildRequires: bzip2
|
||||
BuildRequires: python3-devel
|
||||
BuildRequires: python3-numpy
|
||||
BuildRequires: python3-setuptools
|
||||
BuildRequires: python3-pip
|
||||
BuildRequires: openssl
|
||||
BuildRequires: openssl-devel
|
||||
|
||||
|
||||
%description
|
||||
%{name} is a framework which enables compilers compilers to integrate ML-driven compiler optimization.
|
||||
|
||||
%prep
|
||||
tar -xzf %{SOURCE0} -C .
|
||||
|
||||
%autosetup -S git -n %{pkg_version}
|
||||
|
||||
%build
|
||||
# Construct dependency package `cmake`
|
||||
cd %{build_dir_dep}/cmake
|
||||
mkdir -p build && cd build
|
||||
cmake .. -DCMAKE_INSTALL_PREFIX=./install
|
||||
make install -j %{max_jobs}
|
||||
|
||||
# Broken test in aarch64 architecture.
|
||||
cd %{build_dir_dep}/onnxruntime
|
||||
%ifarch aarch64
|
||||
rm -v onnxruntime/test/optimizer/nhwc_transformer_test.cc
|
||||
%endif
|
||||
|
||||
# Construct dependency package `onnxruntime`.
|
||||
mkdir -p %{build_libdir}
|
||||
mkdir -p %{build_includedir}
|
||||
%{build_dir_dep}/cmake/build/install/bin/cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=%{build_dir_frm} \
|
||||
-DCMAKE_INSTALL_LIBDIR=%{build_libdir} \
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=%{build_includedir} \
|
||||
-Donnxruntime_BUILD_SHARED_LIB=ON \
|
||||
-Donnxruntime_BUILD_UNIT_TESTS=ON \
|
||||
-Donnxruntime_INSTALL_UNIT_TESTS=OFF \
|
||||
-Donnxruntime_BUILD_BENCHMARKS=OFF \
|
||||
-Donnxruntime_USE_FULL_PROTOBUF=ON \
|
||||
-DPYTHON_VERSION=%{python3_version} \
|
||||
-Donnxruntime_ENABLE_CPUINFO=ON \
|
||||
-Donnxruntime_DISABLE_ABSEIL=ON \
|
||||
-Donnxruntime_USE_NEURAL_SPEED=OFF \
|
||||
-Donnxruntime_ENABLE_PYTHON=OFF \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
-S cmake
|
||||
make -j %{max_jobs} && make install
|
||||
|
||||
# Construct AI4C library `libONNXRunner.so`.
|
||||
cd %{build_dir_frm}
|
||||
cmake \
|
||||
-DCMAKE_INSTALL_PREFIX=%{build_dir_frm} \
|
||||
-Donnxruntime_ROOTDIR=%{build_dir_frm} \
|
||||
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||
../
|
||||
make -j %{max_jobs} && make install
|
||||
|
||||
%install
|
||||
install -d %{install_dir_model}
|
||||
install %{build_dir_model}/* -t %{install_dir_model}
|
||||
install %{build_libdir}/libonnxruntime.so* -t %{install_libdir}
|
||||
install %{build_libdir}/libONNXRunner.so -t %{install_libdir}
|
||||
pushd %{install_libdir}
|
||||
ln -sf libonnxruntime.so.1.* libonnxruntime.so
|
||||
popd
|
||||
|
||||
|
||||
%files
|
||||
%attr(0755,root,root) %{_libdir}/*
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Nov 25 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 0.2.0-1
|
||||
- Sync patch from 22.03 SP4.
|
||||
Loading…
x
Reference in New Issue
Block a user