osqp-eigen: Devel breaks idyntree::optimal_control
The first error is the following
t searching for unused variables given on the command line.
loading initial cache file /home/sdafarra/Software/robotology-superbuild/build/robotology/iDynTree/CMakeFiles/YCMTmp/iDynTree-cache-Release.cmake
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "3.2.92")
-- Found YARP: /home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/YARP (found version "3.3.2+43-20200411.3+gita33cf54b1")
-- Found YARP: /home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/YARP (found version "3.3.2+43-20200411.3+gita33cf54b1")
-- Using iCub from install
-- Found YARP: /home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/YARP (found version "3.3.2+43-20200411.3+gita33cf54b1")
CMake Error at /usr/share/cmake-3.16/Modules/CMakeFindDependencyMacro.cmake:47 (find_package):
By not providing "FindEigen.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "Eigen", but
CMake did not find one.
Could not find a package configuration file provided by "Eigen" with any of
the following names:
EigenConfig.cmake
eigen-config.cmake
Add the installation prefix of "Eigen" to CMAKE_PREFIX_PATH or set
"Eigen_DIR" to a directory containing one of the above files. If "Eigen"
provides a separate development package or SDK, be sure it has been
installed.
Call Stack (most recent call first):
/home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/OsqpEigen/OsqpEigenConfig.cmake:23 (find_dependency)
cmake/iDynTreeDependencies.cmake:51 (find_package)
cmake/iDynTreeDependencies.cmake:91 (idyntree_handle_dependency)
CMakeLists.txt:43 (include)
-- Configuring incomplete, errors occurred!
See also "/home/sdafarra/Software/robotology-superbuild/build/robotology/iDynTree/CMakeFiles/CMakeOutput.log".
make[2]: *** [CMakeFiles/iDynTree.dir/build.make:104: robotology/iDynTree/CMakeFiles/YCMStamp/iDynTree-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:1108: CMakeFiles/iDynTree.dir/all] Error 2
make: *** [Makefile:95: all] Error 2
which can be easily solved by changing https://github.com/robotology/osqp-eigen/blob/devel/CMakeLists.txt#L110 to
list(APPEND OSQP_EIGEN_EXPORTED_DEPENDENCIES osqp Eigen3)
but if I try to compile again I get the following error
[ 25%] Performing configure step for 'iDynTree'
Not searching for unused variables given on the command line.
loading initial cache file /home/sdafarra/Software/robotology-superbuild/build/robotology/iDynTree/CMakeFiles/YCMTmp/iDynTree-cache-Release.cmake
-- Found YARP: /home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/YARP (found version "3.3.2+43-20200411.3+gita33cf54b1")
-- Found YARP: /home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/YARP (found version "3.3.2+43-20200411.3+gita33cf54b1")
-- Using iCub from install
-- Found YARP: /home/sdafarra/Software/robotology-superbuild/build/install/lib/cmake/YARP (found version "3.3.2+43-20200411.3+gita33cf54b1")
-- Found Eigen3: /usr/include/eigen3 (Required is at least version "2.91.0")
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.
FindOpenGL found both a legacy GL library:
OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so
and GLVND libraries for OpenGL and GLX:
OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so
OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
src/visualization/CMakeLists.txt:63 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.
-- Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)
-- Configuring done
CMake Error at src/optimalcontrol/CMakeLists.txt:107 (add_library):
Target "idyntree-optimalcontrol" links to target "Eigen3::Eigen" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
CMake Error at src/optimalcontrol/CMakeLists.txt:107 (add_library):
Target "idyntree-optimalcontrol" links to target "Eigen3::Eigen" but the
target was not found. Perhaps a find_package() call is missing for an
IMPORTED target, or an ALIAS target is missing?
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.
make[2]: *** [CMakeFiles/iDynTree.dir/build.make:104: robotology/iDynTree/CMakeFiles/YCMStamp/iDynTree-configure] Error 1
make[1]: *** [CMakeFiles/Makefile2:1108: CMakeFiles/iDynTree.dir/all] Error 2
make: *** [Makefile:95: all] Error 2
It seems weird since Eigen3::Eigen should be added when finding Eigen3.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 18 (14 by maintainers)
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 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-eigendevelIndeed, the local
FindEigen3.cmakeof iDynTree does not define a targetEigen3::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.