From 22d13856fcdee527a0c7a36ceb5afbb979e19a62 Mon Sep 17 00:00:00 2001 From: Silvio Traversaro Date: Thu, 15 Jul 2021 10:45:31 +0200 Subject: [PATCH] Document required apt dependencies in machine readable format with apt.txt file (#825) Co-authored-by: Stefano Dafarra --- .ci/install_debian.sh | 8 +++--- .github/workflows/ci.yml | 4 +-- CHANGELOG.md | 1 + README.md | 11 ++++---- apt.txt | 40 +++++++++++++++++++++++++++++ scripts/install_apt_dependencies.sh | 9 +++++++ 6 files changed, 62 insertions(+), 11 deletions(-) mode change 100644 => 100755 .ci/install_debian.sh create mode 100644 apt.txt create mode 100755 scripts/install_apt_dependencies.sh diff --git a/.ci/install_debian.sh b/.ci/install_debian.sh old mode 100644 new mode 100755 index 438070a79..f1a7d10c4 --- a/.ci/install_debian.sh +++ b/.ci/install_debian.sh @@ -9,11 +9,11 @@ export DEBIAN_FRONTEND=noninteractive # CI specific packages apt-get install -y clang valgrind ccache ninja-build -# Core dependencies -apt-get install -y bash-completion build-essential cmake cmake-curses-gui coinor-libipopt-dev freeglut3-dev git libace-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libdc1394-22-dev libedit-dev libeigen3-dev libgsl0-dev libjpeg-dev liblua5.1-dev libode-dev libopencv-dev libsdl1.2-dev libtinyxml-dev libv4l-dev libxml2-dev lua5.1 portaudio19-dev qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtmultimedia qml-module-qtquick-controls qml-module-qtquick-dialogs qml-module-qtquick-window2 qml-module-qtquick2 qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev swig libspdlog-dev libblas-dev liblapack-dev +# Dependencies +# Get location of the script +SCRIPT_DIR=$(cd "$(dirname "$BASH_SOURCE")"; cd -P "$(dirname "$(readlink "$BASH_SOURCE" || echo .)")"; pwd) -# Dynamics dependencies -apt-get install -y libmatio-dev libirrlicht-dev +source ${SCRIPT_DIR}/../scripts/install_apt_dependencies.sh # Python apt-get install -y python3-dev python3-numpy python3-pybind11 pybind11-dev diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09d158ff3..df29bb876 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -182,7 +182,7 @@ jobs: - name: Dependencies [Docker] run: | chmod +x ./.ci/install_debian.sh - ./.ci/install_debian.sh + bash ./.ci/install_debian.sh - name: Install CMake 3.16 [Docker/Debian Buster] if: matrix.docker_image == 'debian:buster-backports' @@ -343,7 +343,7 @@ jobs: run: | cd $ROBOTOLOGY_SUPERBUILD_SOURCE_DIR chmod +x ./.ci/install_debian.sh - sudo ./.ci/install_debian.sh + sudo bash ./.ci/install_debian.sh - name: Dependencies [macOS] if: contains(matrix.os, 'macos') diff --git a/CHANGELOG.md b/CHANGELOG.md index 2bc08c072..5bd9cd2dd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ The format of this document is based on [Keep a Changelog](https://keepachangelo - 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`. - 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 diff --git a/README.md b/README.md index ad8ba5d3d..d31cdae7a 100644 --- a/README.md +++ b/README.md @@ -116,10 +116,11 @@ All the software packages are installed using the `install` directory of the bui ## Linux from source ### System Dependencies -On Debian based systems (as Ubuntu) you can install the C++ toolchain, Git, CMake and Eigen (and other dependencies necessary for the software include in `robotology-superbuild`) using `apt-get`: -``` -sudo apt-get install bash-completion build-essential cmake cmake-curses-gui coinor-libipopt-dev freeglut3-dev git libace-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libdc1394-22-dev libedit-dev libeigen3-dev libgsl0-dev libjpeg-dev liblua5.1-dev libode-dev libopencv-dev libsdl1.2-dev libtinyxml-dev libv4l-dev libxml2-dev lua5.1 portaudio19-dev qml-module-qt-labs-folderlistmodel qml-module-qt-labs-settings qml-module-qtmultimedia qml-module-qtquick-controls qml-module-qtquick-dialogs qml-module-qtquick-window2 qml-module-qtquick2 qtbase5-dev qtdeclarative5-dev qtmultimedia5-dev swig libmatio-dev libirrlicht-dev libspdlog-dev libblas-dev liblapack-dev -``` +On Debian based systems (as Ubuntu) you can install the C++ toolchain, Git, CMake and Eigen (and other dependencies necessary for the software include in `robotology-superbuild`) using `apt-get`. This can be done by installing the packages listed in the `apt.txt` file using the following script: +~~~ +cd robotology-superbuild +sudo bash ./scripts/install_apt_dependencies.sh +~~~ If you are **not** using Ubuntu 18.04, you also need to install: ~~~ @@ -136,7 +137,7 @@ More details can be found at https://github.com/robotology/QA/issues/364 . If you enabled any [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 (in particular, the `ROBOTOLOGY_USES_GAZEBO` option is enabled by default, so you should install Gazebo unless you plan to disable this option): * [`ROBOTOLOGY_USES_GAZEBO`](doc/cmake-options.md#gazebo) -### Superbuild +### Compile the superbuild Finally it is possible to install robotology software using the YCM superbuild: ```bash diff --git a/apt.txt b/apt.txt new file mode 100644 index 000000000..bdbfac988 --- /dev/null +++ b/apt.txt @@ -0,0 +1,40 @@ +bash-completion +build-essential +cmake +cmake-curses-gui +coinor-libipopt-dev +freeglut3-dev +git +libace-dev +libboost-filesystem-dev +libboost-system-dev +libboost-thread-dev +libdc1394-22-dev +libedit-dev +libeigen3-dev +libgsl0-dev +libjpeg-dev +liblua5.1-dev +libode-dev +libopencv-dev +libsdl1.2-dev +libtinyxml-dev +libv4l-dev +libxml2-dev +portaudio19-dev +qml-module-qt-labs-folderlistmodel +qml-module-qt-labs-settings +qml-module-qtmultimedia +qml-module-qtquick-controls +qml-module-qtquick-dialogs +qml-module-qtquick-window2 +qml-module-qtquick2 +qtbase5-dev +qtdeclarative5-dev +qtmultimedia5-dev +swig +libmatio-dev +libirrlicht-dev +libspdlog-dev +libblas-dev +liblapack-dev diff --git a/scripts/install_apt_dependencies.sh b/scripts/install_apt_dependencies.sh new file mode 100755 index 000000000..f19feb030 --- /dev/null +++ b/scripts/install_apt_dependencies.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# +# Install dependencies of robotology-superbuild +# using apt on Ubuntu or Debian + +# Get location of the script +SCRIPT_DIR=$(cd "$(dirname "$BASH_SOURCE")"; cd -P "$(dirname "$(readlink "$BASH_SOURCE" || echo .)")"; pwd) + +xargs -a ${SCRIPT_DIR}/../apt.txt apt-get install -y