I am attempting to build a large project (Amino) which has dependencies on the Open Motion Planning Library and Eigen. It is built with a makefile.am
, with a makefile created after running autoreconf
and ./configure
. Running make
results in about 20000 lines of errors, starting with after a couple "In file included from" lines:
/usr/local/include/eigen3/Eigen/src/Core/util/Macros.h:711:2: error: #error This compiler appears to be too old to be supported by Eigen
What I expected: make
to run to completion successfully
What I saw: Many errors. All of them appear to be directly related to failure to read/compile Eigen, and none to the library specifically.
What I tried to resolve the problem (all did not resolve/resulted in the same error):
(1)
Changing the final line in /usr/lib/x86_64-linux-gnu/pkgconfig/ompl.pc
from:
Cflags: -std=c++14 -I${includedir} -I/usr/include
to:
Cflags: -std=c++14 -I${includedir} -I/usr/include/eigen3
as per the instructions on http://amino.golems.org/installation.html
(2)
Changing the cflags to -std=c++11 (resulting in an error on the ./configure
step) and -std=c++17
(identical error to the default)
(3) Removing the -std=
argument entirely to completely match the above instructions
(4) Installing Eigen from source versus the apt repository
(5) Checking my compiler and Eigen versions to see if any were especially old or especially new (they were not)
UPDATE
(6) changing the following line in the file configure
:
for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA
to
for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++14 -std=c++0x -qlanglvl=extended0x -AA
The idea being that this would ensure the compilation was done with c++14 rather than c++11. It also did not work.
(7) changing the line further to remove the -std=c++0x
portion, in case that was overwriting the former -std
argument. No effect.
A few other answers exist that are similar to this issue, most notably this question discussing an identical error, but they all assume use of CMake.
System information:
OS: Ubuntu 22.04.2 LTS x86_64
Eigen version: libeigen3-dev (3.3.7-2), installed from apt repository
Compiler: g++, using gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04.1)
Update: As per question 1, line 711 in Eigen/src/Core/util/Macros.h
is as follows:
// The macros EIGEN_HAS_CXX?? defines a rough estimate of available c++ features
// but in practice we should not rely on them but rather on the availability of
// individual features as defined later.
// This is why there is no EIGEN_HAS_CXX17.
#if EIGEN_MAX_CPP_VER < 14 || EIGEN_COMP_CXXVER < 14 || \
(EIGEN_COMP_MSVC && EIGEN_COMP_MSVC < 1900) || \
(EIGEN_COMP_ICC && EIGEN_COMP_ICC < 1500) || \
(EIGEN_COMP_NVCC && EIGEN_COMP_NVCC < 80000) || \
(EIGEN_COMP_CLANG_STRICT && EIGEN_COMP_CLANG < 390) || \
(EIGEN_COMP_CLANGAPPLE && EIGEN_COMP_CLANGAPPLE < 9000000) || \
(EIGEN_COMP_GNUC_STRICT && EIGEN_COMP_GNUC < 510)
#error This compiler appears to be too old to be supported by Eigen
#endif
As per question 2, the make command with V=1
outputs the following:
/bin/bash ./libtool --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I. -I./include -I./include -I./src/mac -std=c++11 -I/usr/local/include -I/usr/local/include/eigen3 -Wwrite-strings -Wshadow -Wfloat-equal -Wpointer-arith -Wconversion -Wextra -g -O2 -MT src/rx/libamino_collision_la-amino_fcl.lo -MD -MP -MF src/rx/.deps/libamino_collision_la-amino_fcl.Tpo -c -o src/rx/libamino_collision_la-amino_fcl.lo `test -f 'src/rx/amino_fcl.cpp' || echo './'`src/rx/amino_fcl.cpp
libtool: compile: g++ -DHAVE_CONFIG_H -I. -I./include -I./include -I./src/mac -std=c++11 -I/usr/local/include -I/usr/local/include/eigen3 -Wwrite-strings -Wshadow -Wfloat-equal -Wpointer-arith -Wconversion -Wextra -g -O2 -MT src/rx/libamino_collision_la-amino_fcl.lo -MD -MP -MF src/rx/.deps/libamino_collision_la-amino_fcl.Tpo -c src/rx/amino_fcl.cpp -fPIC -DPIC -o src/rx/.libs/libamino_collision_la-amino_fcl.o
In file included from /usr/local/include/eigen3/Eigen/Core:19,
from /usr/local/include/eigen3/Eigen/Dense:1,
from /usr/include/fcl/common/types.h:46,
from /usr/include/fcl/math/bv/AABB.h:41,
from /usr/include/fcl/geometry/collision_geometry.h:43,
from /usr/include/fcl/narrowphase/collision_object.h:43,
from /usr/include/fcl/broadphase/broadphase_collision_manager.h:44,
from /usr/include/fcl/broadphase/broadphase_SSaP.h:42,
from /usr/include/fcl/fcl.h:45,
from src/rx/amino_fcl.cpp:53:
/usr/local/include/eigen3/Eigen/src/Core/util/Macros.h:711:2: error: #error This compiler appears to be too old to be supported by Eigen
711 | #error This compiler appears to be too old to be supported by Eigen
Someone suggested below that the standard might be getting lowered to C++11, and the above command corroborates this.
Update/Solution:
I followed a suggestion to uninstall the apt versions of Eigen and OMPL and install them from source. This worked and I was able to build the project successfully. I am not sure why, as the major versions were the same as far as I could tell, but I am not complaining.