Closed S-Dafarra closed 4 years ago
I suggest to do list(APPEND OSQP_EIGEN_EXPORTED_DEPENDENCIES osqp "Eigen3 CONFIG")
, as otherwise if you do a find_dependency(Eigen3 REQUIRED)
in an arbitrary project you never know if this will use a local FindEigen3.cmake
or the Eigen3Config.cmake file (that I guess it is what is happening).
Indeed, the local FindEigen3.cmake
of iDynTree does not define a target Eigen3::Eigen
, and that is what is happening. While we could fix the iDynTree FindEigen3.cmake file, this would just hide the problem that could occur also elsewhere.
I suggest to do list(APPEND OSQP_EIGEN_EXPORTED_DEPENDENCIES osqp "Eigen3 CONFIG"), as otherwise if you do a find_dependency(Eigen3 REQUIRED) in an arbitrary project you never know if this will use a local FindEigen3.cmake or the Eigen3Config.cmake file (that I guess it is what is happening).
Awesome! That fixes the issue. I'll open a PR for this.
this would just hide the problem that could occur also elsewhere.
It is already happening now whole-body-estimators
fails with
[ 45%] Building CXX object devices/baseEstimatorV1/CMakeFiles/baseEstimatorV1.dir/src/baseEstimatorV1.cpp.o
In file included from /home/sdafarra/Software/robotology-superbuild/robotology/whole-body-estimators/devices/baseEstimatorV1/include/baseEstimatorV1.h:21,
from /home/sdafarra/Software/robotology-superbuild/robotology/whole-body-estimators/devices/baseEstimatorV1/src/baseEstimatorV1.cpp:9:
/home/sdafarra/Software/robotology-superbuild/build/install/include/iDynTree/Core/EigenHelpers.h:14:10: fatal error: Eigen/Dense: No such file or directory
14 | #include <Eigen/Dense>
| ^~~~~~~~~~~~~
compilation terminated.
make[5]: *** [devices/baseEstimatorV1/CMakeFiles/baseEstimatorV1.dir/build.make:63: devices/baseEstimatorV1/CMakeFiles/baseEstimatorV1.dir/src/baseEstimatorV1.cpp.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:515: devices/baseEstimatorV1/CMakeFiles/baseEstimatorV1.dir/all] Error 2
make[3]: *** [Makefile:130: all] Error 2
make[2]: *** [CMakeFiles/whole-body-estimators.dir/build.make:110: robotology/whole-body-estimators/CMakeFiles/YCMStamp/whole-body-estimators-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:426: CMakeFiles/whole-body-estimators.dir/all] Error 2
make: *** [Makefile:95: all] Error 2
I guess that idyntree_optimal_control
is the was the responsible of having Eigen
available when linking ${iDynTree_LIBRARIES}
(my bad :grin:).
And walking-controllers
:sweat_smile:
[ 7%] Building CXX object src/iDynTreeUtilities/CMakeFiles/iDynTreeUtilities.dir/src/Helper.cpp.o
In file included from /home/sdafarra/Software/robotology-superbuild/robotology/walking-controllers/src/iDynTreeUtilities/src/Helper.cpp:16:
/home/sdafarra/Software/robotology-superbuild/build/install/include/iDynTree/Core/EigenHelpers.h:14:10: fatal error: Eigen/Dense: No such file or directory
14 | #include <Eigen/Dense>
| ^~~~~~~~~~~~~
compilation terminated.
make[5]: *** [src/iDynTreeUtilities/CMakeFiles/iDynTreeUtilities.dir/build.make:63: src/iDynTreeUtilities/CMakeFiles/iDynTreeUtilities.dir/src/Helper.cpp.o] Error 1
make[4]: *** [CMakeFiles/Makefile2:1305: src/iDynTreeUtilities/CMakeFiles/iDynTreeUtilities.dir/all] Error 2
make[3]: *** [Makefile:141: all] Error 2
make[2]: *** [CMakeFiles/walking-controllers.dir/build.make:114: robotology/walking-controllers/CMakeFiles/YCMStamp/walking-controllers-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:1026: CMakeFiles/walking-controllers.dir/all] Error 2
make: *** [Makefile:95: all] Error 2
Since #62 has been merged, I think we can close this issue
Not sure about what is happening, but it is still failing on some jobs of the robotology-superbuild, see https://github.com/robotology/robotology-superbuild/pull/408/checks?check_run_id=677177776 .
Seems that it's failing only on Debian. Do you think that the Eigen3Config.cmake
is not shipped with the Eigen
installed in that distro?
Seems that it's failing only on Debian. Do you think that the
Eigen3Config.cmake
is not shipped with theEigen
installed in that distro?
I saw that it was also failing on Ubuntu 20.04, but you don't see because as soon as one job fails it halts the other. However, Eigen3Config.cmake
is shipped there: https://packages.debian.org/sid/all/libeigen3-dev/filelist . I wonder if there is some weird CMake problem that affects only a specific CMake version.
I saw that it was also failing on Ubuntu 20.04, but you don't see because as soon as one job fails it halts the other. However, Eigen3Config.cmake is shipped there: https://packages.debian.org/sid/all/libeigen3-dev/filelist . I wonder if there is some weird CMake problem that affects only a specific CMake version.
I have CMake
3.16.3 on Ubuntu 20.04. It compiles with the following setup
--------------------------------------------
BlockFactory/: master
3 months ago|Update FindMatlab.cmake file to the version in CMake 3.16.3
--------------------------------------------
funny-things/: master
3 months ago|Merge pull request #14 from robotology/fix/13
--------------------------------------------
GazeboYARPPlugins/: master
5 weeks ago|Merge pull request #479 from prashanthr05/fix/doc-basestate-plugin
--------------------------------------------
ICUB/: master
2 weeks ago|Merge pull request #656 from robotology/traversaro-patch-1
--------------------------------------------
icub-basic-demos/: master
3 months ago|depends on yarp-3.3.2
--------------------------------------------
ICUBcontrib/: master
3 months ago|depends on yarp-3.3.2
--------------------------------------------
icub-gazebo/: master
3 months ago|Merge pull request #73 from robotology/migrate-urdf-model
--------------------------------------------
icub-gazebo-wholebody/: master
9 months ago|Merge pull request #28 from robotology/devel
--------------------------------------------
icub-models/: master
9 weeks ago|Merge pull request #27 from S-Dafarra/feature/fixedModels
--------------------------------------------
iDynTree/: master
9 days ago|Bump version and release 1.0.6 (#690)
--------------------------------------------
OsqpEigen/: devel
17 hours ago|Merge pull request #62 from S-Dafarra/fix/eigenDependency
--------------------------------------------
robots-configuration/: master
10 weeks ago|Merge pull request #175 from lrapetti/fix-sole-calibration-iCubGenova02
--------------------------------------------
speech/: master
3 months ago|disable build of SpeechRecognizer by default
--------------------------------------------
UnicyclePlanner/: master
4 months ago|Merge pull request #32 from robotology/bumpVersion
--------------------------------------------
walking-controllers/: master
17 hours ago|Merge pull request #62 from S-Dafarra/fix/linkEigen
--------------------------------------------
walking-teleoperation/: master
11 months ago|Update README.md
--------------------------------------------
WBToolbox/: master
4 months ago|Merge branch 'devel'
--------------------------------------------
whole-body-controllers/: master
7 weeks ago|Update README.md
--------------------------------------------
whole-body-estimators/: master
13 hours ago|Merge pull request #68 from S-Dafarra/fix/findEigen3
--------------------------------------------
YARP/: yarp-3.3
5 weeks ago|Cleanup OS -> os
--------------------------------------------
yarp-matlab-bindings/: yarp-3.3
6 months ago|Merge pull request #43 from robotology/traversaro-patch-1
--------------------------------------------
YCM/: ycm-0.11
2 weeks ago|Merge pull request #334 from robotology/fix-octave-ycm-0-11
I tried to run a clean Docker image with the scripts in https://github.com/robotology/robotology-superbuild/tree/master/.ci and everything is working. Noticed I used osqp-eigen
devel
Indeed I was wrong, the only failure is just on Debian Sid: https://github.com/robotology/robotology-superbuild/pull/408 . In theory CMake 3.16.3 is the one used on both Debian Sid and Ubuntu Focal, so the issue could be more tricky. For now @GiulioRomualdi @S-Dafarra feel free to ignore the problem (we can also close this issue), in the weekend I will probably spin a Debian Sid image on Docker or WSL to understand what's going on.
I also tried with a clean version of Debian stable
everything seems ok
I also tried with a clean version of
Debian stable
everything seems ok
This confirms that probably there is something due to a new package that is just on Debian sid. In practice no one uses Debian sid, but I placed that build exactly to catch this kind of errors before they arrive to system we actually uses (Debian Stable or Ubuntu LTS). However, for now we ignore it.
Sorry for the noise, the CI failure is indeed in debian:stable
docker image, not debian:sid
.
So, the problem is on Debian Stable because by default Debian Stable uses CMake 3.13, and in CMake 3.13 find_dependency(Eigen3 CONFIG)
does nothing if Eigen3_FOUND
is already defined and set to TRUE, and in our case it was already defined by the FindEigen3.cmake
script that did not defined the Eigen3::Eigen
imported target. In any case, devising a workaround for this problem is probably not worth it, and I will instead just fix iDynTree.
Final fix proposed in https://github.com/robotology/idyntree/pull/691 .
robotology/idyntree#691 fixes the problem. So I close this issue. Feel free to reopen it again.
The first error is the following
which can be easily solved by changing https://github.com/robotology/osqp-eigen/blob/devel/CMakeLists.txt#L110 to
but if I try to compile again I get the following error
It seems weird since
Eigen3::Eigen
should be added when findingEigen3
.@GiulioRomualdi @traversaro