Macaulay2 / M2

The primary source code repository for Macaulay2, a system for computing in commutative algebra, algebraic geometry and related fields.
https://macaulay2.com
343 stars 230 forks source link

Compilation error with Eigen 3.3.9 #1788

Closed mahrud closed 3 years ago

mahrud commented 3 years ago

The changelog doesn't mention any significant API changes, so I'm not sure what is the cause.

[16/111] Building CXX object Macaulay2/e/CMakeFiles/M2-engine.dir/eigen.cpp.o
FAILED: Macaulay2/e/CMakeFiles/M2-engine.dir/eigen.cpp.o 
/usr/bin/ccache /usr/lib64/ccache/c++  -I../../Macaulay2/e -I../../Macaulay2/d -I../../Macaulay2/c -IMacaulay2/d -I/usr/include/libxml2 -Iusr-host/include -isystem /usr/include/openblas -isystem /usr/include/eigen3 -Os -DNDEBUG -march=native -DNDEBUG -DOM_NDEBUG -DSING_NDEBUG -Wuninitialized -g3 -I/home/mahrud/Projects/M2/M2/M2/BUILD/build/usr-host/include -I/home/mahrud/Projects/M2/M2/M2/include -I/home/mahrud/Projects/M2/M2/M2/BUILD/build/include -Wall -Wextra -Wfatal-errors -Wcast-qual -Wno-unused-parameter -Wno-attributes -Wno-cast-qual -Wno-sign-compare -Wno-unused-local-typedefs -Wno-deprecated-copy -Wno-unknown-pragmas -Wno-ignored-qualifiers -Wno-implicit-fallthrough -fopenmp -std=gnu++14 -MD -MT Macaulay2/e/CMakeFiles/M2-engine.dir/eigen.cpp.o -MF Macaulay2/e/CMakeFiles/M2-engine.dir/eigen.cpp.o.d -o Macaulay2/e/CMakeFiles/M2-engine.dir/eigen.cpp.o -c ../../Macaulay2/e/eigen.cpp
In file included from /usr/include/eigen3/Eigen/SVD:37:0,
                 from ../../Macaulay2/e/eigen.cpp:12:
/usr/include/eigen3/Eigen/src/SVD/JacobiSVD.h: In instantiation of 'Eigen::JacobiSVD<MatrixType, QRPreconditioner>& Eigen::JacobiSVD<MatrixType, QRPreconditioner>::compute(const MatrixType&, unsigned int) [with _MatrixType = Eigen::Matrix<eigen_mpfr::mpreal, -1, -1>; int QRPreconditioner = 2; Eigen::JacobiSVD<MatrixType, QRPreconditioner>::MatrixType = Eigen::Matrix<eigen_mpfr::mpreal, -1, -1>]':
/usr/include/eigen3/Eigen/src/SVD/JacobiSVD.h:548:14:   required from 'Eigen::JacobiSVD<MatrixType, QRPreconditioner>::JacobiSVD(const MatrixType&, unsigned int) [with _MatrixType = Eigen::Matrix<eigen_mpfr::mpreal, -1, -1>; int QRPreconditioner = 2; Eigen::JacobiSVD<MatrixType, QRPreconditioner>::MatrixType = Eigen::Matrix<eigen_mpfr::mpreal, -1, -1>]'
../../Macaulay2/e/eigen.cpp:76:82:   required from here
/usr/include/eigen3/Eigen/src/SVD/JacobiSVD.h:673:75: error: too few arguments to function
   const RealScalar considerAsZero = (std::numeric_limits<RealScalar>::min)();
                                                                           ^
compilation terminated due to -Wfatal-errors.

cc: @mikestillman @antonleykin

mahrud commented 3 years ago

Apparently this had happened once before: https://github.com/Macaulay2/M2/issues/1474#issuecomment-678675123

mahrud commented 3 years ago

Oh, bizarre: I cleaned out all of my brew packages, and the error disappeared! I think there's some adverse conflict between some linear algebra libraries, but not sure which.

mahrud commented 3 years ago

For future reference: it seems to be tied to whether -std=gnu++14 is in the arguments or not.