Eigen doesn't include correctly outside GTSAM project

Issue #228 resolved
Jing Dong created an issue

When we compile any project using GTSAM Vector, it has the error

/usr/local/include/gtsam/base/Vector.h:29:22: fatal error: Eigen/Core: No such file or directory
 #include <Eigen/Core>

Since system Eigen path is in <eigen3/Eigen/Core>, or use GTSAM embedded Eigen path in <gtsam/3rdparty/Eigen/Core>

This issue only happens outside GTSAM project so unit test cannot detect this.

Any idea? Change it back to <gtsam/3rdparty/Eigen/Core>?

Comments (4)

  1. Ignacio Vizzo Account Deactivated

    This is not working again.

    I tried a fresh install from scratch and it didn't work. I get this error if I try to compile outside GTSAM project.

    /usr/local/include/gtsam/base/OptionalJacobian.h:22:10: fatal error: Eigen/Dense: No such file or directory
     #include <Eigen/Dense>
    

    I'm invoking the compiler in this way :

    $ g++-7 -std=c++0x -Wfatal-errors -O0 -g3 -c -fmessage-length=0 -MMD -MP -MF"gtsam_adaptor_test.d" -MT"gtsam_adaptor_test.o" -o "gtsam_adaptor_test.o" "../gtsam_adaptor_test.cpp"
    

    I can fix this doing (adding -I /usr/local/include/gtsam/3rdparty/Eigen/):

    g++-7 -std=c++0x -I /usr/local/include/gtsam/3rdparty/Eigen/ -Wfatal-errors -O0 -g3 -c -fmessage-length=0 -MMD -MP -MF"gtsam_adaptor_test.d" -MT"gtsam_adaptor_test.o" -o "gtsam_adaptor_test.o" "../gtsam_adaptor_test.cpp"
    

    But I didn't need to do this in previous versions of gtsam. I tried to fix this, but I'm not used to the build system.

    It seems to be a very simple issue, we are not appending to the compiler path the directory where is Eigen.

  2. Log in to comment