diff --git a/cmssw-tool-conf.spec b/cmssw-tool-conf.spec index ff60b8f1b4f..782e9b5154a 100644 --- a/cmssw-tool-conf.spec +++ b/cmssw-tool-conf.spec @@ -87,9 +87,7 @@ Requires: valgrind-toolfile Requires: cmsswdata-toolfile Requires: zstd-toolfile Requires: hls-toolfile -%ifnarch ppc64le Requires: onnxruntime-toolfile -%endif Requires: hdf5-toolfile Requires: rivet-toolfile diff --git a/eigen-altivec-fix.patch b/eigen-altivec-fix.patch new file mode 100644 index 00000000000..2d15e9f36cf --- /dev/null +++ b/eigen-altivec-fix.patch @@ -0,0 +1,13 @@ +diff --git a/Eigen/src/Core/arch/AltiVec/PacketMath.h b/Eigen/src/Core/arch/AltiVec/PacketMath.h +index 9464264..eda73ec 100755 +--- a/Eigen/src/Core/arch/AltiVec/PacketMath.h ++++ b/Eigen/src/Core/arch/AltiVec/PacketMath.h +@@ -452,7 +452,7 @@ template<> EIGEN_STRONG_INLINE Packet4f pandnot(const Packet4f& a, con + template<> EIGEN_STRONG_INLINE Packet4i pandnot(const Packet4i& a, const Packet4i& b) { return vec_and(a, vec_nor(b, b)); } + + template<> EIGEN_STRONG_INLINE Packet4f pselect(const Packet4f& mask, const Packet4f& a, const Packet4f& b) { +- return vec_sel(b, a, mask); ++ return vec_sel(b, a, reinterpret_cast(mask)); + } + + template<> EIGEN_STRONG_INLINE Packet4f pround(const Packet4f& a) { return vec_round(a); } diff --git a/eigen.spec b/eigen.spec index 4eeafd9e266..231317c4bfa 100644 --- a/eigen.spec +++ b/eigen.spec @@ -11,9 +11,11 @@ %define source_prefix eigen-git-mirror-%{tag} Source: %{source0} BuildRequires: cmake +Patch0: eigen-altivec-fix %prep %setup -n %{source_prefix} +%patch0 -p1 %build mkdir build diff --git a/onnxruntime.spec b/onnxruntime.spec index 825a6fbbf98..4e167fa34a4 100644 --- a/onnxruntime.spec +++ b/onnxruntime.spec @@ -1,12 +1,12 @@ -### RPM external onnxruntime 1.0.0 +### RPM external onnxruntime 1.2.0 ## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES} -%define tag 0f048da7774428d5fb2c4c808fc5820809ab24b8 -%define branch cms/v1.0.0_pb380 +%define tag 8679719d81d0d77762d642d00717b189990b4a88 +%define branch cms/v1.2.0_plus_ppc_update_pb31130 %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 py2-pybind11 %prep %setup -n %{n}-%{realversion} @@ -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 \ @@ -37,14 +33,13 @@ 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 \ -Donnxruntime_DISABLE_CONTRIB_OPS=OFF \ -Donnxruntime_USE_PREINSTALLED_PROTOBUF=ON \ - -Dprotobuf_INSTALL_PATH=${PROTOBUF_ROOT} \ - -DCMAKE_PREFIX_PATH="${ZLIB_ROOT};${LIBPNG_ROOT}" + -Donnxruntime_PREFER_SYSTEM_LIB=ON \ + -DCMAKE_PREFIX_PATH="${ZLIB_ROOT};${LIBPNG_ROOT};${PROTOBUF_ROOT};${PY2_PYBIND11_ROOT}" ninja -v %{makeprocesses} -l $(getconf _NPROCESSORS_ONLN) python3 ../%{n}-%{realversion}/setup.py build diff --git a/pip/onnx.file b/pip/onnx.file index d947e71ae08..85b138a4433 100644 --- a/pip/onnx.file +++ b/pip/onnx.file @@ -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/* diff --git a/protobuf.spec b/protobuf.spec index 3da007182cb..63f3e97ed5b 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -1,4 +1,4 @@ -### RPM external protobuf 3.8.0 +### RPM external protobuf 3.11.3 ## INITENV SETV PROTOBUF_SOURCE %{source0} ## INITENV SETV PROTOBUF_STRIP_PREFIX %{source_prefix} #============= IMPORTANT NOTE ========================# @@ -17,22 +17,31 @@ Source: %{source0} Requires: zlib -BuildRequires: autotools +BuildRequires: cmake ninja %prep %setup -n %{source_prefix} %build -./autogen.sh +rm -rf ../build +mkdir ../build +cd ../build -./configure --prefix %{i} \ - --disable-static \ - --disable-dependency-tracking \ - CXXFLAGS="-I${ZLIB_ROOT}/include" \ - CFLAGS="-I${ZLIB_ROOT}/include" \ - LDFLAGS="-L${ZLIB_ROOT}/lib" -make %{makeprocesses} +cmake ../%{n}-%{realversion}/cmake \ + -G Ninja \ + -DCMAKE_INSTALL_PREFIX="%{i}" \ + -Dprotobuf_BUILD_TESTS=OFF \ + -Dprotobuf_BUILD_SHARED_LIBS=ON \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DCMAKE_CXX_FLAGS="-I${ZLIB_ROOT}/include" \ + -DCMAKE_C_FLAGS="-I${ZLIB_ROOT}/include" \ + -DCMAKE_SHARED_LINKER_FLAGS="-L${ZLIB_ROOT}/lib" \ + -DCMAKE_PREFIX_PATH="${ZLIB_ROOT}" + +ninja -v %{makeprocesses} -l $(getconf _NPROCESSORS_ONLN) %install -make install + +cd ../build +ninja -v %{makeprocesses} -l $(getconf _NPROCESSORS_ONLN) install rm -rf %{i}/lib/pkgconfig diff --git a/py2-onnx.patch b/py2-onnx.patch new file mode 100644 index 00000000000..34100c82f8a --- /dev/null +++ b/py2-onnx.patch @@ -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)