diff --git a/opencv-cpp20.patch b/opencv-cpp20.patch new file mode 100644 index 00000000000..a232393d70b --- /dev/null +++ b/opencv-cpp20.patch @@ -0,0 +1,11 @@ +--- a/modules/imgproc/test/test_houghlines.cpp 2023-07-18 08:46:05.532555671 +0200 ++++ b/modules/imgproc/test/test_houghlines.cpp 2023-07-18 08:46:39.922490881 +0200 +@@ -53,7 +53,7 @@ + T value; + float theta_eps; + float rho_eps; +- SimilarWith(T val, float e, float r_e): value(val), theta_eps(e), rho_eps(r_e) { }; ++ SimilarWith(T val, float e, float r_e): value(val), theta_eps(e), rho_eps(r_e) { }; + bool operator()(const T& other); + }; + diff --git a/opencv.spec b/opencv.spec index c9a57885a3a..8419fa47f5d 100644 --- a/opencv.spec +++ b/opencv.spec @@ -6,11 +6,13 @@ %define github_user opencv Source0: git+https://github.com/%{github_user}/opencv.git?obj=%{branch}/%{tag}&export=%{n}-%{realversion}&output=/%{n}-%{realversion}-%{tag}.tgz +Patch0: opencv-cpp20 BuildRequires: cmake ninja Requires: python3 py3-numpy libpng libjpeg-turbo libtiff zlib eigen OpenBLAS %prep %setup -n %{n}-%{realversion} +%patch0 -p1 %build rm -rf ../build @@ -30,7 +32,8 @@ cmake ../%{n}-%{realversion} \ -DPYTHON3_INCLUDE_DIR:PATH="${PYTHON3_ROOT}/include/python%{cms_python3_major_minor_version}" \ -DPYTHON3_LIBRARY:FILEPATH="${PYTHON3_ROOT}/lib/libpython%{cms_python3_major_minor_version}.so" \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_PREFIX_PATH="${LIBPNG_ROOT};${LIBTIFF_ROOT};${LIBJPEG_TURBO_ROOT};${ZLIB_ROOT};${PYTHON3_ROOT};${PY2_NUMPY_ROOT};${PY3_NUMPY_ROOT};${EIGEN_ROOT};${OPENBLAS_ROOT}" + -DCMAKE_PREFIX_PATH="${LIBPNG_ROOT};${LIBTIFF_ROOT};${LIBJPEG_TURBO_ROOT};${ZLIB_ROOT};${PYTHON3_ROOT};${PY2_NUMPY_ROOT};${PY3_NUMPY_ROOT};${EIGEN_ROOT};${OPENBLAS_ROOT}" \ + -DCMAKE_CXX_STANDARD=%{cms_cxx_standard} ninja -v %{makeprocesses} diff --git a/pip/onnx.file b/pip/onnx.file index fd919eb12c4..c9a85bb84e1 100644 --- a/pip/onnx.file +++ b/pip/onnx.file @@ -3,4 +3,4 @@ Patch0: py3-onnx %define patchsrc0 grep -q 'CMAKE_CXX_STANDARD *11' CMakeLists.txt && sed -i -e 's|CMAKE_CXX_STANDARD *11|CMAKE_CXX_STANDARD %{cms_cxx_standard}|' CMakeLists.txt Requires: cmake protobuf py3-protobuf py3-six py3-typing-extensions py3-numpy py3-pytest-runner %define runpath_opts -n pb -n onnx -%define PipPreBuild export ONNX_ML=1;export CMAKE_ARGS="-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} -DONNX_USE_PROTOBUF_SHARED_LIBS=ON -DProtobuf_USE_STATIC_LIBS=OFF -DCMAKE_PREFIX_PATH=%{cmake_prefix_path}" +%define PipPreBuild export ONNX_ML=1;export CMAKE_ARGS="-DCMAKE_CXX_STANDARD=%{cms_cxx_standard} -DONNX_USE_PROTOBUF_SHARED_LIBS=ON -DProtobuf_USE_STATIC_LIBS=OFF -DCMAKE_PREFIX_PATH=%{cmake_prefix_path}" \ No newline at end of file diff --git a/protobuf.spec b/protobuf.spec index 29467042de0..b97421d3bd3 100644 --- a/protobuf.spec +++ b/protobuf.spec @@ -28,8 +28,6 @@ cd ../build cmake ../%{n}-%{realversion} \ -G Ninja \ -DCMAKE_INSTALL_PREFIX="%{i}" \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=17 \ -Dprotobuf_BUILD_TESTS=OFF \ -Dprotobuf_BUILD_SHARED_LIBS=ON \ -Dutf8_range_ENABLE_INSTALL=ON \ @@ -45,5 +43,4 @@ ninja -v %{makeprocesses} cd ../build ninja -v %{makeprocesses} install -rm -rf %{i}/lib/pkgconfig - +rm -rf %{i}/lib/pkgconfig \ No newline at end of file diff --git a/py3-onnx.patch b/py3-onnx.patch index 34d46d69acc..0815c44bf78 100644 --- a/py3-onnx.patch +++ b/py3-onnx.patch @@ -8,4 +8,4 @@ +CMAKE = find_executable("cmake") MAKE = find_executable("make") - install_requires = [] + install_requires = [] \ No newline at end of file diff --git a/sherpa-cpp20.patch b/sherpa-cpp20.patch new file mode 100644 index 00000000000..b76c3ace7a5 --- /dev/null +++ b/sherpa-cpp20.patch @@ -0,0 +1,35 @@ +From 1de52ee230891277370fc4f787fc8cb4b7626ef2 Mon Sep 17 00:00:00 2001 +From: iarspider +Date: Wed, 28 Jun 2023 07:35:10 +0000 +Subject: [PATCH] [ATOOLS] Fix C++20 compilation errors + +--- + ATOOLS/Org/Getter_Function.H | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +diff --git a/ATOOLS/Org/Getter_Function.H b/ATOOLS/Org/Getter_Function.H +index f68d190ca2..09340da390 100644 +--- a/ATOOLS/Org/Getter_Function.H ++++ b/ATOOLS/Org/Getter_Function.H +@@ -84,7 +84,7 @@ namespace ATOOLS { + void PrintInfo(std::ostream &str,const size_t width) const; \ + Object_Type *operator()(const Parameter_Type ¶meters) const; \ + public: \ +- Getter(const bool &d=true): \ ++ Getter(const bool &d=true): \ + Getter_Function(TAG) \ + { SetDisplay(d); } \ + }; \ +@@ -107,8 +107,7 @@ namespace ATOOLS { + void PrintInfo(std::ostream &str,const size_t width) const; \ + Object_Type *operator()(const Parameter_Type ¶meters) const; \ + public: \ +- Getter \ +- (const std::string &name,const bool d=true): \ ++ Getter(const std::string &name,const bool d=true): \ + Getter_Function(name) \ + { SetDisplay(d); } \ + }; \ +-- +GitLab + diff --git a/sherpa.spec b/sherpa.spec index 31ad30dad9b..5809ddd88df 100644 --- a/sherpa.spec +++ b/sherpa.spec @@ -3,6 +3,7 @@ Source: http://www.hepforge.org/archive/sherpa/SHERPA-MC-%{realversion}.tar.gz Requires: hepmc lhapdf blackhat sqlite python3 fastjet openmpi BuildRequires: mcfm swig autotools Patch0: sherpa-2.2.10-hepmcshort +Patch1: sherpa-cpp20 %ifos linux %ifnarch ppc64le @@ -25,6 +26,7 @@ perl -p -i -e 's|-rdynamic||g' configure AddOns/Analysis/Scripts/Makefile.in %endif %patch0 -p1 +%patch1 -p1 %build export PYTHON=$(which python3)