Skip to content

Commit

Permalink
Move iDynTree in conda-forge and build idyntree-matlab-bindings in ro…
Browse files Browse the repository at this point in the history
…botology channel (robotology#817)
  • Loading branch information
traversaro authored and Nicogene committed Feb 14, 2022
1 parent 870f8c7 commit 42781ef
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 12 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/generate-conda-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,13 @@ jobs:
cd build/conda/generated_recipes
# Debug generated recipes
cat */meta.yaml
cat */bld.bat
cat */build.sh
# We use the conda_build_config from conda-forge-pinning, and our local one
# See https://docs.conda.io/projects/conda-build/en/latest/resources/variants.html#creating-conda-build-variant-config-files
# We manually specify the build order as conda build is too slow, and conda mambabuild does not support correctly multiple recipes
# see https://github.com/mamba-org/boa/issues/117
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml idyntree-matlab-bindings
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml blockfactory
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml yarp
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml matio-cpp
Expand All @@ -117,7 +120,6 @@ jobs:
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml icub-firmware-shared
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml robots-configuration
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml icub-main
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml idyntree
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml lie-group-controllers
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml qpoases
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml yarp-matlab-bindings
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ The format of this document is based on [Keep a Changelog](https://keepachangelo
- Add `nlohmann-json` dependency to the superbuild (https://github.com/robotology/robotology-superbuild/pull/776).
- In `YARP`, all the `fake***` YARP devices are now enabled (https://github.com/robotology/robotology-superbuild/pull/797).
- `pybind11` has been added as dependency for the `ROBOTOLOGY_USES_PYTHON` option (https://github.com/robotology/robotology-superbuild/pull/800), to enable compilation of Python bindings of `manif` and `bipedal-locomotion-framework`.
- `ycm-cmake-modules`, `osqp-eigen`, `robot-testing-framework` and `idyntree` conda packages are now part of the `conda-forge` channel. The new `idyntree-matlab-bindings` package is now contained in the `robotology` channel (https://github.com/robotology/robotology-superbuild/pull/807, https://github.com/robotology/robotology-superbuild/pull/817).
- The `idyntree-yarp-tools` was added to the Dynamics component of the superbuild (https://github.com/robotology/robotology-superbuild/pull/818).
- An `apt.txt` file and a `scripts/install_apt_dependencies.sh` script have been added to the superbuild to report the required apt packages in a machine readable form. People that mantain either Docker recipes or documentation on how to instal the robotology-superbuild are suggest to switch to use these files instead of hardcoding the dependencies manually (https://github.com/robotology/robotology-superbuild/pull/825).


## [2021.05] - 2021-05-31

### Added
Expand Down
9 changes: 2 additions & 7 deletions cmake/BuildiDynTree.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,5 @@ ycm_ep_helper(iDynTree TYPE GIT
${iDynTree_OPTIONAL_CMAKE_ARGS}
DEPENDS ${iDynTree_DEPENDS})

set(iDynTree_CONDA_DEPENDENCIES libxml2 ipopt eigen irrlicht)

if(ROBOTOLOGY_USES_PYTHON)
list(APPEND iDynTree_CONDA_DEPENDENCIES swig)
list(APPEND iDynTree_CONDA_DEPENDENCIES python)
list(APPEND iDynTree_CONDA_DEPENDENCIES numpy)
endif()
set(iDynTree_CONDA_PKG_NAME idyntree)
set(iDynTree_CONDA_PKG_CONDA_FORGE_OVERRIDE ON)
21 changes: 21 additions & 0 deletions cmake/Buildidyntree-matlab-bindings.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) Fondazione Istituto Italiano di Tecnologia
# CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
include(YCMEPHelper)
include(FindOrBuildPackage)

find_or_build_package(iDynTree QUIET)

# The version of idyntree-matlab-bindings is always exactly the same of iDynTree, as we use the exact same repo
set(idyntree-matlab-bindings_TAG ${iDynTree_TAG})

ycm_ep_helper(idyntree-matlab-bindings TYPE GIT
STYLE GITHUB
REPOSITORY robotology/idyntree.git
TAG master
COMPONENT dynamics
FOLDER src
CMAKE_ARGS -DIDYNTREE_USES_MATLAB:BOOL=${ROBOTOLOGY_USES_MATLAB}
DEPENDS iDynTree
SOURCE_SUBDIR bindings)

set(idyntree-matlab-bindings_CONDA_PKG_NAME idyntree-matlab-bindings)
7 changes: 7 additions & 0 deletions cmake/RobotologySuperbuildLogic.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,13 @@ endif()
# Dynamics
if(ROBOTOLOGY_ENABLE_DYNAMICS)
find_or_build_package(iDynTree)
# If we are generating conda-recipes, then we also need to build idyntree-matlab-bindings
# as the iDynTree package provided by conda-forge does not have MATLAB bindings, so we generate
# this package in the robotology channel
if(ROBOTOLOGY_GENERATE_CONDA_RECIPES AND ROBOTOLOGY_USES_MATLAB)
find_or_build_package(idyntree-matlab-bindings)
endif()
find_or_build_package(OsqpEigen QUIET)
find_or_build_package(idyntree-yarp-tools)
find_or_build_package(qpOASES)
find_or_build_package(BlockFactory)
Expand Down
4 changes: 4 additions & 0 deletions conda/cmake/RobotologySuperbuildGenerateCondaRecipes.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ macro(generate_metametadata_file)
string(APPEND metametadata_file_contents " github_tag: ${${_cmake_pkg}_CONDA_TAG}\n")
string(APPEND metametadata_file_contents " conda_build_number: ${CONDA_BUILD_NUMBER}\n")

if(_YH_${_cmake_pkg}_SOURCE_SUBDIR)
string(APPEND metametadata_file_contents " source_subdir: ${_YH_${_cmake_pkg}_SOURCE_SUBDIR}\n")
endif()

if(NOT "${${_cmake_pkg}_CONDA_CMAKE_ARGS}" STREQUAL "")
string(APPEND metametadata_file_contents " cmake_args:\n")
foreach(_cmake_arg IN LISTS ${_cmake_pkg}_CONDA_CMAKE_ARGS)
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 5 additions & 1 deletion conda/recipe_template/bld.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{% if source_subdir is defined and source_subdir|length %}
cd {{ source_subdir }}
{% endif %}

mkdir build
cd build

Expand All @@ -11,7 +15,7 @@ cmake ^
-DCMAKE_VERBOSE_MAKEFILE=OFF ^
-DCMAKE_INSTALL_LIBDIR=lib ^
{% for cmake_arg in cmake_args %} {{ cmake_arg }} ^
{% endfor %} %SRC_DIR%
{% endfor %} ..
if errorlevel 1 exit 1

:: Build.
Expand Down
4 changes: 4 additions & 0 deletions conda/recipe_template/build.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
#!/bin/sh

{% if source_subdir is defined and source_subdir|length %}
cd {{ source_subdir }}
{% endif %}

mkdir build
cd build

Expand Down
4 changes: 2 additions & 2 deletions releases/latest.releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ repositories:
iDynTree:
type: git
url: https://github.com/robotology/idyntree.git
version: v3.3.0
version: v4.0.0
BlockFactory:
type: git
url: https://github.com/robotology/blockfactory.git
Expand Down Expand Up @@ -106,7 +106,7 @@ repositories:
whole-body-estimators:
type: git
url: https://github.com/robotology/whole-body-estimators.git
version: v0.5.0
version: v0.5.1
walking-teleoperation:
type: git
url: https://github.com/robotology/walking-teleoperation.git
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_robotology_packages.m
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function install_robotology_packages(varargin)

% Install all the robotology packages related to MATLAB or Simulink
fprintf('Installing robotology packages\n');
system(sprintf('"%s" install -y -c conda-forge -c robotology yarp-matlab-bindings idyntree wb-toolbox osqp-matlab casadi-matlab-bindings whole-body-controllers matlab-whole-body-simulator icub-models', conda_full_path));
system(sprintf('"%s" install -y -c conda-forge -c robotology yarp-matlab-bindings idyntree-matlab-bindings wb-toolbox osqp-matlab casadi-matlab-bindings whole-body-controllers matlab-whole-body-simulator icub-models', conda_full_path));
fprintf('Installation of robotology packages completed\n');

fprintf('Creating setup script in %s\n', setup_script);
Expand Down

0 comments on commit 42781ef

Please sign in to comment.