Skip to content

Commit

Permalink
[ONNX runtime] Update for powerpc
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodozov committed Apr 14, 2020
1 parent 3bffa0b commit 675cbe1
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 11 deletions.
11 changes: 3 additions & 8 deletions onnxruntime.spec
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
### RPM external onnxruntime 1.0.0
## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES}
%define tag 0f048da7774428d5fb2c4c808fc5820809ab24b8
%define branch cms/v1.0.0_pb380
%define tag 9cc0b816f299d326e75f882123d6b2c370328156
%define branch cms/v1.2.0_plus_ppc_update
%define github_user cms-externals
Source: git+https://github.com/%{github_user}/%{n}.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&submodules=1&output=/%{n}-%{realversion}.tgz

BuildRequires: cmake ninja
Requires: protobuf py3-numpy py2-onnx zlib libpng
Requires: protobuf py3-numpy py2-wheel py2-onnx zlib libpng

%prep
%setup -n %{n}-%{realversion}
Expand All @@ -19,16 +19,12 @@ cmake ../%{n}-%{realversion}/cmake -GNinja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="%{i}" \
-DCMAKE_INSTALL_LIBDIR=lib \
-Donnxruntime_BUILD_UNIT_TESTS=ON \
-Donnxruntime_ENABLE_PYTHON=ON \
-Donnxruntime_BUILD_SHARED_LIB=ON \
-Donnxruntime_USE_CUDA=OFF \
-Donnxruntime_USE_NSYNC=OFF \
-Donnxruntime_BUILD_CSHARP=OFF \
-Donnxruntime_USE_AUTOML=OFF \
-Donnxruntime_USE_EIGEN_FOR_BLAS=ON \
-Donnxruntime_USE_OPENBLAS=OFF \
-Donnxruntime_USE_MKLDNN=OFF \
-Donnxruntime_USE_MKLML=OFF \
-Donnxruntime_USE_NGRAPH=OFF \
-Donnxruntime_USE_OPENMP=OFF \
Expand All @@ -37,7 +33,6 @@ cmake ../%{n}-%{realversion}/cmake -GNinja \
-Donnxruntime_ENABLE_MICROSOFT_INTERNAL=OFF \
-Donnxruntime_USE_BRAINSLICE=OFF \
-Donnxruntime_USE_NUPHAR=OFF \
-Donnxruntime_USE_EIGEN_THREADPOOL=OFF \
-Donnxruntime_USE_TENSORRT=OFF \
-Donnxruntime_CROSS_COMPILING=OFF \
-Donnxruntime_USE_FULL_PROTOBUF=ON \
Expand Down
5 changes: 3 additions & 2 deletions pip/onnx.file
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Requires: cmake py2-numpy protobuf py2-protobuf py2-six py2-typing_extensions
Requires: py3-numpy py2-pytest-runner
Requires: cmake py2-numpy protobuf py2-protobuf py2-six py2-typing_extensions py3-numpy py2-pytest-runner
Patch0: py2-onnx

%define PipPreBuild export ONNX_ML=1
%define RelocatePython %{i}/bin/*
2 changes: 1 addition & 1 deletion protobuf.spec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### RPM external protobuf 3.8.0
### RPM external protobuf 3.11.4
## INITENV SETV PROTOBUF_SOURCE %{source0}
## INITENV SETV PROTOBUF_STRIP_PREFIX %{source_prefix}
#============= IMPORTANT NOTE ========================#
Expand Down
13 changes: 13 additions & 0 deletions py2-onnx.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8351a52..613ea76 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -226,7 +226,7 @@ function(RELATIVE_PROTOBUF_GENERATE_CPP NAME SRCS HDRS ROOT_DIR DEPEND)
${ONNX_DLLEXPORT_STR}${CMAKE_CURRENT_BINARY_DIR})
if(BUILD_ONNX_PYTHON)
list(APPEND PROTOC_ARGS --python_out
- ${ONNX_DLLEXPORT_STR}${CMAKE_CURRENT_BINARY_DIR})
+ ${CMAKE_CURRENT_BINARY_DIR})
if(ONNX_GEN_PB_TYPE_STUBS)
# Haven't figured out how to generate mypy stubs on Windows yet
if(NOT WIN32)

0 comments on commit 675cbe1

Please sign in to comment.