Skip to content
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

Add bipedal-locomotion-framework #526

Merged
merged 24 commits into from
Nov 26, 2020
Merged

Conversation

GiulioRomualdi
Copy link
Member

This is the first test for having bipedal-locomotion-framework in the superbuild.
I'm pretty sure I missed something

cc @traversaro @S-Dafarra

@traversaro
Copy link
Member

Thanks! At a first glance it seem nice, let's see what is missing. For adding a new components the documentation as outline by the steps in https://github.com/robotology/robotology-superbuild/blob/master/doc/developers-faqs.md#how-to-add-a-new-profile, but let's first see if CI passes, and then we can go forward.

TAG master
COMPONENT dynamics
FOLDER robotology
CMAKE_ARGS -DBUILD_TESTING:BOOL=OFF
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could it make sense to pass the options on enabling/disabling the dependencies explicitly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


include(YCMEPHelper)

set(bipedal-locomotion-framework_DEPENDS "")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably in the CMake world we can stick to the CMake package name for consistency, so:

Suggested change
set(bipedal-locomotion-framework_DEPENDS "")
set(BipedalLocomotionFramework_DEPENDS "")

@@ -161,9 +162,17 @@ if(ROBOTOLOGY_ENABLE_DYNAMICS)
find_or_build_package(walking-controllers)
find_or_build_package(whole-body-estimators)
find_or_build_package(whole-body-controllers)
find_or_build_package(bipedal-locomotion-framework)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name here should match the one of the Build<package>.cmake and the one passed to ycm_ep_helper . Even if not strictly necessary, it is a good idea to just use the cmake package name (so in this case BipedalLocomotionFramework), because find_or_build_package mirrors find_package, so if we have:

find_package(BipedalLocomotionFramework)

we should also have:

find_or_build_package(BipedalLocomotionFramework)

@traversaro
Copy link
Member

The casadi error on Debian Buster are one of those that make you feel alive:

2020-11-22T14:35:49.3238803Z CMake Deprecation Warning at CMakeLists.txt:31 (cmake_policy):
2020-11-22T14:35:49.3239537Z   The OLD behavior for policy CMP0011 will be removed from a future version
2020-11-22T14:35:49.3240053Z   of CMake.
2020-11-22T14:35:49.3240274Z 
2020-11-22T14:35:49.3240935Z   The cmake-policies(7) manual explains that the OLD behaviors of all
2020-11-22T14:35:49.3241680Z   policies are deprecated and that a policy should be set to OLD only under
2020-11-22T14:35:49.3242608Z   specific short-term circumstances.  Projects should be ported to the NEW
2020-11-22T14:35:49.3243301Z   behavior and not rely on setting a policy to OLD.
2020-11-22T14:35:49.3243625Z 
2020-11-22T14:35:49.3243818Z 
2020-11-22T14:35:49.3244321Z CMake Deprecation Warning at CMakeLists.txt:35 (cmake_policy):
2020-11-22T14:35:49.3245034Z   The OLD behavior for policy CMP0005 will be removed from a future version
2020-11-22T14:35:49.3245541Z   of CMake.
2020-11-22T14:35:49.3245767Z 
2020-11-22T14:35:49.3246437Z   The cmake-policies(7) manual explains that the OLD behaviors of all
2020-11-22T14:35:49.3247173Z   policies are deprecated and that a policy should be set to OLD only under
2020-11-22T14:35:49.3248110Z   specific short-term circumstances.  Projects should be ported to the NEW
2020-11-22T14:35:49.3248791Z   behavior and not rely on setting a policy to OLD.
2020-11-22T14:35:49.3249126Z 
2020-11-22T14:35:49.3249316Z 
2020-11-22T14:35:49.3249752Z CMake Error at CMakeLists.txt:99 (enable_language):
2020-11-22T14:35:49.3250410Z   The Ninja generator does not support Fortran using Ninja version
2020-11-22T14:35:49.3250813Z 
2020-11-22T14:35:49.3251081Z     1.8.2
2020-11-22T14:35:49.3251261Z 
2020-11-22T14:35:49.3251785Z   due to lack of required features.  Kitware has implemented the required
2020-11-22T14:35:49.3252538Z   features and they have been merged to upstream ninja for inclusion in Ninja
2020-11-22T14:35:49.3253426Z   1.10 and higher.  As of this version of CMake, Ninja 1.10 has not been
2020-11-22T14:35:49.3254170Z   released.  Meanwhile, Kitware maintains a branch of Ninja at:
2020-11-22T14:35:49.3254575Z 
2020-11-22T14:35:49.3255358Z     https://github.com/Kitware/ninja/tree/features-for-fortran#readme
2020-11-22T14:35:49.3255884Z 
2020-11-22T14:35:49.3256526Z   with the required features.  One may build ninja from that branch to get
2020-11-22T14:35:49.3257083Z   support for Fortran.
2020-11-22T14:35:49.3257347Z 
2020-11-22T14:35:49.3257521Z 
2020-11-22T14:35:49.3258115Z -- Configuring incomplete, errors occurred!
2020-11-22T14:35:49.3259290Z See also "/__w/robotology-superbuild/robotology-superbuild/build/external/casadi/CMakeFiles/CMakeOutput.log".

