diff --git a/cmssw-tool-conf.spec b/cmssw-tool-conf.spec index df82914d3af..f411c06216d 100644 --- a/cmssw-tool-conf.spec +++ b/cmssw-tool-conf.spec @@ -87,6 +87,7 @@ Requires: valgrind-toolfile Requires: cmsswdata-toolfile Requires: zstd-toolfile Requires: hls-toolfile +Requires: opencv-toolfile Requires: grpc-toolfile Requires: onnxruntime-toolfile diff --git a/opencv-toolfile.spec b/opencv-toolfile.spec new file mode 100644 index 00000000000..367c8fe96ab --- /dev/null +++ b/opencv-toolfile.spec @@ -0,0 +1,27 @@ +### RPM external opencv-toolfile 1.0 +Requires: opencv +%prep + +%build + +%install + +mkdir -p %i/etc/scram.d +cat << \EOF_TOOLFILE >%i/etc/scram.d/opencv.xml + + + + + + + + + + + + + + +EOF_TOOLFILE + +## IMPORT scram-tools-post diff --git a/opencv.spec b/opencv.spec new file mode 100644 index 00000000000..5bf45e00e8c --- /dev/null +++ b/opencv.spec @@ -0,0 +1,37 @@ +### RPM external opencv 4.3.0 +## INITENV +PATH PYTHON27PATH %{i}/${PYTHON_LIB_SITE_PACKAGES} +## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES} +%define tag %{realversion} +%define branch master +%define github_user opencv + +Source: git+https://github.com/%{github_user}/opencv.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz +BuildRequires: cmake ninja +Requires: python python3 py2-numpy py3-numpy libpng libjpeg-turbo libtiff zlib eigen OpenBLAS + +%prep +%setup -n %{n}-%{realversion} + +%build +rm -rf ../build +mkdir ../build +cd ../build + +cmake ../%{n}-%{realversion} \ + -GNinja \ + -DCMAKE_INSTALL_PREFIX="%{i}" \ + -DCMAKE_INSTALL_LIBDIR=lib \ + -DPYTHON2_EXECUTABLE:FILEPATH="${PYTHON_ROOT}/bin/python" \ + -DPYTHON2_INCLUDE_DIR:PATH="${PYTHON_ROOT}/include/python2.7" \ + -DPYTHON2_LIBRARY:FILEPATH="${PYTHON_ROOT}/lib/libpython2.7.so" \ + -DPYTHON3_EXECUTABLE:FILEPATH="${PYTHON3_ROOT}/bin/python3" \ + -DPYTHON3_INCLUDE_DIR:PATH="${PYTHON3_ROOT}/include/python3.8" \ + -DPYTHON3_LIBRARY:FILEPATH="${PYTHON3_ROOT}/lib/libpython3.8.so" \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_PREFIX_PATH="${LIBPNG_ROOT};${LIBTIFF_ROOT};${LIBJPEG_TURBO_ROOT};${ZLIB_ROOT};${PYTHON_ROOT};${PYTHON3_ROOT};${PY2_NUMPY_ROOT};${PY3_NUMPY_ROOT};${EIGEN_ROOT};${OPENBLAS_ROOT}" + +ninja -v %{makeprocesses} -l $(getconf _NPROCESSORS_ONLN) + +%install +cd ../build +ninja -v %{makeprocesses} -l $(getconf _NPROCESSORS_ONLN) install diff --git a/python_tools.spec b/python_tools.spec index 4f94110c346..1e92ed59e2a 100644 --- a/python_tools.spec +++ b/python_tools.spec @@ -3,7 +3,7 @@ ## INITENV +PATH PYTHON3PATH %{i}/${PYTHON3_LIB_SITE_PACKAGES} Source: none -Requires: root curl python python3 xrootd llvm hdf5 mxnet-predict +Requires: root curl python python3 xrootd llvm hdf5 mxnet-predict opencv Requires: py2-scipy Requires: py2-Keras