From 69e6dffc4295b19bed4482621f7cb952eb2d8089 Mon Sep 17 00:00:00 2001 From: Schrijvers Luc Date: Thu, 13 Nov 2025 11:41:12 +0100 Subject: [PATCH] eigen, rename old, add new 5.0.1 (#13210) old one still required for ceres-solver --- dev-cpp/eigen/eigen-5.0.1.recipe | 123 ++++++++++++++++++ ...eigen-3.4.0.recipe => eigen3-3.4.0.recipe} | 13 +- dev-cpp/eigen/patches/eigen-5.0.1.patchset | 30 +++++ 3 files changed, 160 insertions(+), 6 deletions(-) create mode 100644 dev-cpp/eigen/eigen-5.0.1.recipe rename dev-cpp/eigen/{eigen-3.4.0.recipe => eigen3-3.4.0.recipe} (93%) create mode 100644 dev-cpp/eigen/patches/eigen-5.0.1.patchset diff --git a/dev-cpp/eigen/eigen-5.0.1.recipe b/dev-cpp/eigen/eigen-5.0.1.recipe new file mode 100644 index 000000000..54032e4a7 --- /dev/null +++ b/dev-cpp/eigen/eigen-5.0.1.recipe @@ -0,0 +1,123 @@ +SUMMARY="A C++ template library for linear algebra, vectors and more" +DESCRIPTION="Eigen is a versatile, fast, elegant and reliable template library \ +that supports all matrix sizes, from small fixed-size matrices to arbitrarily \ +large dense matrices, and even sparse matrices. +- It supports all standard numeric types, including std::complex, integers, \ +and is easily extensible to custom numeric types. +- It supports various matrix decompositions and geometry features. +- Its ecosystem of unsupported modules provides many specialized features \ +such as non-linear optimization, matrix functions, a polynomial solver, FFT, \ +and much more. +- Expression templates allow to intelligently remove temporaries and enable \ +lazy evaluation, when that is appropriate. +- Explicit vectorization is performed for SSE 2/3/4, AVX, FMA, AVX512, \ +ARM NEON (32-bit and 64-bit), PowerPC instruction sets, and now S390x SIMD \ +(ZVector) with graceful fallback to non-vectorized code. +- Fixed-size matrices are fully optimized: dynamic memory allocation is \ +avoided, and the loops are unrolled when that makes sense. +- For large matrices, special attention is paid to cache-friendliness. +- Algorithms are carefully selected for reliability. Reliability trade-offs \ +are clearly documented and extremely safe decompositions are available. +- Eigen is thoroughly tested through its own test suite (over 500 executables) \ +the standard BLAS test suite, and parts of the LAPACK test suite. +- The API is extremely clean and expressive while feeling natural to C++ \ +programmers, thanks to expression templates. +- Implementing an algorithm on top of Eigen feels like just copying pseudocode." +HOMEPAGE="http://eigen.tuxfamily.org" +COPYRIGHT="2006-2011 Benoit Jacob + 2008-2012 Gael Guennebaud, et al." +LICENSE="MPL v2 + Apache v2 + BSD (3-clause) + GNU GPL v3 + GNU LGPL v2.1" +REVISION="1" +SOURCE_URI="http://gitlab.com/libeigen/eigen/-/archive/$portVersion/eigen-$portVersion.tar.gz" +CHECKSUM_SHA256="e9c326dc8c05cd1e044c71f30f1b2e34a6161a3b6ecf445d56b53ff1669e3dec" +PATCHES="eigen-$portVersion.patchset" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + eigen$secondaryArchSuffix = $portVersion + devel:eigen$secondaryArchSuffix = $portVersion + lib:libeigen_blas$secondaryArchSuffix + lib:libeigen_lapack$secondaryArchSuffix + devel:libeigen_blas_static$secondaryArchSuffix + devel:libeigen_lapack_static$secondaryArchSuffix + " +REQUIRES=" + haiku$secondaryArchSuffix + lib:libgfortran$secondaryArchSuffix + lib:libquadmath$secondaryArchSuffix + " +CONFLICTS=" + eigen3$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + devel:libboost_system$secondaryArchSuffix >= 1.88.0 + devel:libcholmod$secondaryArchSuffix + devel:libfftw3f$secondaryArchSuffix + devel:libGL$secondaryArchSuffix + devel:libgmp$secondaryArchSuffix + devel:libhwloc$secondaryArchSuffix >= 15.7 # we want hwloc2_devel + devel:libklu$secondaryArchSuffix + devel:libmpfr$secondaryArchSuffix +# devel:libopenblas$secondaryArchSuffix + devel:libumfpack$secondaryArchSuffix + devel:libsuperlu$secondaryArchSuffix + devel:libspqr$secondaryArchSuffix +# devel:libtbb$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:cmake + cmd:gcc$secondaryArchSuffix + cmd:gfortran$secondaryArchSuffix + cmd:make + cmd:pkg_config$secondaryArchSuffix + " + +BUILD() +{ + cmake -Bbuild -S. -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$prefix \ + -DINCLUDE_INSTALL_DIR=$includeDir \ + -DCMAKEPACKAGE_INSTALL_DIR=$libDir/cmake/eigen3 \ + -DPKGCONFIG_INSTALL_DIR=$developLibDir/pkgconfig \ + -Wno-dev + + make -C build $jobArgs +} + +INSTALL() +{ + make -C build install + + prepareInstalledDevelLibs \ + libeigen_blas_static \ + libeigen_lapack_static +} + +TEST() +{ + # test binaries are not build with ctest + make -C build check -j 4 + # 99% tests passed, 5 tests failed out of 1283 (5 crashes) + # Label Time Summary: + # Official = 355.40 sec*proc (910 tests) + # Unsupported = 74.87 sec*proc (231 tests) + # smoketest = 9.50 sec*proc (109 tests) + # Total Test time (real) = 2542.71 sec + # The following tests FAILED: + # 13 - klu_support_1 (Timeout) + # 14 - klu_support_2 (Signal 21) + # 80 - packetmath_11 (Signal 21) Official + # 732 - geo_homogeneous_2 (Signal 21) Official + # 733 - geo_homogeneous_3 (Signal 21) Official + + # change -E to -R to run only the crashing tests +# ctest --test-dir build --output-on-failure -E "klu_support_1|klu_support_2|packetmath_11|geo_homogeneous_2|geo_homogeneous_3" +} diff --git a/dev-cpp/eigen/eigen-3.4.0.recipe b/dev-cpp/eigen/eigen3-3.4.0.recipe similarity index 93% rename from dev-cpp/eigen/eigen-3.4.0.recipe rename to dev-cpp/eigen/eigen3-3.4.0.recipe index dc28b2da4..dfc7a7aee 100644 --- a/dev-cpp/eigen/eigen-3.4.0.recipe +++ b/dev-cpp/eigen/eigen3-3.4.0.recipe @@ -31,16 +31,17 @@ LICENSE="MPL v2 BSD (3-clause) GNU GPL v3 GNU LGPL v2.1" -REVISION="1" +REVISION="2" SOURCE_URI="http://gitlab.com/libeigen/eigen/-/archive/$portVersion/eigen-$portVersion.tar.gz" CHECKSUM_SHA256="8586084f71f9bde545ee7fa6d00288b264a2b7ac3607b974e54d13e7162c1c72" +SOURCE_DIR="eigen-$portVersion" PATCHES="eigen-$portVersion.patchset" ARCHITECTURES="all !x86_gcc2" SECONDARY_ARCHITECTURES="x86" PROVIDES=" - eigen$secondaryArchSuffix = $portVersion + eigen3$secondaryArchSuffix = $portVersion devel:eigen$secondaryArchSuffix = $portVersion " REQUIRES=" @@ -49,18 +50,17 @@ REQUIRES=" BUILD_REQUIRES=" haiku${secondaryArchSuffix}_devel - devel:libboost_system$secondaryArchSuffix + devel:libboost_system$secondaryArchSuffix >= 1.88.0 devel:libcholmod$secondaryArchSuffix devel:libfftw3f$secondaryArchSuffix devel:libGL$secondaryArchSuffix devel:libgmp$secondaryArchSuffix - devel:libmetis$secondaryArchSuffix devel:libmpfr$secondaryArchSuffix devel:libopenblas$secondaryArchSuffix devel:libumfpack$secondaryArchSuffix devel:libsuperlu$secondaryArchSuffix devel:libspqr$secondaryArchSuffix - devel:libtbb$secondaryArchSuffix +# devel:libtbb$secondaryArchSuffix " BUILD_PREREQUIRES=" cmd:cmake @@ -77,7 +77,8 @@ BUILD() -DINCLUDE_INSTALL_DIR=$includeDir \ -DCMAKEPACKAGE_INSTALL_DIR=$libDir/cmake/eigen3 \ -DPKGCONFIG_INSTALL_DIR=$developLibDir/pkgconfig \ - -DEIGEN_MPL2_ONLY=ON + -DEIGEN_MPL2_ONLY=ON \ + -Wno-dev make -C build $jobArgs } diff --git a/dev-cpp/eigen/patches/eigen-5.0.1.patchset b/dev-cpp/eigen/patches/eigen-5.0.1.patchset new file mode 100644 index 000000000..92ddcd93a --- /dev/null +++ b/dev-cpp/eigen/patches/eigen-5.0.1.patchset @@ -0,0 +1,30 @@ +From 45062d055edfa384fd7c59c8b55c51e8d6a62417 Mon Sep 17 00:00:00 2001 +From: Calvin Hill +Date: Mon, 1 May 2017 04:17:23 +0100 +Subject: Eigen patch to run tests for Haiku + + +diff --git a/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h b/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h +index 15d7fb2..1f456ad 100644 +--- a/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h ++++ b/unsupported/Eigen/src/SparseExtra/MatrixMarketIterator.h +@@ -171,10 +171,13 @@ class MatrixMarketIterator { + std::string curfile; + curfile = m_folder + "/" + m_curs_id->d_name; + // Discard if it is a folder ++#ifndef __HAIKU__ + if (m_curs_id->d_type == DT_DIR) continue; // FIXME This may not be available on non BSD systems +- // struct stat st_buf; +- // stat (curfile.c_str(), &st_buf); +- // if (S_ISDIR(st_buf.st_mode)) continue; ++#else ++ struct stat st_buf; ++ stat (curfile.c_str(), &st_buf); ++ if (S_ISDIR(st_buf.st_mode)) continue; ++#endif + + // Determine from the header if it is a matrix or a right hand side + bool isvector, iscomplex = false; +-- +2.51.0 +