From 02dd7bb5b6ef13a340d2b9f53830561ffc9451ae Mon Sep 17 00:00:00 2001 From: tanyulong2021 Date: Mon, 23 May 2022 11:27:29 +0800 Subject: [PATCH] =?UTF-8?q?Building=20opencv,eigen=5Fassert=5Fexception?= =?UTF-8?q?=E2=80=99=20is=20not=20a=20member=20of=20=E2=80=98Eigen?= =?UTF-8?q?=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 0001-rebuild-and-modify-exception-error.patch | 60 +++++++++++++++++++ eigen3.spec | 6 +- 2 files changed, 65 insertions(+), 1 deletion(-) create mode 100644 0001-rebuild-and-modify-exception-error.patch diff --git a/0001-rebuild-and-modify-exception-error.patch b/0001-rebuild-and-modify-exception-error.patch new file mode 100644 index 0000000..aa7224a --- /dev/null +++ b/0001-rebuild-and-modify-exception-error.patch @@ -0,0 +1,60 @@ +From 4d2d8c2286d83bd343d2619ac19b731a3ff4f4ec Mon Sep 17 00:00:00 2001 +From: tanyulong2021 +Date: Tue, 10 May 2022 18:33:38 +0800 +Subject: [PATCH] rebuild and modify exception error + +--- + Eigen/src/Core/products/Parallelizer.h | 15 ++++++--------- + test/CMakeLists.txt | 2 +- + 2 files changed, 7 insertions(+), 10 deletions(-) + +diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h +index 67b2442..ebb80f0 100644 +--- a/Eigen/src/Core/products/Parallelizer.h ++++ b/Eigen/src/Core/products/Parallelizer.h +@@ -132,8 +132,7 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, Index depth, + + ei_declare_aligned_stack_constructed_variable(GemmParallelInfo,info,threads,0); + +- int errorCount = 0; +- #pragma omp parallel num_threads(threads) reduction(+: errorCount) ++ #pragma omp parallel num_threads(threads) + { + Index i = omp_get_thread_num(); + // Note that the actual number of threads might be lower than the number of request ones. +@@ -152,14 +151,12 @@ void parallelize_gemm(const Functor& func, Index rows, Index cols, Index depth, + info[i].lhs_start = r0; + info[i].lhs_length = actualBlockRows; + +- EIGEN_TRY { +- if(transpose) func(c0, actualBlockCols, 0, rows, info); +- else func(0, rows, c0, actualBlockCols, info); +- } EIGEN_CATCH(...) { +- ++errorCount; +- } ++ if(transpose) ++ func(c0, actualBlockCols, 0, rows, info); ++ else ++ func(0, rows, c0, actualBlockCols, info); ++ + } +- if (errorCount) EIGEN_THROW_X(Eigen::eigen_assert_exception()); + #endif + } + +diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt +index 0747aa6..b025777 100644 +--- a/test/CMakeLists.txt ++++ b/test/CMakeLists.txt +@@ -163,7 +163,7 @@ ei_add_test(constructor) + ei_add_test(linearstructure) + ei_add_test(integer_types) + ei_add_test(unalignedcount) +-if(NOT EIGEN_TEST_NO_EXCEPTIONS) ++if(NOT EIGEN_TEST_NO_EXCEPTIONS AND NOT EIGEN_TEST_OPENMP) + ei_add_test(exceptions) + endif() + ei_add_test(redux) +-- +2.33.0 + diff --git a/eigen3.spec b/eigen3.spec index a3a329b..e88e172 100644 --- a/eigen3.spec +++ b/eigen3.spec @@ -2,12 +2,13 @@ Name: eigen3 Version: 3.3.8 -Release: 3 +Release: 4 Summary: A lightweight C++ template library for vector and matrix math License: MPLv2.0 and LGPLv2+ and BSD URL: http://eigen.tuxfamily.org/index.php?title=Main_Page Source0: https://gitlab.com/libeigen/eigen/-/archive/%{version}/eigen-%{version}.tar.bz2 +Patch0: 0001-rebuild-and-modify-exception-error.patch BuildRequires: cmake BuildRequires: make @@ -50,6 +51,9 @@ cp -r Eigen %{buildroot}%{_includedir}/%{name}/ %{_includedir}/%{name} %{_datadir} %changelog +* Mon May 23 2022 tanyulong - 3.3.8-4 +- Building opencv,eigen_assert_exception’ is not a member of ‘Eigen’ + * Fri Apr 15 2022 tanyulong - 3.3.8-3 - fix cmake build error -- Gitee