arpg / SceneGraph

Auxiliary library for object management of 3D scenes.
Other
16 stars 8 forks source link

Build breaks with Eigen 3.3~beta1-2 (default for Ubuntu 16.04 / latest Mint) #22

Closed Algomorph closed 7 years ago

Algomorph commented 7 years ago

This is a bug that occurs on both the master and new_pangolin branches, using either Steven Lovegrove's version of Pangolin or arpg/Pangolin (same effect), and using Eigen 3.3~beta1-2, provided by universe PPA on Ubuntu 16.04-based systems (default). There is a workaround, provided below.

During compile, I'm getting:

In file included from /usr/include/eigen3/Eigen/Core:367:0,
                 from /usr/local/include/pangolin/gl/gl.h:39,
                 from /usr/local/include/pangolin/pangolin.h:33,
                 from /home/algomorph/Garage/ARPG/SceneGraph/include/SceneGraph/GLinclude.h:3,
                 from /home/algomorph/Garage/ARPG/SceneGraph/include/SceneGraph/GLHelpers.h:12,
                 from /home/algomorph/Garage/ARPG/SceneGraph/include/SceneGraph/FBO.h:4,
                 from /home/algomorph/Garage/ARPG/SceneGraph/include/SceneGraph/SimCam.h:4,
                 from /home/algomorph/Garage/ARPG/SceneGraph/src/SimCam.cpp:1:
/usr/include/eigen3/Eigen/src/Core/Matrix.h: In instantiation of ‘Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>::Matrix(const T&) [with T = pangolin::OpenGlMatrixSpec; _Scalar = double; int _Rows = 4; int _Cols = 4; int _Options = 0; int _MaxRows = 4; int _MaxCols = 4]’:
/home/algomorph/Garage/ARPG/SceneGraph/include/SceneGraph/SimCam.h:163:186:   required from here
/usr/include/eigen3/Eigen/src/Core/Matrix.h:296:31: error: no matching function for call to ‘Eigen::Matrix<double, 4, 4>::_init1(const pangolin::OpenGlMatrixSpec&)’
       Base::template _init1<T>(x);

Following a similar bug report here, I found that a simple workaround is:

  1. Clone Eigen mirror from here.
  2. git checkout tags/3.1.2
  3. (Optional) git checkout -b ver 3.1.2
  4. Recompile Pangolin after setting EIGEN_INCLUDE_DIR to your eigen repository directory in CMake
  5. Recompile SceneGraph after setting EIGEN_INCLUDE_DIR to your eigen repository directory in CMake
crheckman commented 7 years ago

@Algomorph thanks for your helpful writeup. Could you test @crmauceri's fix that's in #23?

Algomorph commented 7 years ago

@crheckman , unfortunately, I cannot, since I'm blocked by #24 on branch fix/eigencompatiblity.

crheckman commented 7 years ago

@Algomorph #24 should be "fixed." There are many ways to address that issue, but the most compatibility-ensuring ones require inheriting a value that Bullet defines in a preprocessor directive BT_USE_DOUBLE_PRECISION which has routinely interfered with my happily living. Since the applications that use Bullet are only examples, I don't think it's worth dragging in that kind of nonsense.

Algomorph commented 7 years ago

@crheckman oh, that's great. I may not remember correctly, but I thought I didn't find away to disable it from using bullet / examples. If this bullet thing no longer affects fix/eigencompatibility or you can tell me how to disable building the bullet stuff, and you still would like for me to test the fix on Ubuntu 16.04, let me know.

Algomorph commented 7 years ago

@crheckman , I've tested fix/eigencompatibility, #23. The library compiles with the new Eigen. I still cannot build the examples that depend on bullet (so I suggest you reopen #24), but that doesn't matter to me.