Skip to content

Commit

Permalink
Merge pull request #800 from robotology/fix/799
Browse files Browse the repository at this point in the history
Add pybind11 dependency to enable installation of manifpy and bipedal-locomotion-framework Python bindings if ROBOTOLOGY_USES_PYTHON is enabled
  • Loading branch information
traversaro authored Jun 25, 2021
2 parents 6602368 + d17a707 commit 73df8ad
Show file tree
Hide file tree
Showing 10 changed files with 37 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .ci/install_debian.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ apt-get install -y bash-completion build-essential cmake cmake-curses-gui coinor
apt-get install -y libmatio-dev libirrlicht-dev

# Python
apt-get install -y python3-dev python3-numpy
apt-get install -y python3-dev python3-numpy python3-pybind11 pybind11-dev

# Octave
apt-get install -y liboctave-dev
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ jobs:
# Actual dependencies
mamba install ace asio boost eigen gazebo glew glfw gsl ipopt irrlicht libjpeg-turbo libmatio libode libxml2 nlohmann_json opencv pkg-config portaudio qt sdl sdl2 sqlite tinyxml spdlog
# Python
mamba install numpy swig
mamba install numpy swig pybind11
# Additional dependencies useful only on Linux
- name: Dependencies [Conda/Linux]
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/generate-conda-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,10 @@ jobs:
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml yarp-matlab-bindings
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml wb-toolbox
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml unicycle-footstep-planner
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml bipedal-locomotion-framework
# blf is currently disabled, see https://github.com/robotology/robotology-superbuild/issues/806
# When re-enabled, remember to use conda build and not conda mambabuild for https://github.com/robotology/robotology-superbuild/pull/800#issuecomment-866679447
# conda build -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml bipedal-locomotion-framework
rm -rf bipedal-locomotion-framework
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml wearables
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml icub-models
conda mambabuild -m ${CONDA_PREFIX}/conda_build_config.yaml -m ${GITHUB_WORKSPACE}/conda/conda_build_config.yml blocktest
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ The format of this document is based on [Keep a Changelog](https://keepachangelo
## [Unreleased]

### Added
- Add `nlohmann-json` dependency to the superbuild (https://github.com/robotology/robotology-superbuild/pull/776)
- 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`.

## [2021.05] - 2021-05-31

Expand Down
13 changes: 13 additions & 0 deletions cmake/Buildbipedal-locomotion-framework.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ if(ROBOTOLOGY_USES_PYTHON AND ROBOTOLOGY_GENERATE_CONDA_RECIPES)
list(APPEND bipedal-locomotion-framework_OPTIONAL_CMAKE_ARGS "-DFRAMEWORK_DETECT_ACTIVE_PYTHON_SITEPACKAGES:BOOL=ON")
endif()

# Workaround for https://github.com/robotology/robotology-superbuild/issues/802
if(ROBOTOLOGY_USES_PYTHON AND NOT WIN32)
set(BUILD_PYTHON_BINDINGS ON)
else()
set(BUILD_PYTHON_BINDINGS OFF)
endif()

ycm_ep_helper(bipedal-locomotion-framework TYPE GIT
STYLE GITHUB
REPOSITORY dic-iit/bipedal-locomotion-framework.git
Expand All @@ -54,16 +61,22 @@ ycm_ep_helper(bipedal-locomotion-framework TYPE GIT
-DFRAMEWORK_USE_cppad:BOOL=${ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS}
-DFRAMEWORK_USE_casadi:BOOL=${ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS}
-DFRAMEWORK_USE_LieGroupControllers:BOOL=${ROBOTOLOGY_ENABLE_DYNAMICS_FULL_DEPS}
-DFRAMEWORK_COMPILE_PYTHON_BINDINGS:BOOL=${BUILD_PYTHON_BINDINGS}
${bipedal-locomotion-framework_OPTIONAL_CMAKE_ARGS}
DEPENDS ${bipedal-locomotion-framework_DEPENDS})

set(bipedal-locomotion-framework_CONDA_DEPENDENCIES eigen)
list(APPEND bipedal-locomotion-framework_CONDA_DEPENDENCIES nlohmann_json)
list(APPEND bipedal-locomotion-framework_CONDA_DEPENDENCIES spdlog)

if(ROBOTOLOGY_USES_PYTHON)
list(APPEND bipedal-locomotion-framework_CONDA_DEPENDENCIES pybind11)
# https://conda-forge.org/docs/maintainer/knowledge_base.html#pybind11-abi-constraints
list(APPEND bipedal-locomotion-framework_CONDA_DEPENDENCIES pybind11-abi)
list(APPEND bipedal-locomotion-framework_CONDA_DEPENDENCIES python)
list(APPEND bipedal-locomotion-framework_CONDA_DEPENDENCIES numpy)
# manifpy is not available on Windows on conda-forge, see https://github.com/conda-forge/manif-feedstock/issues/7
if(NOT WIN32)
list(APPEND bipedal-locomotion-framework_CONDA_DEPENDENCIES manifpy)
endif()
endif()
9 changes: 8 additions & 1 deletion cmake/Buildmanif.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,20 @@

include(YCMEPHelper)

# Workaround for https://github.com/robotology/robotology-superbuild/issues/802
if(ROBOTOLOGY_USES_PYTHON AND NOT WIN32)
set(BUILD_PYTHON_BINDINGS ON)
else()
set(BUILD_PYTHON_BINDINGS OFF)
endif()

ycm_ep_helper(manif TYPE GIT
STYLE GITHUB
REPOSITORY artivis/manif.git
TAG master
COMPONENT external
FOLDER src
CMAKE_ARGS -DBUILD_TESTING:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF)
CMAKE_ARGS -DBUILD_TESTING:BOOL=OFF -DBUILD_EXAMPLES:BOOL=OFF -DBUILD_PYTHON_BINDINGS:BOOL=${BUILD_PYTHON_BINDINGS})

set(manif_CONDA_PKG_NAME manif)
set(manif_CONDA_PKG_CONDA_FORGE_OVERRIDE ON)
3 changes: 2 additions & 1 deletion cmake/ProjectsTagsStable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ endmacro()

# External projects
set_tag(osqp_TAG v0.6.2)
set_tag(manif_TAG 0.0.4)
set_tag(manif_REPOSITORY robotology-dependencies/manif.git)
set_tag(manif_TAG 0.0.4.1)
set_tag(qhull_TAG v8.0.2)
set_tag(CppAD_TAG 20210000.4)
set_tag(casadi 3.5.5.3)
Expand Down
3 changes: 2 additions & 1 deletion cmake/ProjectsTagsUnstable.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ endmacro()

# External projects
set_tag(osqp_TAG v0.6.2)
set_tag(manif_TAG 0.0.4)
set_tag(manif_REPOSITORY robotology-dependencies/manif.git)
set_tag(manif_TAG 0.0.4.1)
set_tag(qhull_TAG v8.0.2)
set_tag(CppAD_TAG 20210000.4)
set_tag(casadi 3.5.5.3)
Expand Down
4 changes: 2 additions & 2 deletions doc/cmake-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,13 @@ Support for this dependency is enabled by the `ROBOTOLOGY_USES_PYTHON` CMake opt
#### Ubuntu using apt
Install Python and the necessary development files using the following command:
~~~
sudo apt-get install python3-dev python3-numpy
sudo apt-get install python3-dev python3-numpy python3-pybind11 pybind11-dev
~~~
#### Conda
To install python and the other required dependencies when using `conda-forge` provided dependencies, use:
~~~
conda install -c conda-forge python numpy swig
conda install -c conda-forge python numpy swig pybind11
~~~
### Check the installation
Expand Down
4 changes: 2 additions & 2 deletions releases/latest.releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ repositories:
version: v0.6.2
manif:
type: git
url: https://github.com/artivis/manif.git
version: 0.0.4
url: https://github.com/robotology-dependencies/manif.git
version: 0.0.4.1
qhull:
type: git
url: https://github.com/qhull/qhull.git
Expand Down

0 comments on commit 73df8ad

Please sign in to comment.