-
Notifications
You must be signed in to change notification settings - Fork 779
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
Use eigen3 config.cmake #1304
Use eigen3 config.cmake #1304
Conversation
cmake/HandleEigen.cmake
Outdated
set(GTSAM_EIGEN_INCLUDE_FOR_INSTALL "${EIGEN3_INCLUDE_DIR}") | ||
# The actual include directory (for BUILD cmake target interface): | ||
# Node Eigen cmake is completelly broken on some version, | ||
# EIGEN3_INCLUDE_DIR is just unusable as it points to some random location. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mean there is no guarantee this will work everywhere and for everyone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means it is really ugly, and should not be necessary on some versions. This works since eigen 3.3.0. Prior Eigen will not, but is not supported anyway AFAIK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should probably replace the text with a comment stating that it will work for Eigen 3.3.0 onwards but may not for prior versions. Basically what you said in your comment. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also in the commit message, but I'll update the comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Since Eigen 3.3.0, a Config.cmake file is provided, thus no need to rely on a custom one. Moreover, the FindEigen3.cmake used in gtsam was erroneously forcing an include directory when using system version of eigen. This fixes bug borglab#1297
bbb7d93
to
774cfd2
Compare
@OznOg this PR is great. I just need to test it out with the Matlab wrapper (we don't have a CI for it) and if that works, I'll approve and merge. :) |
Ok, good news |
Did you have time to test with matlab? any issue? |
@OznOg I've been having issues with my Matlab machine which should be resolved by this weekend. Apologies for the delay, this is my fault. |
Letting @varunagrawal continue the review, but one question I had: there are two Eigen versions people can use: the one included with GTSAM, and system. Will this PR work with both? I know both options are being used. Not sure whether our CI is good at testing both :-/ |
@dellaert yes the CI tests for System Eigen as well. It's in |
Matlab tests pass! Approving. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Uhm, now can't compile anymore:
What's the fix? |
Hi Frank! Was it building the gtsam lib itself, or an example/app? (Note: I've not tested the merged version yet!) |
@OznOg @varunagrawal : Is there any reason to leave a copy of Eigen3 under |
Seems like CMake is picking up a different version of Eigen (3.4 rather than the provided 3.3). Are you on a M1 Mac? |
I believe the idea is that by including Eigen under |
@dellaert FWIW I compiled (and cleaned and compiled) the latest develop on my M1 mac and I don't seem to have this problem. You may want to do a full rebuild? |
That does not work, but #1314 does fix it for me. I'll approve and merge that one... |
Hi guys, is there something I can/need to do to help, or is everything ok now? |
Everything has been figured out. Thanks for following up. :) |
This fixes bug #1297