diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f31cc76a0..b871c81c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,6 +167,10 @@ jobs: # Using b instead of build as a temporary workaround to https://github.com/robotology/robotology-superbuild/issues/1542#issuecomment-1827682957 # Go back to build once https://github.com/robotology/yarp/pull/3057 is merged and released cd b + # Make sure that (on Windows) YARP's dll are in the path in case some repos use a code generator + # in their build that uses YARP's dll + # https://github.com/robotology/robotology-superbuild/pull/1547#issuecomment-2278151057 + source ./install/share/robotology-superbuild/setup.sh cmake --build . --config ${{ matrix.build_type }} # Skip on Apple Silicon https://github.com/robotology/robotology-superbuild/issues/1625 @@ -179,7 +183,7 @@ jobs: docker-build: name: '[docker:Tags:${{ matrix.project_tags }}@${{ matrix.docker_image }}@${{ matrix.build_type }}]' - runs-on: ubuntu-20.04 + runs-on: ubuntu-22.04 strategy: fail-fast: false matrix: @@ -187,10 +191,9 @@ jobs: cmake_generator: - "Ninja" docker_image: - - "ubuntu:focal" - - "ubuntu:jammy" + - "ubuntu:20.04" + - "ubuntu:22.04" - "ubuntu:24.04" - - "debian:bullseye" project_tags: - Default @@ -218,20 +221,20 @@ jobs: rm -rf /host_usr_local/lib/android rm -rf /host_usr_local/lib/node_modules - - name: Upgrade apt packages Debian Testing [Debian Testing] - if: matrix.docker_image == 'debian:testing' - run: | - # The Debian testing docker image is generated only - # once a month, so to actually test with the latest - # packages we need to manually upgrade the packages - apt-get -y upgrade - - name: Dependencies [Docker] run: | chmod +x ./.ci/install_debian.sh bash ./.ci/install_debian.sh - + - name: Install recent CMake [Docker/Ubuntu Focal] + if: matrix.docker_image == 'ubuntu:20.04' + run: | + apt-get -y update + apt-get install -y ca-certificates software-properties-common gpg wget + wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null + echo 'deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ focal main' | tee /etc/apt/sources.list.d/kitware.list >/dev/null + apt-add-repository 'deb https://apt.kitware.com/ubuntu/ focal main' + apt-get install -y cmake - name: Configure [Docker] run: | @@ -239,14 +242,8 @@ jobs: cd build cmake -C ${GITHUB_WORKSPACE}/.ci/initial-cache.gh.cmake -G"${{ matrix.cmake_generator }}" -DNON_INTERACTIVE_BUILD:BOOL=TRUE -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} ${{ matrix.project_tags_cmake_options }} .. - - name: Disable profiles that are not supported in Debian [Docker debian-testing and debian-buster] - if: (matrix.docker_image == 'debian:testing' || matrix.docker_image == 'debian:buster-backports') - run: | - cd build - cmake -DROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS:BOOL=OFF -DROBOTOLOGY_USES_MUJOCO:BOOL=OFF -DROBOTOLOGY_ENABLE_ROBOT_TESTING:BOOL=OFF -DROBOTOLOGY_USES_PYTHON:BOOL=OFF -DROBOTOLOGY_USES_GZ:BOOL=OFF . - - - name: Disable MuJoCo and gz-sim for distros released before 2022 [Docker ubuntu:focal and debian:bullseye] - if: (matrix.docker_image == 'ubuntu:focal' || matrix.docker_image == 'debian:bullseye') + - name: Disable MuJoCo and gz-sim for distros released before 2022 [Docker ubuntu:20.04] + if: (matrix.docker_image == 'ubuntu:20.04') run: | cd build cmake -DROBOTOLOGY_USES_MUJOCO:BOOL=OFF -DROBOTOLOGY_USES_GZ:BOOL=OFF . @@ -403,8 +400,8 @@ jobs: cmake -C ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR}/.ci/initial-cache.gh.cmake -A x64 -DCMAKE_TOOLCHAIN_FILE=C:/robotology/vcpkg/scripts/buildsystems/vcpkg.cmake -DROBOTOLOGY_USES_MATLAB:BOOL=OFF -DYCM_BOOTSTRAP_VERBOSE=ON -DYCM_EP_INSTALL_DIR=C:/robotology/robotology -DNON_INTERACTIVE_BUILD:BOOL=TRUE -DCMAKE_BUILD_TYPE=Debug ${{ matrix.project_tags_cmake_options }} .. cmake -DROBOTOLOGY_ENABLE_TELEOPERATION:BOOL=OFF . - - name: Disable options unsupported on Ubuntu 20.04 and vcpkg - if: contains(matrix.os, '20.04') || contains(matrix.os, 'windows') + - name: Disable options unsupported on vcpkg + if: contains(matrix.os, 'windows') shell: bash run: | cd ${ROBOTOLOGY_SUPERBUILD_SOURCE_DIR} @@ -427,6 +424,10 @@ jobs: cd build # Make sure that vcpkg's ace .dll are on the PATH source /c/robotology/scripts/setup-deps.sh + # Make sure that YARP's dll are in the path in case some repos use a code generator + # in their build that uses YARP's dll + # https://github.com/robotology/robotology-superbuild/pull/1547#issuecomment-2278151057 + source /c/robotology/robotology/share/robotology-superbuild/setup.sh cmake --build . --config Release # Cleanup build directories to avoid to fill the disk rm -rf ./robotology @@ -439,6 +440,10 @@ jobs: cd build # Make sure that vcpkg's ace .dll are on the PATH source /c/robotology/scripts/setup-deps.sh + # Make sure that YARP's dll are in the path in case some repos use a code generator + # in their build that uses YARP's dll + # https://github.com/robotology/robotology-superbuild/pull/1547#issuecomment-2278151057 + source /c/robotology/robotology/share/robotology-superbuild/setup.sh cmake --build . --config Debug # Cleanup build directories to avoid to fill the disk rm -rf ./robotology diff --git a/README.md b/README.md index 073016c15..158220711 100644 --- a/README.md +++ b/README.md @@ -104,7 +104,7 @@ We also support an additional deprecated way of compiling the superbuild, on Win The following apt-based distributions are supported and tested by the robotology-superbuild: * Ubuntu 20.04 (Focal Fossa) * Ubuntu 22.04 (Jammy Jellyfish) -* Debian 11 (Bullseye) +* Ubuntu 24.04 (Noble Numbat) Other versions may be working, but they are not checked. @@ -117,10 +117,11 @@ sudo bash ./scripts/install_apt_dependencies.sh Besides the packages listed in `apt.txt` file, the script `install_apt_dependencies.sh` also installs some other packages depending on the distribution used, please inspect the script for more information. -For what regards CMake, the robotology-superbuild requires CMake 3.16 . If you are using a recent Debian-based system such as Ubuntu 20.04, the default CMake is recent enough and you do not need to do further steps. +For what regards CMake, the robotology-superbuild requires CMake 3.19 . If you are using a recent Debian-based system such as Ubuntu 22.04, the default CMake is recent enough and you do not need to do further steps. If instead you use an older distro in which the default version of CMake is older, you can easily install a newer CMake version in several ways. For the following distributions, we recommend the following methods: -* Ubuntu 20.04 : install a recent CMake via Kitware APT Repository, see https://apt.kitware.com/ . +* Ubuntu 20.04 "Focal" : install a recent CMake via Kitware APT Repository, see https://apt.kitware.com/ . + For some [profile](doc/cmake-options.md#profile-cmake-options) or [dependency](doc/cmake-options.md#dependencies-cmake-options) specific CMake option you may need to install additional system dependencies, following the dependency-specific documentation listed in the following. If you do not want to enable an option, you should ignore the corresponding section and continue with the installation process. @@ -142,8 +143,7 @@ If you are on Ubuntu 24.04, please use conda if you want to install Gazebo Class #### `ROBOTOLOGY_USES_GZ` -To install Modern Gazebo (gz-sim) on Ubuntu Jammy (22.04) and Noble (20.04) and other supported Debian/Ubuntu systems, follow the instructions available at https://gazebosim.org/docs/harmonic/install_ubuntu#binary-installation-on-ubuntu . Furthermore, you also need to install the `cli11` dependency with: - +To install Modern Gazebo (gz-sim) on Ubuntu Jammy (22.04) and Noble (24.04) and other supported Debian/Ubuntu systems, follow the instructions available at https://gazebosim.org/docs/harmonic/install_ubuntu#binary-installation-on-ubuntu . Furthermore, you also need to install the `cli11` dependency with: ~~~ sudo apt-get install libcli11-dev ~~~ @@ -179,6 +179,7 @@ cd robotology-superbuild mkdir build cd build ccmake ../ +source ./install/share/robotology-superbuild.sh make ``` You can configure the ccmake environment if you know you will use some particular set of software (put them in "ON"). diff --git a/cmake/BuildHumanDynamicsEstimation.cmake b/cmake/BuildHumanDynamicsEstimation.cmake index bf8baa37b..ffb3ea0bf 100644 --- a/cmake/BuildHumanDynamicsEstimation.cmake +++ b/cmake/BuildHumanDynamicsEstimation.cmake @@ -31,6 +31,11 @@ if(WIN32) list(APPEND HDE_OPTIONAL_CMAKE_ARGS -DXSENS_MVN_USE_SDK:BOOL=${ROBOTOLOGY_USES_XSENS_MVN_SDK} -DENABLE_XsensSuit:BOOL=${ROBOTOLOGY_USES_XSENS_MVN_SDK} ) endif() +if(ROBOTOLOGY_BUILD_SEPARATE_YARP_ROS) + find_or_build_package(yarp-ros QUIET) + list(APPEND HumanDynamicsEstimation_OPTIONAL_DEPS yarp-ros) +endif() + ycm_ep_helper(HumanDynamicsEstimation TYPE GIT STYLE GITHUB REPOSITORY robotology/human-dynamics-estimation.git @@ -43,7 +48,8 @@ ycm_ep_helper(HumanDynamicsEstimation TYPE GIT osqp OsqpEigen ICUB - robometry) + robometry + ${HumanDynamicsEstimation_OPTIONAL_DEPS}) set(HumanDynamicsEstimation_CONDA_PKG_NAME human-dynamics-estimation) set(HumanDynamicsEstimation_CONDA_PKG_CONDA_FORGE_OVERRIDE ON) diff --git a/cmake/Buildbipedal-locomotion-framework.cmake b/cmake/Buildbipedal-locomotion-framework.cmake index ae419edb8..c4470ee89 100644 --- a/cmake/Buildbipedal-locomotion-framework.cmake +++ b/cmake/Buildbipedal-locomotion-framework.cmake @@ -44,6 +44,11 @@ if (ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS) endif() endif() +if(ROBOTOLOGY_BUILD_SEPARATE_YARP_ROS) + find_or_build_package(yarp-ros QUIET) + list(APPEND bipedal-locomotion-framework_DEPENDS yarp-ros) +endif() + set(bipedal-locomotion-framework_OPTIONAL_CMAKE_ARGS "") if(ROBOTOLOGY_USES_PYTHON) list(APPEND bipedal-locomotion-framework_OPTIONAL_CMAKE_ARGS "-DFRAMEWORK_PYTHON_INSTALL_DIR:PATH=${ROBOTOLOGY_SUPERBUILD_PYTHON_INSTALL_DIR}") diff --git a/cmake/Buildblocktest-yarp-plugins.cmake b/cmake/Buildblocktest-yarp-plugins.cmake index 803cc3342..ce6e8564a 100644 --- a/cmake/Buildblocktest-yarp-plugins.cmake +++ b/cmake/Buildblocktest-yarp-plugins.cmake @@ -8,6 +8,13 @@ include(FindOrBuildPackage) find_or_build_package(YARP QUIET) find_or_build_package(blocktestcore QUIET) +set(blocktest-yarp-plugins_OPTIONAL_DEPS "") + +if(ROBOTOLOGY_BUILD_SEPARATE_YARP_ROS) + find_or_build_package(yarp-ros QUIET) + list(APPEND blocktest-yarp-plugins_OPTIONAL_DEPS yarp-ros) +endif() + ycm_ep_helper(blocktest-yarp-plugins TYPE GIT STYLE GITHUB REPOSITORY robotology/blocktest-yarp-plugins.git @@ -16,6 +23,7 @@ ycm_ep_helper(blocktest-yarp-plugins TYPE GIT FOLDER src DEPENDS YARP blocktestcore + ${blocktest-yarp-plugins_OPTIONAL_DEPS} CMAKE_ARGS -DENABLE_MSVC_WARNINGS:BOOL=OFF) - + set(blocktest-yarp-plugins_CONDA_DEPENDENCIES libboost-devel) diff --git a/cmake/Buildidyntree-yarp-tools.cmake b/cmake/Buildidyntree-yarp-tools.cmake index 9c9cb4d58..b802d565f 100644 --- a/cmake/Buildidyntree-yarp-tools.cmake +++ b/cmake/Buildidyntree-yarp-tools.cmake @@ -7,6 +7,11 @@ find_or_build_package(iDynTree QUIET) find_or_build_package(YARP QUIET) find_or_build_package(ICUB QUIET) +if(ROBOTOLOGY_BUILD_SEPARATE_YARP_ROS) + find_or_build_package(yarp-ros QUIET) + list(APPEND idyntree-yarp-tools_OPTIONAL_DEPS yarp-ros) +endif() + ycm_ep_helper(idyntree-yarp-tools TYPE GIT STYLE GITHUB REPOSITORY robotology/idyntree-yarp-tools.git @@ -16,6 +21,7 @@ ycm_ep_helper(idyntree-yarp-tools TYPE GIT DEPENDS iDynTree YARP ICUB + ${idyntree-yarp-tools_OPTIONAL_DEPS} CMAKE_ARGS -DIDYNTREE_YARP_TOOLS_USES_ICUB_MAIN:BOOL=ON -DIDYNTREE_YARP_TOOLS_USES_QT:BOOL=ON -DIDYNTREE_YARP_TOOLS_USES_QT_CHARTS:BOOL=OFF) diff --git a/cmake/Buildyarp-devices-ros.cmake b/cmake/Buildyarp-devices-ros.cmake index f89dbfaa8..ed1489d48 100644 --- a/cmake/Buildyarp-devices-ros.cmake +++ b/cmake/Buildyarp-devices-ros.cmake @@ -6,10 +6,15 @@ include(FindOrBuildPackage) find_or_build_package(YARP QUIET) +if(ROBOTOLOGY_BUILD_SEPARATE_YARP_ROS) + find_or_build_package(yarp-ros QUIET) + list(APPEND YDR_OPTIONAL_DEPS yarp-ros) +endif() + ycm_ep_helper(yarp-devices-ros TYPE GIT STYLE GITHUB REPOSITORY robotology/yarp-devices-ros.git TAG master COMPONENT core FOLDER src - DEPENDS YARP) + DEPENDS YARP ${YDR_OPTIONAL_DEPS}) diff --git a/cmake/Buildyarp-ros.cmake b/cmake/Buildyarp-ros.cmake new file mode 100644 index 000000000..236de903c --- /dev/null +++ b/cmake/Buildyarp-ros.cmake @@ -0,0 +1,16 @@ +# Copyright (C) 2023 Fondazione Istituto Italiano di Tecnologia +# Authors: Silvio Traversaro +# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT + +include(YCMEPHelper) +include(FindOrBuildPackage) + +find_or_build_package(YARP QUIET) + +ycm_ep_helper(yarp-ros TYPE GIT + STYLE GITHUB + REPOSITORY robotology/yarp-ros.git + TAG master + COMPONENT core + FOLDER src + DEPENDS YARP) diff --git a/cmake/ProjectsTagsUnstable.cmake b/cmake/ProjectsTagsUnstable.cmake index a0f8f73da..415c0ef9b 100644 --- a/cmake/ProjectsTagsUnstable.cmake +++ b/cmake/ProjectsTagsUnstable.cmake @@ -15,8 +15,6 @@ set_tag(casadi_TAG 3.6.6) set_tag(casadi-matlab-bindings_TAG v3.6.6.0) # Robotology projects -set_tag(YARP_TAG yarp-3.9) -set_tag(yarp-matlab-bindings_TAG yarp-3.9) set_tag(ICUB_TAG devel) set_tag(RobotTestingFramework_TAG devel) set_tag(blockTest_TAG devel) diff --git a/cmake/RobotologySuperbuildLogic.cmake b/cmake/RobotologySuperbuildLogic.cmake index 30371805c..0fdf99838 100644 --- a/cmake/RobotologySuperbuildLogic.cmake +++ b/cmake/RobotologySuperbuildLogic.cmake @@ -66,6 +66,9 @@ endif() # Core if(ROBOTOLOGY_ENABLE_CORE) find_or_build_package(YARP) + if(ROBOTOLOGY_BUILD_SEPARATE_YARP_ROS) + find_or_build_package(yarp-ros) + endif() find_or_build_package(yarp-devices-ros) find_or_build_package(ICUB) find_or_build_package(ICUBcontrib) @@ -203,7 +206,7 @@ if(ROBOTOLOGY_ENABLE_R1_ROBOT) find_or_build_package(cer) endif() -# Dummy option used to only clone repos to update them +# Dummy option used to only clone repos to update them # via update-latest-releases.yml GitHub Action if(ROBOTOLOGY_INTERNAL_CLONE_ALL_REPOS_FOR_UPDATE) find_or_build_package(icub-firmware) diff --git a/cmake/RobotologySuperbuildOptions.cmake b/cmake/RobotologySuperbuildOptions.cmake index 3e81c7f1b..df090ab2d 100644 --- a/cmake/RobotologySuperbuildOptions.cmake +++ b/cmake/RobotologySuperbuildOptions.cmake @@ -109,11 +109,20 @@ if(WIN32 AND DEFINED ENV{CONDA_PREFIX}) list(REMOVE_ITEM CMAKE_CONFIGURATION_TYPES "Debug") endif() endif() - set(ROBOTOLOGY_PROJECT_TAGS "Stable" CACHE STRING "The tags to be used for the robotology projects: Stable, Unstable, LatestRelease or Custom. This can be changed only before the first configuration.") set(ROBOTOLOGY_PROJECT_TAGS_CUSTOM_FILE CACHE FILEPATH "If ROBOTOLOGY_PROJECT_TAGS is custom, this file will be loaded to specify the tags of the projects to use.") set_property(CACHE ROBOTOLOGY_PROJECT_TAGS PROPERTY STRINGS "Stable" "Unstable" "LatestRelease" "Custom") + +# For now, only YARP master (used in Unstable ROBOTOLOGY_PROJECT_TAGS) requires to have separate yarp-ros and yarp-ros-devices +# However, we keep ROBOTOLOGY_BUILD_SEPARATE_YARP_ROS as a user selectable option as some users could use ROBOTOLOGY_PROJECT_TAGS set to +# Stable or a given release, and manually change the YARP to a version that does not contain yarp-ros functionality +option(ROBOTOLOGY_BUILD_SEPARATE_YARP_ROS "If ON, build yarp-ros and yarp-ros-devices repository" OFF) +if(ROBOTOLOGY_PROJECT_TAGS STREQUAL "Unstable") + # If ROBOTOLOGY_PROJECT_TAGS is Unstable, force the value to be ON + set(ROBOTOLOGY_BUILD_SEPARATE_YARP_ROS ON CACHE BOOL "" FORCE) +endif() + if(ROBOTOLOGY_PROJECT_TAGS STREQUAL "Stable") include(ProjectsTagsStable) elseif(ROBOTOLOGY_PROJECT_TAGS STREQUAL "Unstable") diff --git a/doc/conda-forge.md b/doc/conda-forge.md index 140bc126f..532561544 100644 --- a/doc/conda-forge.md +++ b/doc/conda-forge.md @@ -220,6 +220,7 @@ cd robotology-superbuild mkdir build cd build cmake .. +source ./install/share/robotology-superbuild/setup.sh cmake --build . --config Release ~~~ @@ -229,6 +230,7 @@ cd robotology-superbuild mkdir build cd build cmake -G"Visual Studio 16 2019" .. +call .\install\share\robotology-superbuild\setup.bat cmake --build . --config Release ~~~