!3 [sync] PR-2: [init] init the repo
From: @openeuler-sync-bot Reviewed-by: @wumingchuan Signed-off-by: @wumingchuan
This commit is contained in:
commit
eb462879a4
BIN
AI4C-v0.1.0-alpha.tar.gz
Normal file
BIN
AI4C-v0.1.0-alpha.tar.gz
Normal file
Binary file not shown.
103
AI4C.spec
Normal file
103
AI4C.spec
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
Summary: %{name}-v%{version}-alpha is a framework which enables compilers compilers to integrate ML-driven compiler optimization.
|
||||||
|
Name: AI4C
|
||||||
|
Version: 0.1.0
|
||||||
|
Release: 1
|
||||||
|
# onnxruntime and SafeInt are MIT
|
||||||
|
# onnx is Apache License 2.0
|
||||||
|
License: MIT and ASL 2.0 and Boost and BSD
|
||||||
|
URL: https://gitee.com/openeuler/AI4C
|
||||||
|
Source0: %{name}-v%{version}-alpha.tar.gz
|
||||||
|
|
||||||
|
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}-v%{version}-alpha is a framework which enables compilers compilers to integrate ML-driven compiler optimization.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
tar -xzf %{SOURCE0} -C .
|
||||||
|
|
||||||
|
%build
|
||||||
|
## construct cmake
|
||||||
|
cd %{_builddir}/%{name}-v%{version}-alpha/third_party/cmake-3.28.5
|
||||||
|
mkdir build
|
||||||
|
cd build
|
||||||
|
cmake .. -DCMAKE_INSTALL_PREFIX=./install
|
||||||
|
make install
|
||||||
|
|
||||||
|
# Broken test in aarch64
|
||||||
|
cd %{_builddir}/%{name}-v%{version}-alpha/third_party/onnxruntime-1.16.3
|
||||||
|
%ifarch aarch64
|
||||||
|
rm -v onnxruntime/test/optimizer/nhwc_transformer_test.cc
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%{_builddir}/%{name}-v%{version}-alpha/third_party/cmake-3.28.5/build/install/bin/cmake \
|
||||||
|
-DCMAKE_INSTALL_LIBDIR=%{_lib} \
|
||||||
|
-DCMAKE_INSTALL_INCLUDEDIR=include \
|
||||||
|
-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=ON \
|
||||||
|
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
|
||||||
|
-S cmake
|
||||||
|
make
|
||||||
|
|
||||||
|
mkdir -p %{_builddir}/%{name}-v%{version}-alpha/aiframe/lib64/
|
||||||
|
cd %{_builddir}/%{name}-v%{version}-alpha/third_party/onnxruntime-1.16.3
|
||||||
|
cp libonnxruntime.so.1.16.3 %{_builddir}/%{name}-v%{version}-alpha/aiframe/lib64/
|
||||||
|
cp libonnxruntime.so %{_builddir}/%{name}-v%{version}-alpha/aiframe/lib64/
|
||||||
|
cp include/onnxruntime/core/session/onnxruntime_c_api.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp include/onnxruntime/core/session/onnxruntime_cxx_api.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp include/onnxruntime/core/session/onnxruntime_cxx_inline.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp include/onnxruntime/core/session/onnxruntime_float16.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp include/onnxruntime/core/session/onnxruntime_run_options_config_keys.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp include/onnxruntime/core/session/onnxruntime_session_options_config_keys.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp include/onnxruntime/core/providers/cpu/cpu_provider_factory.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp include/onnxruntime/core/session/onnxruntime_lite_custom_op.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp include/onnxruntime/core/framework/provider_options.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp orttraining/orttraining/training_api/include/onnxruntime_training_cxx_api.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp orttraining/orttraining/training_api/include/onnxruntime_training_cxx_inline.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
cp orttraining/orttraining/training_api/include/onnxruntime_training_c_api.h %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/
|
||||||
|
|
||||||
|
|
||||||
|
## construct ONNXRunner.so
|
||||||
|
cd %{_builddir}/%{name}-v%{version}-alpha/aiframe
|
||||||
|
cmake .
|
||||||
|
make
|
||||||
|
mv ./libONNXRunner.so ./lib64
|
||||||
|
|
||||||
|
%install
|
||||||
|
mkdir -p %{buildroot}%{_libdir}
|
||||||
|
cp %{_builddir}/%{name}-v%{version}-alpha/models/* %{buildroot}%{_libdir}/
|
||||||
|
|
||||||
|
cp %{_builddir}/%{name}-v%{version}-alpha/aiframe/lib64/* %{buildroot}%{_libdir}/
|
||||||
|
mkdir -p %{buildroot}%{_includedir}
|
||||||
|
cp %{_builddir}/%{name}-v%{version}-alpha/aiframe/include/* %{buildroot}%{_includedir}
|
||||||
|
%files
|
||||||
|
#%license LICENSE
|
||||||
|
#%doc ThirdPartyNotices.txt
|
||||||
|
%{_libdir}/*
|
||||||
|
%{_includedir}/*
|
||||||
|
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Wed Jun 5 2024 Zhenyu Zhao <zhaozhenyu17@huaewei.com> - 0.1.0-1
|
||||||
|
- Release 0.1.0
|
||||||
Loading…
x
Reference in New Issue
Block a user