加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
AI4C.spec 3.73 KB
一键复制 编辑 原始数据 按行查看 历史
hyongkang 提交于 2024-12-12 08:49 . Update description
%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 to integrate ML-driven compiler optimization.
Name: AI4C
Version: 0.2.0
Release: 2
# 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
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 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
* Thu Dec 12 2024 Yongkang Hou <houyongkang@inspur.com> - 0.2.0-2
- Update description.
* Wed Aug 14 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 0.2.0-1
- Update AI4C from v0.1.0 to v0.2.0.
* Tue Aug 06 2024 Feiyang Liu <liufeiyang6@huawei.com> - 0.1.0-5
- Remove path dependencies for building AI4Compiler framework
* Wed Jul 24 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 0.1.0-4
- Update-block-correction-model.patch
* Tue Jul 23 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 0.1.0-3
- Bugfix-for-tensor-formation-and-update-block-correct
* Fri Jun 21 2024 Feiyang Liu <liufeiyang6@huawei.com> - 0.1.0-2
- Add batch inference feature and optimizer model
* Wed Jun 5 2024 Zhenyu Zhao <zhaozhenyu17@huawei.com> - 0.1.0-1
- Release 0.1.0
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化