However, Debian Buster is one of those platforms for which we keep compatibility mostly for the Core software to run on the pc104 of old robots, probably we do not need for now to support ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS on it.

@traversaro
Copy link
Member

However, Debian Buster is one of those platforms for which we keep compatibility mostly for the Core software to run on the pc104 of old robots, probably we do not need for now to support ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS on it.

Anyhow, I just check and this is sweet: Debian Buster backports has indeed Ninja 1.10 (see https://packages.debian.org/buster-backports/ninja-build), so we just need to install it from the backports as we already to for CMake in https://packages.debian.org/buster-backports/ninja-build . However, if more problem emerge we can just avoid to test it on Debian Buster, even because now that we support conda we can easily compile our code on arbitrary old Linux distributions through it.

@GiulioRomualdi
Copy link
Member Author

I think we need to change the idyntree tag

@traversaro
Copy link
Member

I think we need to change the idyntree tag

I will release iDynTree 2.0 soon in the next days, this should handle that. Instead we need to have a way to exclude some components from the release.

@GiulioRomualdi
Copy link
Member Author

Instead we need to have a way to exclude some components from the release.

I didn't get it

@traversaro
Copy link
Member

Instead we need to have a way to exclude some components from the release.

I didn't get it

The release of the robotology-superbuild is coherent group of tags for all the subprojects, that are continuously tested together. As BFL still do not have a release for the 2020.11 release of the superbuild, I would like to exclude it from the release 2020.11, while including in the "rolling release" version of the superbuild that we typically used in the lab. However it was not a request for a PR, more a note for me.

@traversaro
Copy link
Member

I think we need to change the idyntree tag

Once this PR is approved: robotology/idyntree#778 , I will release iDynTree 2.0.0 and then we will have a bfl-compatible iDynTree on both 2020.11 release, Stable and Unstable branches.

@GiulioRomualdi GiulioRomualdi linked an issue Nov 24, 2020 that may be closed by this pull request
@GiulioRomualdi
Copy link
Member Author

As discussed in #517 (comment) some dependencies can be installed with brew/vcpkg. We now should decide what to do for them.

For instance, qhull can be installed with brew. Should the superbuild fail if qhull is missing in macOS while it will compile it in Linux?

@GiulioRomualdi
Copy link
Member Author

GiulioRomualdi commented Nov 24, 2020

  • On the conda profile casadi is failing because it's not able to find ipopt. However, ipopt is installed

    mamba install -c conda-forge ace asio boost eigen gazebo glew glfw gsl ipopt libjpeg-turbo libmatio libode libxml2 opencv pkg-config portaudio qt sdl sdl2 sqlite tinyxml

  • on debian-sid

    2020-11-24T17:56:27.5679257Z FAILED: bin/multiple_shooting_from_scratch 
    2020-11-24T17:56:27.5681527Z : && /usr/bin/c++ -fPIC -g -rdynamic 
    docs/examples/cplusplus/CMakeFiles/multiple_shooting_from_scratch.dir/multiple_shooting_from_scratch.cpp.o -o 
    bin/multiple_shooting_from_scratch -L/usr/lib/gcc/lib -Wl,-rpath,/usr/lib/gcc/lib:/__w/robotology-superbuild/robotology-superbuild/build/external/casadi/lib  lib/libcasadi.so.3.6  -ldl && :
    2020-11-24T17:56:27.5686120Z /usr/bin/ld: docs/examples/cplusplus/CMakeFiles/multiple_shooting_from_scratch.dir/multiple_shooting_from_scratch.cpp.o: in function `casadi::GenericMatrix<casadi::Matrix<casadi::SXElem> >::sparsity() const':
    2020-11-24T17:56:27.5689123Z /__w/robotology-superbuild/robotology-superbuild/external/casadi/./casadi/core/generic_matrix.hpp:860: undefined reference to  `casadi::Matrix<casadi::SXElem>::sparsity() const'
    2020-11-24T17:56:27.5690345Z collect2: error: ld returned 1 exit status
    2020-11-24T17:56:27.5690961Z ninja: build stopped: subcommand failed.
    

@traversaro
Copy link
Member

I would disable for now the ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS in conda and Debian sid. Both are still highly experimental environments that are definitely not our first target.

@traversaro
Copy link
Member

As discussed in #517 (comment) some dependencies can be installed with brew/vcpkg. We now should decide what to do for them.

For instance, qhull can be installed with brew. Should the superbuild fail if qhull is missing in macOS while it will compile it in Linux?

At the moment I would for the simplest solution, i.e. compile everywhere, we can complexify it once the first PR is landed.

@GiulioRomualdi
Copy link
Member Author

  • on Tags:Release202011@ubuntu-18.04@Release is failing with
    BipedalLocomotion::Planners::TimeVaryingDCMPlanner::Impl::computeConstraintElementsECMP(const 
    BipedalLocomotion::Planners::ContactPhase&, casadi::DM&, casadi::DM&)’:
    2020-11-24T18:11:03.4963635Z /home/runner/work/robotology-superbuild/robotology-superbuild/robotology/BipedalLocomotionFramework/src/Planners/src/TimeVaryingDCMPlanner.cpp:312:53: error: unused variable ‘contactName’ [-Werror=unused-variable]
    2020-11-24T18:11:03.4965142Z          for (const auto& [contactName, activeContact] : contactPhase.activeContacts)
    2020-11-24T18:11:03.4971726Z                                                      ^
    2020-11-24T18:11:07.1228673Z cc1plus: some warnings being treated as errors
    2020-11-24T18:11:07.1376820Z src/Planners/CMakeFiles/Planners.dir/build.make:105: recipe for target 'src/Planners/CMakeFiles/Planners.dir/src/TimeVaryingDCMPlanner.cpp.o' failed
    2020-11-24T18:11:07.1378922Z CMakeFiles/Makefile2:980: recipe for target 'src/Planners/CMakeFiles/Planners.dir/all' failed
    2020-11-24T18:11:07.1383038Z make[5]: *** [src/Planners/CMakeFiles/Planners.dir/src/TimeVaryingDCMPlanner.cpp.o] Error 1
    2020-11-24T18:11:07.1384252Z Makefile:146: recipe for target 'all' failed
    2020-11-24T18:11:07.1385871Z make[4]: *** [src/Planners/CMakeFiles/Planners.dir/all] Error 2
    2020-11-24T18:11:07.1389338Z CMakeFiles/BipedalLocomotionFramework.dir/build.make:134: recipe for target 'robotology/BipedalLocomotionFramework/CMakeFiles/YCMStamp/BipedalLocomotionFramework-build' failed
    2020-11-24T18:11:07.1390862Z make[3]: *** [all] Error 2
    2020-11-24T18:11:07.1392036Z make[2]: *** [robotology/BipedalLocomotionFramework/CMakeFiles/YCMStamp/BipedalLocomotionFramework-build] Error 2
    2020-11-24T18:11:07.1393701Z make[1]: *** [CMakeFiles/BipedalLocomotionFramework.dir/all] Error 2
    2020-11-24T18:11:07.1395211Z CMakeFiles/Makefile2:547: recipe for target 'CMakeFiles/BipedalLocomotionFramework.dir/all' failed
    2020-11-24T18:11:07.1396710Z Makefile:111: recipe for target 'all' failed
    2020-11-24T18:11:07.1397361Z make: *** [all] Error 2
    2020-11-24T18:11:07.1416062Z ##[error]Process completed with exit code 2.
    
    This happens because the master version of manif is used. (I think something is missing in the release yml file). This problem has been solved in Fix undesired compile options when gcc is used artivis/manif#157 (manif devel)

@traversaro
Copy link
Member

I would disable for now the ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS in conda and Debian sid. Both are still highly experimental environments that are definitely not our first target.

As the situation is quickly growing complex for the relative compatibility of options and platform support, I am preparing a matrix to clarify which profiles are a supported on which platform, I am adding it after #535 lands.

@traversaro
Copy link
Member

* on `Tags:Release202011@ubuntu-18.04@Release` is failing with
  ```
  BipedalLocomotion::Planners::TimeVaryingDCMPlanner::Impl::computeConstraintElementsECMP(const 
  BipedalLocomotion::Planners::ContactPhase&, casadi::DM&, casadi::DM&)’:
  2020-11-24T18:11:03.4963635Z /home/runner/work/robotology-superbuild/robotology-superbuild/robotology/BipedalLocomotionFramework/src/Planners/src/TimeVaryingDCMPlanner.cpp:312:53: error: unused variable ‘contactName’ [-Werror=unused-variable]
  2020-11-24T18:11:03.4965142Z          for (const auto& [contactName, activeContact] : contactPhase.activeContacts)
  2020-11-24T18:11:03.4971726Z                                                      ^
  2020-11-24T18:11:07.1228673Z cc1plus: some warnings being treated as errors
  2020-11-24T18:11:07.1376820Z src/Planners/CMakeFiles/Planners.dir/build.make:105: recipe for target 'src/Planners/CMakeFiles/Planners.dir/src/TimeVaryingDCMPlanner.cpp.o' failed
  2020-11-24T18:11:07.1378922Z CMakeFiles/Makefile2:980: recipe for target 'src/Planners/CMakeFiles/Planners.dir/all' failed
  2020-11-24T18:11:07.1383038Z make[5]: *** [src/Planners/CMakeFiles/Planners.dir/src/TimeVaryingDCMPlanner.cpp.o] Error 1
  2020-11-24T18:11:07.1384252Z Makefile:146: recipe for target 'all' failed
  2020-11-24T18:11:07.1385871Z make[4]: *** [src/Planners/CMakeFiles/Planners.dir/all] Error 2
  2020-11-24T18:11:07.1389338Z CMakeFiles/BipedalLocomotionFramework.dir/build.make:134: recipe for target 'robotology/BipedalLocomotionFramework/CMakeFiles/YCMStamp/BipedalLocomotionFramework-build' failed
  2020-11-24T18:11:07.1390862Z make[3]: *** [all] Error 2
  2020-11-24T18:11:07.1392036Z make[2]: *** [robotology/BipedalLocomotionFramework/CMakeFiles/YCMStamp/BipedalLocomotionFramework-build] Error 2
  2020-11-24T18:11:07.1393701Z make[1]: *** [CMakeFiles/BipedalLocomotionFramework.dir/all] Error 2
  2020-11-24T18:11:07.1395211Z CMakeFiles/Makefile2:547: recipe for target 'CMakeFiles/BipedalLocomotionFramework.dir/all' failed
  2020-11-24T18:11:07.1396710Z Makefile:111: recipe for target 'all' failed
  2020-11-24T18:11:07.1397361Z make: *** [all] Error 2
  2020-11-24T18:11:07.1416062Z ##[error]Process completed with exit code 2.
  ```
  
  
  This happens because the master version of `manif` is used. (I think something is missing in the release `yml` file). This problem has been solved in [artivis/manif#157](https://github.com/artivis/manif/pull/157) (`manif devel`)

As in any case we are not going to add tags for bfl in 2020.11, I think we can skip that profile for now in release CIs, for example adding after all the configure steps:

    - name: Disable profiles that do not support releases for now
      if: contains(matrix.project_tags, 'Release')
      run: | 
        cd build
        cmake -DROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS:BOOL=OFF .

@GiulioRomualdi
Copy link
Member Author

GiulioRomualdi commented Nov 24, 2020

As in any case we are not going to add tags for bfl in 2020.11,

ops I did it in 082ec05
I remove it now

@traversaro
Copy link
Member

This happens because the master version of manif is used. (I think something is missing in the release yml file). This problem has been solved in artivis/manif#157 (manif devel)

As in any case we are not going to add tags for bfl in 2020.11,

ops I did it in 082ec05
I remove it now

Ah cool, that's fine then, you can leave them, I did not think we wanted to do that for the moment, but if you did the effort we can leave them.

@GiulioRomualdi
Copy link
Member Author

I also added matio-cpp that it's a dependency of blf. See 7e6f604
cc @S-Dafarra

@GiulioRomualdi GiulioRomualdi self-assigned this Nov 25, 2020
@traversaro
Copy link
Member

I also added matio-cpp that it's a dependency of blf. See 7e6f604
cc @S-Dafarra

I think we need to add matio to the apt and brew dependencies in docs and CI, in vcpkg binary archive it is already available.

@GiulioRomualdi
Copy link
Member Author

I realized that ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS was disabled in Windows CI. b62342b fixes the problem
Furthermore a97dab5 forces casadi to be installed following "normal" folder structure. This is required in windows. Please check here

@traversaro
Copy link
Member

Casadi failures on Linux:

2020-11-26T11:01:14.0058780Z -- Install configuration: "Debug"
2020-11-26T11:01:14.0059403Z CMake Error at cmake_install.cmake:49 (file):
2020-11-26T11:01:14.0060296Z   file called with unknown argument "lib/cmake/casadi""".

@GiulioRomualdi
Copy link
Member Author

@traversaro

Casadi failures on Linux:

2020-11-26T11:01:14.0058780Z -- Install configuration: "Debug"
2020-11-26T11:01:14.0059403Z CMake Error at cmake_install.cmake:49 (file):
2020-11-26T11:01:14.0060296Z   file called with unknown argument "lib/cmake/casadi""".

It should be fixed in 91377a0

@GiulioRomualdi
Copy link
Member Author

On windows is failing but I'm not able to find it. @traversaro could you help me?

@GiulioRomualdi
Copy link
Member Author

Everything is compiling!!!

@traversaro traversaro merged commit b3e3833 into robotology:master Nov 26, 2020
@traversaro
Copy link
Member

Thanks @GiulioRomualdi

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

Successfully merging this pull request may close these issues.

Porting bipedal-locomotion-framework in the superbuild
2 participants