Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

CMakeLists: use find_package Eigen3 #114

Merged
merged 11 commits into from
May 12, 2016
Merged

CMakeLists: use find_package Eigen3 #114

merged 11 commits into from
May 12, 2016

Conversation

julianoes
Copy link
Contributor

Instead of hardcoding the Eigen3 path which only works on Mac, use
find_package(Eigen3).

Tested on Ubuntu 16.04.

@julianoes
Copy link
Contributor Author

Works in travis again. @priseborough let me know what you think.

@priseborough
Copy link
Collaborator

@mcsauder Does this work for you?

@mcsauder
Copy link
Contributor

mcsauder commented May 3, 2016

Hi @priseborough,

The short answer is yes, but only on my machine with a fresh install of 16.04. On my machine that is upgraded from 15.10 as long as I keep the sympbolic links it works properly, but If I remove the sym links it remains broken like before. Everything appears correct to me, so although I haven't discovered the remedy for an upgraded system without the sym links as opposed to a fresh install, I think the issue is with the OS upgrade, not with the PR.

My other projects were utilizing slightly different syntax in the CMakeLists.tx,

SET(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)

(as opposed to the current PR)

SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR})

and I have tried both, each of which seem to perform identically, just with the same issue I have with the upgrade.

Now that I've verified it on the fresh install machine, I think this PR is the right way, and I'll continue using the sym-link work-around until I get a fresh install on the other machine as well.

Thanks @julianoes for all of the work/feedback/tips! Thanks @priseborough and everyone else for all of the work!!! Awesome job everyone!

-Mark

@julianoes
Copy link
Contributor Author

@mcsauder: is the cmake script actually found and run, or is that the problem that you're having on 15.10?

@mcsauder
Copy link
Contributor

mcsauder commented May 3, 2016

Hi @julianoes,

The cmake script is found, (and the compile script does progress as one would otherwise expect given the error), however the error I get without the sym links is:

fatal error: Eigen/Dense: No such file or directory
compilation terminated.

Again, I observe no errors with the machine with the 16.04 fresh install, only on the machine with the 15.10->16.04 upgrade. It still has me scratching my head, but everything does compile fine for me with sym links in place on the upgraded machine.

(Also, when I have removed the sym links, I have followed with an apt-get remove libeigen3-dev, then apt-get install libeigen3-dev, then I have been checking the compile, which still fails, then I re-add the sym links again and compile passes.) I think this must be an issue local to my machine somehow. Please don't let it slow down the PR. Please let me know if there is anything else I can check that might be useful to anyone else.

-Mark

@julianoes
Copy link
Contributor Author

@mcsauder: and I presume you tried to do a fresh cmake check using:

rm -rf Build
mkdir Build
cd Build
cmake ../EKF

What do you get if you add this in CMakeLists.txt after find_package:

message("Found Eigen3 include dir: ${EIGEN3_INCLUDE_DIR}")

@mcsauder
Copy link
Contributor

mcsauder commented May 3, 2016

@julianoes, typically I've been using a make clean command:

cd build/
make clean
cd ..

but I have also wiped the build directory manually as well just as you've described.

Thanks for asking about adding that line... it appears that might reveal an issue:

Found Eigen3 include dir: /usr//usr/include/eigen3

notice the extra "/usr/"

@julianoes
Copy link
Contributor Author

That looks odd. And that's with all symlinks removed? I wonder if this is the cmake's script's bug...

@mcsauder
Copy link
Contributor

mcsauder commented May 3, 2016

Indeed, that's with the sym links removed. With the sym links added there are no issues, just re-checked that, everything's compiling for me with the links. I think this has to be an issue with my local machine that I can't explain... It wasn't there before upgrading, but it's not an issue on my other machine with a clean install... so weird! I think I am convinced I'll do a fresh install on this machine though. :)

Thanks for looking at all of that with me!

-Mark

@julianoes
Copy link
Contributor Author

Ok odd. Thanks for testing this though.

@julianoes
Copy link
Contributor Author

@LorenzMeier merge please if you agree with the change.

@priseborough
Copy link
Collaborator

@LorenzMeier Bump

@julianoes
Copy link
Contributor Author

Fixed merge conflicts. Tested on Ubuntu 15.10. Good to merge.

@julianoes
Copy link
Contributor Author

Ok, checks fail now because -Werror is on.

@julianoes
Copy link
Contributor Author

@LorenzMeier I think this is good to merge now.

@LorenzMeier LorenzMeier merged commit d595596 into master May 12, 2016
@LorenzMeier LorenzMeier deleted the fix_linux_build branch May 12, 2016 10:55
@LorenzMeier
Copy link
Member

Awesome, thanks!

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

Successfully merging this pull request may close these issues.

4 participants