diff --git a/Remove-error-counting-in-OpenMP-parallelize_gemm.patch b/Remove-error-counting-in-OpenMP-parallelize_gemm.patch deleted file mode 100644 index 1796afa..0000000 --- a/Remove-error-counting-in-OpenMP-parallelize_gemm.patch +++ /dev/null @@ -1,64 +0,0 @@ -From ef3cc72cb65e2d500459c178c63e349bacfa834f Mon Sep 17 00:00:00 2001 -From: Luke Peterson -Date: Thu, 8 Oct 2020 12:16:53 -0700 -Subject: [PATCH] Remove error counting in OpenMP parallelize_gemm - -This resolves a compilation error associated with -Eigen::eigen_assert_exception. It also eliminates the counting of -exceptions that may occur in the OpenMP parallel section. If an -unhandled exception occurs in this section, the behavior is non-conforming -according to the OpenMP specification. ---- - Eigen/src/Core/products/Parallelizer.h | 14 +++++--------- - test/CMakeLists.txt | 2 +- - 2 files changed, 6 insertions(+), 10 deletions(-) - -diff --git a/Eigen/src/Core/products/Parallelizer.h b/Eigen/src/Core/products/Parallelizer.h -index 67b2442b5..a3cc05b77 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,11 @@ 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 0747aa6cb..b02577780 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) --- -GitLab - diff --git a/eigen-3.3.8.tar.bz2 b/eigen-3.3.8.tar.bz2 deleted file mode 100644 index 6dfa7ee..0000000 --- a/eigen-3.3.8.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0215c6593c4ee9f1f7f28238c4e8995584ebf3b556e9dbf933d84feb98d5b9ef -size 1667794 diff --git a/eigen-3.3.9.tar.bz2 b/eigen-3.3.9.tar.bz2 new file mode 100644 index 0000000..6f2032f --- /dev/null +++ b/eigen-3.3.9.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0fa5cafe78f66d2b501b43016858070d52ba47bd9b1016b0165a7b8e04675677 +size 1667231 diff --git a/eigen3-failtests-handling.patch b/eigen3-failtests-handling.patch new file mode 100644 index 0000000..ba7ff5e --- /dev/null +++ b/eigen3-failtests-handling.patch @@ -0,0 +1,132 @@ +From 72c0bbe2bd1c49c75b6efdb81d0558f8b62578d1 Mon Sep 17 00:00:00 2001 +From: Gael Guennebaud +Date: Wed, 12 Dec 2018 15:48:36 +0100 +Subject: [PATCH] Simplify handling of tests that must fail to compile. Each + test is now a normal ctest target, and build properties (compiler+flags) are + preserved (instead of starting a new build-dir from scratch). + +--- + CMakeLists.txt | 5 +---- + cmake/EigenTesting.cmake | 45 ++++++++++++++++++---------------------- + failtest/CMakeLists.txt | 10 --------- + test/CMakeLists.txt | 5 ----- + 4 files changed, 21 insertions(+), 44 deletions(-) + +Index: eigen-3.3.8/CMakeLists.txt +=================================================================== +--- eigen-3.3.8.orig/CMakeLists.txt ++++ eigen-3.3.8/CMakeLists.txt +@@ -497,10 +497,7 @@ message(STATUS "") + message(STATUS "Configured Eigen ${EIGEN_VERSION_NUMBER}") + message(STATUS "") + +-option(EIGEN_FAILTEST "Enable failtests." OFF) +-if(EIGEN_FAILTEST) +- add_subdirectory(failtest) +-endif() ++add_subdirectory(failtest) + + string(TOLOWER "${CMAKE_GENERATOR}" cmake_generator_tolower) + if(cmake_generator_tolower MATCHES "makefile") +Index: eigen-3.3.8/cmake/EigenTesting.cmake +=================================================================== +--- eigen-3.3.8.orig/cmake/EigenTesting.cmake ++++ eigen-3.3.8/cmake/EigenTesting.cmake +@@ -320,37 +320,32 @@ endmacro(ei_add_test_sycl) + # note that the test runner for these is CMake itself, when passed -DEIGEN_FAILTEST=ON + # so here we're just running CMake commands immediately, we're not adding any targets. + macro(ei_add_failtest testname) +- get_property(EIGEN_FAILTEST_FAILURE_COUNT GLOBAL PROPERTY EIGEN_FAILTEST_FAILURE_COUNT) +- get_property(EIGEN_FAILTEST_COUNT GLOBAL PROPERTY EIGEN_FAILTEST_COUNT) + +- message(STATUS "Checking failtest: ${testname}") +- set(filename "${testname}.cpp") +- file(READ "${filename}" test_source) +- +- try_compile(succeeds_when_it_should_fail +- "${CMAKE_CURRENT_BINARY_DIR}" +- "${CMAKE_CURRENT_SOURCE_DIR}/${filename}" +- COMPILE_DEFINITIONS "-DEIGEN_SHOULD_FAIL_TO_BUILD") +- if (succeeds_when_it_should_fail) +- message(STATUS "FAILED: ${testname} build succeeded when it should have failed") +- endif() +- +- try_compile(succeeds_when_it_should_succeed +- "${CMAKE_CURRENT_BINARY_DIR}" +- "${CMAKE_CURRENT_SOURCE_DIR}/${filename}" +- COMPILE_DEFINITIONS) +- if (NOT succeeds_when_it_should_succeed) +- message(STATUS "FAILED: ${testname} build failed when it should have succeeded") +- endif() +- +- if (succeeds_when_it_should_fail OR NOT succeeds_when_it_should_succeed) +- math(EXPR EIGEN_FAILTEST_FAILURE_COUNT ${EIGEN_FAILTEST_FAILURE_COUNT}+1) +- endif() ++ set(test_target_ok ${testname}_ok) ++ set(test_target_ko ${testname}_ko) + +- math(EXPR EIGEN_FAILTEST_COUNT ${EIGEN_FAILTEST_COUNT}+1) ++ # Add executables ++ add_executable(${test_target_ok} ${testname}.cpp) ++ add_executable(${test_target_ko} ${testname}.cpp) ++ ++ # Remove them from the normal build process ++ set_target_properties(${test_target_ok} ${test_target_ko} PROPERTIES ++ EXCLUDE_FROM_ALL TRUE ++ EXCLUDE_FROM_DEFAULT_BUILD TRUE) ++ ++ # Configure the failing test ++ target_compile_definitions(${test_target_ko} PRIVATE EIGEN_SHOULD_FAIL_TO_BUILD) ++ ++ # Add the tests to ctest. ++ add_test(NAME ${test_target_ok} ++ COMMAND ${CMAKE_COMMAND} --build . --target ${test_target_ok} --config $ ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) ++ add_test(NAME ${test_target_ko} ++ COMMAND ${CMAKE_COMMAND} --build . --target ${test_target_ko} --config $ ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}) + +- set_property(GLOBAL PROPERTY EIGEN_FAILTEST_FAILURE_COUNT ${EIGEN_FAILTEST_FAILURE_COUNT}) +- set_property(GLOBAL PROPERTY EIGEN_FAILTEST_COUNT ${EIGEN_FAILTEST_COUNT}) ++ # Expect the second test to fail ++ set_tests_properties(${test_target_ko} PROPERTIES WILL_FAIL TRUE) + endmacro(ei_add_failtest) + + # print a summary of the different options +Index: eigen-3.3.8/failtest/CMakeLists.txt +=================================================================== +--- eigen-3.3.8.orig/failtest/CMakeLists.txt ++++ eigen-3.3.8/failtest/CMakeLists.txt +@@ -1,4 +1,3 @@ +-message(STATUS "Running the failtests") + + ei_add_failtest("failtest_sanity_check") + +@@ -64,12 +63,3 @@ ei_add_failtest("bdcsvd_int") + ei_add_failtest("eigensolver_int") + ei_add_failtest("eigensolver_cplx") + +-if (EIGEN_FAILTEST_FAILURE_COUNT) +- message(FATAL_ERROR +- "${EIGEN_FAILTEST_FAILURE_COUNT} out of ${EIGEN_FAILTEST_COUNT} failtests FAILED. " +- "To debug these failures, manually compile these programs in ${CMAKE_CURRENT_SOURCE_DIR}, " +- "with and without #define EIGEN_SHOULD_FAIL_TO_BUILD.") +-else() +- message(STATUS "Failtest SUCCESS: all ${EIGEN_FAILTEST_COUNT} failtests passed.") +- message(STATUS "") +-endif() +Index: eigen-3.3.8/test/CMakeLists.txt +=================================================================== +--- eigen-3.3.8.orig/test/CMakeLists.txt ++++ eigen-3.3.8/test/CMakeLists.txt +@@ -380,10 +380,6 @@ endif(CUDA_FOUND) + + endif(EIGEN_TEST_CUDA) + +- +-file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/failtests) +-add_test(NAME failtests WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/failtests COMMAND ${CMAKE_COMMAND} ${Eigen_SOURCE_DIR} -G "${CMAKE_GENERATOR}" -DEIGEN_FAILTEST=ON) +- + option(EIGEN_TEST_BUILD_DOCUMENTATION "Test building the doxygen documentation" OFF) + IF(EIGEN_TEST_BUILD_DOCUMENTATION) + add_dependencies(buildtests doc) diff --git a/eigen3-fix-forward_adolc-unit-test.patch b/eigen3-fix-forward_adolc-unit-test.patch new file mode 100644 index 0000000..7f494e3 --- /dev/null +++ b/eigen3-fix-forward_adolc-unit-test.patch @@ -0,0 +1,18 @@ +Index: eigen-3.3.8/unsupported/test/forward_adolc.cpp +=================================================================== +--- eigen-3.3.8.orig/unsupported/test/forward_adolc.cpp ++++ eigen-3.3.8/unsupported/test/forward_adolc.cpp +@@ -7,12 +7,12 @@ + // Public License v. 2.0. If a copy of the MPL was not distributed + // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. + +-#include "main.h" + #include + + #define NUMBER_DIRECTIONS 16 + #include + ++#include "main.h" + template + EIGEN_DONT_INLINE typename Vector::Scalar foo(const Vector& p) + { diff --git a/eigen3-googlehash-detection.patch b/eigen3-googlehash-detection.patch new file mode 100644 index 0000000..a2ea50b --- /dev/null +++ b/eigen3-googlehash-detection.patch @@ -0,0 +1,13 @@ +Index: eigen-3.3.8/cmake/FindGoogleHash.cmake +=================================================================== +--- eigen-3.3.8.orig/cmake/FindGoogleHash.cmake ++++ eigen-3.3.8/cmake/FindGoogleHash.cmake +@@ -12,6 +12,8 @@ find_path(GOOGLEHASH_INCLUDES + + if(GOOGLEHASH_INCLUDES) + # let's make sure it compiles with the current compiler ++ # C++11 is needed for googlehash ++ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") + file(WRITE ${CMAKE_BINARY_DIR}/googlehash_test.cpp + "#include \n#include \nint main(int argc, char** argv) { google::dense_hash_map a; google::sparse_hash_map b; return 0;}\n") + try_compile(GOOGLEHASH_COMPILE ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/googlehash_test.cpp OUTPUT_VARIABLE GOOGLEHASH_COMPILE_RESULT) diff --git a/eigen3-make-sparseqr-unit-test-stable.patch b/eigen3-make-sparseqr-unit-test-stable.patch new file mode 100644 index 0000000..fa45505 --- /dev/null +++ b/eigen3-make-sparseqr-unit-test-stable.patch @@ -0,0 +1,66 @@ +From 3b5deeb546d4017b24846f5b0dc3296a50a039fe Mon Sep 17 00:00:00 2001 +From: Gael Guennebaud +Date: Tue, 19 Feb 2019 22:57:51 +0100 +Subject: [PATCH] bug #899: make sparseqr unit test more stable by 1) trying + with larger threshold and 2) relax rank computation for rank-deficient + problems. + +--- + test/sparseqr.cpp | 31 ++++++++++++++++++++++++++----- + 1 file changed, 26 insertions(+), 5 deletions(-) + +diff --git a/test/sparseqr.cpp b/test/sparseqr.cpp +index 3ffe62314..3576cc626 100644 +--- a/test/sparseqr.cpp ++++ b/test/sparseqr.cpp +@@ -43,6 +43,7 @@ int generate_sparse_rectangular_problem(MatrixType& A, DenseMat& dA, int maxRows + + template void test_sparseqr_scalar() + { ++ typedef typename NumTraits::Real RealScalar; + typedef SparseMatrix MatrixType; + typedef Matrix DenseMat; + typedef Matrix DenseVector; +@@ -91,14 +92,34 @@ template void test_sparseqr_scalar() + exit(0); + return; + } +- +- VERIFY_IS_APPROX(A * x, b); +- +- //Compare with a dense QR solver ++ ++ // Compare with a dense QR solver + ColPivHouseholderQR dqr(dA); + refX = dqr.solve(b); + +- VERIFY_IS_EQUAL(dqr.rank(), solver.rank()); ++ bool rank_deficient = A.cols()>A.rows() || dqr.rank() we might have to increase the threshold ++ // to get a correct solution. ++ RealScalar th = RealScalar(20)*dA.colwise().norm().maxCoeff()*(A.rows()+A.cols()) * NumTraits::epsilon(); ++ for(Index k=0; (k<16) && !test_isApprox(A*x,b); ++k) ++ { ++ th *= RealScalar(10); ++ solver.setPivotThreshold(th); ++ solver.compute(A); ++ x = solver.solve(b); ++ } ++ } ++ ++ VERIFY_IS_APPROX(A * x, b); ++ ++ // For rank deficient problem, the estimated rank might ++ // be slightly off, so let's only raise a warning in such cases. ++ if(rank_deficient) ++g_test_level; ++ VERIFY_IS_EQUAL(solver.rank(), dqr.rank()); ++ if(rank_deficient) --g_test_level; ++ + if(solver.rank()==A.cols()) // full rank + VERIFY_IS_APPROX(x, refX); + // else +-- +GitLab + diff --git a/eigen3.changes b/eigen3.changes index e55d320..d07df88 100644 --- a/eigen3.changes +++ b/eigen3.changes @@ -1,9 +1,63 @@ +------------------------------------------------------------------- +Tue Dec 8 19:27:09 UTC 2020 - Atri Bhattacharya + +- Update to version 3.3.9: + * Introduce rendering Doxygen math formulas with MathJax and the + option EIGEN_DOC_USE_MATHJAX to control this. + * Issue 1746: Removed implementation of standard + copy-constructor and standard copy-assign-operator from + PermutationMatrix and Transpositions to allow malloc-less + std::move. + * Issue 2036: Make sure the + find_standard_math_library_test_program compiles and doesn't + optimize away functions we try to test for. + * Issue 2046: Rename test/array.cpp to test/array_cwise.cpp to + fix an issue with the C++ standard library header "array" + * Issue 2040: Fix an issue in test/ctorleak that occured when + disabling exceptions. + * Issue 2011: Remove error counting in OpenMP parallel section + in Eigen's GEMM parallelizing logic. + * Issue 2012: Define coeff-wise binary array operators for base + class to fix an issue when using Eigen with C++20 + * Fix an issue with IntelĀ® MKL PARDISO support. +- Drop Remove-error-counting-in-OpenMP-parallelize_gemm.patch: + incorporated upstream. +- Add patches to fix building and running tests: + * eigen3-failtests-handling.patch: Simplify handling of tests + that must fail to compile; upstream commit: 72c0bbe. + * eigen3-make-sparseqr-unit-test-stable.patch: Make sparseqr + test more stable to prevent random failures; patch taken from + upstream commit + [https://gitlab.com/libeigen/eigen/-/issues/899]. + * eigen3-googlehash-detection.patch: GoogleHash needs C++11 std + to compile test code and be succesfully detected. + * eigen3-fix-forward_adolc-unit-test.patch: Prevent conflict of + std::min/max with eigen's macros by importing eigen + test-suite's main.h header only after all system headers have + been included. +- Setup but don't run tests due to random errors in test-suite + itself + * Pass EIGEN_TEST_CXX11:Bool=ON and EIGEN_TEST_OPENMP:Bool=ON to + cmake to enable building c++11 and openmp tests. + * export EIGEN_SEED=100 to build with fixed seed (see + https://gitlab.com/libeigen/eigen/-/issues/2088). + * export EIGEN_REPEAT=1 to run each test only once (default 10) + to save time and since we use a fixed seed anyway. + * Disable for non-86_64 archs as some unsupported tests fail for + the others (for i586 some supported tests too, see + https://gitlab.com/libeigen/eigen/-/issues/2092). +- Pass CMAKE_SKIP_RPATH:BOOL=OFF and + CMAKE_SKIP_INSTALL_RPATH:BOOL=ON to cmake to fix rpath handling + in Leap 15.2's cmake macros (doesn't hurt generally). +- Change CMAKE_BUILD_TYPE from Release to RelWithDebInfo (openSUSE + default). + ------------------------------------------------------------------- Wed Nov 4 13:27:10 UTC 2020 - Atri Bhattacharya - Drop eigen_pkgconfig.patch: the includedir now needs to be specified relative to CMAKE_INSTALL_PREFIX, so this patch causes - the includedir in the pkgconfig file to be erroneousi + the includedir in the pkgconfig file to be erroneous (boo#1178139). - Use %autosetup to automatically run through patches. diff --git a/eigen3.spec b/eigen3.spec index 44adaf1..555d187 100644 --- a/eigen3.spec +++ b/eigen3.spec @@ -20,6 +20,12 @@ %global pkgname eigen3 %global srcname eigen +# The OpenGL support test fails +%bcond_with opengl_test + +# Tests fail for different reasons within the test-suite itself; disable for now +# See e.g. https://gitlab.com/libeigen/eigen/-/issues/2088, https://gitlab.com/libeigen/eigen/-/issues/2092 +# Also balloons the resources required: > 32 GiB disk space + >= 12 GiB memory %bcond_with tests %if "%{flavor}" == "docs" @@ -27,7 +33,7 @@ %endif Name: eigen3%{?pkgsuffix} -Version: 3.3.8 +Version: 3.3.9 Release: 0 Summary: C++ Template Library for Linear Algebra License: MPL-2.0 AND LGPL-2.1-only AND LGPL-2.1-or-later AND BSD-3-Clause @@ -41,8 +47,18 @@ Patch3: 01_install_FindEigen3.patch Patch4: eigen3-3.3.1-fixcmake.patch # PATCH-FIX-UPSTREAM eigen3-CastXML-support-for-aarch64.patch badshah400@gmail.com -- Add CastXML support for ARM aarch64 [https://gitlab.com/libeigen/eigen/-/issues/1979] Patch5: eigen3-CastXML-support-for-aarch64.patch -# PATCH-FIX-UPSTREAM -- https://gitlab.com/libeigen/eigen/-/merge_requests/232 -Patch6: Remove-error-counting-in-OpenMP-parallelize_gemm.patch +%if %{with tests} +# SECTION Patches to fix tests +# PATCH-FIX-UPSTREAM https://gitlab.com/libeigen/eigen/-/commit/72c0bbe2bd1c49c75b6efdb81d0558f8b62578d1 +Patch7: eigen3-failtests-handling.patch +# PATCH-FIX-UPSTREAM eigen3-make-sparseqr-unit-test-stable.patch https://gitlab.com/libeigen/eigen/-/issues/899 badshah400@gmail.com -- Make sparseqr test more stable to prevent random failures; patch taken from upstream commit +Patch8: eigen3-make-sparseqr-unit-test-stable.patch +# PATCH-FIX-UPSTREAM eigen3-googlehash-detection.patch badshah400@gmail.com -- GoogleHash needs C++11 std to compile test code and be succesfully detected +Patch9: eigen3-googlehash-detection.patch +# PATCH-FIX-UPSTREAM eigen3-fix-forward_adolc-unit-test.patch badshah400@gmail -- Prevent conflict of std::min/max with eigen's macros by importing eigen test-suite's main.h header only after all system headers have been included +Patch10: eigen3-fix-forward_adolc-unit-test.patch +# /SECTION +%endif BuildRequires: adolc-devel BuildRequires: cmake BuildRequires: fftw3-devel @@ -66,7 +82,7 @@ BuildRequires: texlive-dvips BuildRequires: texlive-latex BuildRequires: tex(newunicodechar.sty) %endif -%if %{with tests} +%if %{with opengl_test} BuildRequires: freeglut-devel BuildRequires: glew-devel BuildRequires: pkgconfig(gl) @@ -106,12 +122,14 @@ echo "HTML_TIMESTAMP = NO" >> doc/Doxyfile.in %build %cmake \ - -DCMAKE_BUILD_TYPE=Release \ -DINCLUDE_INSTALL_DIR=include/eigen3 \ - -DGOOGLEHASH_INCLUDES=%{_includedir} + -DCMAKE_SKIP_RPATH:BOOL=OFF \ + -DCMAKE_SKIP_INSTALL_RPATH:BOOL=ON \ + -DEIGEN_TEST_CXX11:Bool=%{?with_tests:ON}%{!?with_tests:OFF} \ + -DEIGEN_TEST_OPENMP:Bool=%{?with_tests:ON}%{!?with_tests:OFF} %if "%{flavor}" == "" -make %{?_smp_mflags} all +make %{?_smp_mflags} all %{?with_tests:buildtests} %else make %{?_smp_mflags} doc %endif @@ -126,6 +144,17 @@ find doc -name _formulas.log -print -delete %fdupes -s build/doc/html/ %endif +%if "%{flavor}" == "" +%if %{with tests} +%check +# Run with a fixed seed to prevent random failures: https://gitlab.com/libeigen/eigen/-/issues/2088 +export EIGEN_SEED=100 +# Repeat each test once to reduce time spent, since we use a fixed seed anyway +export EIGEN_REPEAT=1 +%ctest +%endif +%endif + %if "%{flavor}" == "docs" %files %doc build/doc/html/