summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-08-24 12:12:23 +0000
committerCoprDistGit <infra@openeuler.org>2023-08-24 12:12:23 +0000
commit816f5f0097c9705b7500c73eeb8f01b6fb0463df (patch)
treee91e613b00f45505999f2a0b3423b85f198bea55
parent1853315e78dafec4e111737b9eb0cd761ba35faa (diff)
automatic import of onnxruntime
-rw-r--r--.gitignore1
-rw-r--r--onnxruntime.spec74
-rw-r--r--sources1
3 files changed, 76 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..b34a740 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/v1.15.1.zip
diff --git a/onnxruntime.spec b/onnxruntime.spec
new file mode 100644
index 0000000..acc0638
--- /dev/null
+++ b/onnxruntime.spec
@@ -0,0 +1,74 @@
+%define debug_package %{nil}
+Name: onnxruntime
+Version: 1.15.1
+Release: 1
+Summary: Cross-Platform Accelerated Machine Learning
+License: MIT
+URL: https://onnxruntime.ai/
+Source0: https://github.com/microsoft/onnxruntime/archive/refs/tags/v1.15.1.zip
+BuildRoot: %{_buildrootdir}
+#编译所需包(按照文档写的)
+BuildRequires: cmake gcc gcc-c++ python3 git python-numpy python-packaging
+#安装所需包(感觉没啥需要的?)
+Requires: bash
+Provides: onnxruntime-python-API
+
+%description
+ONNX Runtime is a cross-platform machine-learning model accelerator, with a
+flexible interface to integrate hardware-specific libraries. ONNX Runtime can be used with
+models from PyTorch, Tensorflow/Keras, TFLite, scikit-learn, and other frameworks.
+
+
+%prep
+unzip -q -o ../SOURCES/%{name}-%{version}.zip -d ../BUILD
+
+
+
+%build
+#env
+cd %{name}-%{version}
+source /usr/local/Ascend/ascend-toolkit/set_env.sh
+#export CPLUS_INCLUDE_PATH=/usr/local/Ascend/ascend-toolkit/latest/fwkacllib/include:$CPLUS_INCLUDE_PATH
+#export CPLUS_INCLUDE_PATH=/usr/local/lib64/python3.9/site-packages/numpy/core/include:$CPLUS_INCLUDE_PATH
+#ln -s /usr/local/Ascend/ascendtoolkit/latest/x86_64-Linux/1ib64/libascendcl.so /usr/lib/libascendcl.so
+#ln -s /usr/local/Ascend/ascendtoolkit/latest/x86_64-Linux/1ib64//libfmk_onnx_parser.so /usr/lib//libfmk_onnx_parser.so
+#ln -s /usr/local/Ascend/ascendtoolkit/latest/x86_64-Linux/1ib64/libacl_op_compiler.so /usr/lib/libacl_op_compiler.so
+
+git init . && bash build.sh --config Release --build_shared_lib --use_cann --parallel --allow_running_as_root --skip_tests --build_wheel --build_dir build/NPU --cann_home /usr/local/Ascend/ascend-toolkit
+
+
+
+%install
+if [ ! -d %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime ]; then
+ mkdir -p %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime
+fi
+
+cp -r %{_builddir}/%{name}-%{version}/build/Linux/Release/onnxruntime/backend %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime/
+cp -r %{_builddir}/%{name}-%{version}/build/Linux/Release/onnxruntime/datasets %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime/
+cp -r %{_builddir}/%{name}-%{version}/build/Linux/Release/onnxruntime/quantization %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime/
+cp -r %{_builddir}/%{name}-%{version}/build/Linux/Release/onnxruntime/tools %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime/
+cp -r %{_builddir}/%{name}-%{version}/build/Linux/Release/onnxruntime/transformers %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime/
+cp -r %{_builddir}/%{name}-%{version}/build/Linux/Release/onnxruntime/__init__.py %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime/
+cp -r %{_builddir}/%{name}-%{version}/build/Linux/Release/onnxruntime/LICENSE %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime/
+cp -r %{_builddir}/%{name}-%{version}/build/Linux/Release/onnxruntime/Privacy.md %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime/
+cp -r %{_builddir}/%{name}-%{version}/build/Linux/Release/onnxruntime/ThirdPartyNotices.txt %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime/
+
+#cp -r %{_builddir}/%{name}-%{version}/build/CPU/Release/onnxruntime/* %{_buildrootdir}/%{name}-%{version}-%{release}.%{_arch}%{python3_sitelib}/onnxruntime
+
+
+%files
+%{python3_sitelib}/onnxruntime/backend
+%{python3_sitelib}/onnxruntime/datasets
+%{python3_sitelib}/onnxruntime/quantization
+%{python3_sitelib}/onnxruntime/tools
+%{python3_sitelib}/onnxruntime/transformers
+%{python3_sitelib}/onnxruntime/__init__.py
+%{python3_sitelib}/onnxruntime/LICENSE
+%{python3_sitelib}/onnxruntime/Privacy.md
+%{python3_sitelib}/onnxruntime/ThirdPartyNotices.txt
+
+
+
+%changelog
+* Fri Aug 10 2023 lisiwen <2022111134@bupt.edu.cn>
+- init package
diff --git a/sources b/sources
new file mode 100644
index 0000000..781115e
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+faa3c349196ea71eccc73069c04b58a4 v1.15.1.zip