Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GTSAM was built against a different version of Eigen #12

Closed
hardesh opened this issue Oct 26, 2019 · 16 comments · Fixed by #34
Closed

GTSAM was built against a different version of Eigen #12

hardesh opened this issue Oct 26, 2019 · 16 comments · Fixed by #34
Assignees

Comments

@hardesh
Copy link

hardesh commented Oct 26, 2019

Description:
I built gtsam with and without the default eigen. Still getting the error

Console output:

In file included from /home/harshal/vio_ws/devel/include/gtsam/base/Matrix.h:26:0,
                 from /home/harshal/vio_ws/devel/include/gtsam/base/Manifold.h:22,
                 from /home/harshal/vio_ws/devel/include/gtsam/base/Lie.h:25,
                 from /home/harshal/vio_ws/devel/include/gtsam/base/VectorSpace.h:11,
                 from /home/harshal/vio_ws/devel/include/gtsam/geometry/Point2.h:20,
                 from /home/harshal/vio_ws/devel/include/gtsam/geometry/Cal3_S2.h:24,
                 from /home/harshal/vio_ws/src/Kimera-VIO/include/kimera-vio/StereoFrame.h:35,
                 from /home/harshal/vio_ws/src/Kimera-VIO/include/kimera-vio/StereoVisionFrontEnd.h:25,
                 from /home/harshal/vio_ws/src/Kimera-VIO/src/StereoVisionFrontEnd.cpp:16:
/home/harshal/vio_ws/devel/include/gtsam/base/Vector.h:72:1: error: static assertion failed: Error: GTSAM was built against a different version of Eigen
 static_assert(

Similar error is thrown for other library files.

Please give also the following information:

  • Operating system and version (e.g. Ubuntu 16.04 or Windows 10): ubuntu 16.04 with ROS kinetic
  • Did you change the source code? (yes / no): no
@hardesh
Copy link
Author

hardesh commented Oct 26, 2019

if(GTSAM_USE_SYSTEM_EIGEN)
	find_package(Eigen3 REQUIRED)

	# Use generic Eigen include paths e.g. <Eigen/Core>
	set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "${EIGEN3_INCLUDE_DIR}")

	# check if MKL is also enabled - can have one or the other, but not both!
	# Note: Eigen >= v3.2.5 includes our patches
	if(EIGEN_USE_MKL_ALL AND (EIGEN3_VERSION VERSION_LESS 3.2.5))
	  message(FATAL_ERROR "MKL requires at least Eigen 3.2.5, and your system appears to have an older version. Disable GTSAM_USE_SYSTEM_EIGEN to use GTSAM's copy of Eigen, or disable GTSAM_WITH_EIGEN_MKL")
	endif()

	# Check for Eigen version which doesn't work with MKL
	# See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1527 for details.
	if(EIGEN_USE_MKL_ALL AND (EIGEN3_VERSION VERSION_EQUAL 3.3.4))
		message(FATAL_ERROR "MKL does not work with Eigen 3.3.4 because of a bug in Eigen. See http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1527. Disable GTSAM_USE_SYSTEM_EIGEN to use GTSAM's copy of Eigen, disable GTSAM_WITH_EIGEN_MKL, or upgrade/patch your installation of Eigen.")
	endif()

	# The actual include directory (for BUILD cmake target interface):
	set(GTSAM_EIGEN_INCLUDE_FOR_BUILD "${EIGEN3_INCLUDE_DIR}")
else()
	# Use bundled Eigen include path.
	# Clear any variables set by FindEigen3
	if(EIGEN3_INCLUDE_DIR)
		set(EIGEN3_INCLUDE_DIR NOTFOUND CACHE STRING "" FORCE)
	endif()

	# set full path to be used by external projects
	# this will be added to GTSAM_INCLUDE_DIR by gtsam_extra.cmake.in
	set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "include/gtsam/3rdparty/Eigen/")

	# The actual include directory (for BUILD cmake target interface):
	set(GTSAM_EIGEN_INCLUDE_FOR_BUILD "${CMAKE_SOURCE_DIR}/gtsam/3rdparty/Eigen/")

	message("used bundled eigen")   # added this line

