Support for Eigen3 5.0.0#651
Conversation
|
Looks like original approach will set version as 3.5.0 since it always starts with world part. EDIT: Updated to extract major, minor patch from header. Build is successful and includes Tried local builds using both Eigen 3.4.0 and 5.0.0 with args Both had same results with only 1 failed test (TensorTest.TestMoveAssignments2) so doesn't seem to have any noticeable API breakage in 5.0.0. |
|
Thanks. Could you please split the two requests? The cassert header is unrelated to the FindEigen and we can just merge it. The FindEigen requires some more discussion. I see the following issues:
Any opinions? |
I don't think CMake provides FindEigen. Eigen does ship a Eigen3Config.cmake which is used by ALPSCore when However, in 5.0.0, Eigen removed Also need to account for version checking - https://gitlab.com/libeigen/eigen/-/merge_requests/1989/diffs, e.g.
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for Eigen3 version 5.0.0, which introduced a new versioning scheme while maintaining EIGEN_WORLD_VERSION=3. The changes handle the relocation of version information to a new header file and fix a missing include that caused compilation errors.
- Updated CMake FindEigen3 module to handle version detection from both new and legacy locations
- Added missing
#include <cassert>to fix compilation error in MPI code
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| common/cmake/FindEigen3.cmake | Added fallback logic to read version info from new Eigen/Version header while maintaining backward compatibility |
| accumulators/src/mpi.cpp | Added missing cassert include to resolve compilation error with assert macro |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| set(EIGEN3_MINOR_VERSION "${CMAKE_MATCH_1}") | ||
|
|
||
| set(EIGEN3_VERSION ${EIGEN3_WORLD_VERSION}.${EIGEN3_MAJOR_VERSION}.${EIGEN3_MINOR_VERSION}) | ||
| endif(EXISTS "${EIGEN3_INCLUDE_DIR}/Eigen/Version") |
There was a problem hiding this comment.
Use modern CMake syntax by removing the condition from the endif() statement. Modern CMake style uses just endif() without repeating the condition.
Note that Eigen 5.0.0 is still Eigen3 (EIGEN_WORLD_VERSION=3) but just uses their new version scheme:
Changes account for:
Eigen/Version- https://gitlab.com/libeigen/eigen/-/blob/5.0.0/Eigen/Version