endif()

I added message in the CMake to check whether the gtsam was getting built with the proper version and I was able to see the message output on the terminal window.

@jbdaniel18
Copy link

jbdaniel18 commented Oct 29, 2019

Having the same issue when building kimera_ros. Any update on this? It seems that if I build gtsam with the bundled eigen version KimeraRPGO fails to build but I can build Kimera-VIO. If I build with the system version of eigen I can build the RPGO but not the VIO. the wrapper fails to build with either eigen version

@hardesh
Copy link
Author

hardesh commented Oct 30, 2019

I built GTSAM separately from source. I stopped getting this issue. But I am not able to build KimeraVIO package. My laptop crashes everytime I try to build the package. I am still not sure why this is happening.

@jbdaniel18
Copy link

Interesting. I am able to build KimeraVIO if I force GTSAM to use the bundled version of eigen. But KimeraRPGO will not build if the bundled eigen version is used. KimeraRPGO gets the error "/devel/include/gtsam/base/OptionalJacobian.h:22:23: fatal error: Eigen/Dense: No such file or directory". kimera_ros still gets "/devel/include/gtsam/base/Vector.h:72:1: error: static assertion failed: Error: GTSAM was built against a different version of Eigen" regardless of which eigen version I am building gtsam with

@ToniRV
Copy link
Collaborator

ToniRV commented Nov 7, 2019

@jbdaniel18 what Ubuntu are you using?
It seems this issue is related to Ubuntu 16.04 only, just to check.

@jbdaniel18
Copy link

I am using Ubuntu 16.04

@hardesh
Copy link
Author

hardesh commented Nov 10, 2019

I am also using Ubuntu 16.04

@Xcrater
Copy link

Xcrater commented Nov 11, 2019

Hi, I am able to build KimeraRPGO but Kimera VIO fails. I am using Ubuntu 16.04 as well.

@673402618
Copy link

Hi, I am using Ubuntu 16.04. I found the problem is that the package pcl_ros relies on Eigen 3.2.92 in /usr/include. I replace it with Eigen 3.3.7 and build successfully. But it may cause other problems.
I test it on EuRoC dataset. It can work, but there is a red on terminal Attempt to register LCD/PGO callback, but no LoopClosureDetector member is active in pipeline.

@ToniRV
Copy link
Collaborator

ToniRV commented Nov 14, 2019

Thanks @673402618 ! The error message can be safely ignored. It is just that the Loop Closure detector is not activated.

@roelofvandijk
Copy link

roelofvandijk commented Nov 26, 2019

Same issue, fixed by upgrading system eigen in /usr/include/eigen3 to Eigen 3.3.7. Thanks @673402618.

@mzahana
Copy link

mzahana commented Dec 19, 2019

@roelofvandijk can you please describe how you updated Eigen? Is it through source or apt-get?

@mzahana
Copy link

mzahana commented Dec 19, 2019

I was able to fix the problem by setting GTSAM_USE_SYSTEM_EIGEN=ON:

catkin build --cmake-args -DCMAKE_BUILD_TYPE=Release -DGTSAM_USE_SYSTEM_EIGEN=ON

@hardesh
Copy link
Author

hardesh commented Jan 3, 2020

Switched to Ubuntu 18.04 and ROS melodic. I did not come across this issue after that.

@hardesh hardesh closed this as completed Jan 3, 2020
m-pilia added a commit to m-pilia/Kimera-VIO-ROS that referenced this issue Jan 16, 2020
Add -DGTSAM_USE_SYSTEM_EIGEN=ON to CMake flags for
Ubuntu 16.04 (see issue MIT-SPARK#12).
@ToniRV
Copy link
Collaborator

ToniRV commented Feb 18, 2020

Check also #43

@devgooner
Copy link

cmake .. -DGTSAM_USE_SYSTEM_EIGEN=ON
make

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants