From 35d4a41d4de75291bf5a4d5c4e555326965dc213 Mon Sep 17 00:00:00 2001 From: domire8 <71256590+domire8@users.noreply.github.com> Date: Sun, 26 Jun 2022 20:50:20 +0200 Subject: [PATCH] Remove CMake error preventing build on 22.04 and minor improvements (#299) * Remove unnecessary line from CMakeLists * Make Dockerfiles more consistent to benefit from cache * Fix demos version and update it automatically * Install python3 instead of python in base Dockerfile * 6.0.1 -> 6.0.2 * Fix update_version script * Update CHANGELOG * 6.0.2 -> 6.0.3 --- CHANGELOG.md | 1 + Dockerfile.base | 8 +++++--- VERSION | 2 +- demos/CMakeLists.txt | 2 +- demos/Dockerfile | 14 +++++++------- demos/run-demo.sh | 2 +- doxygen/doxygen.conf | 2 +- protocol/Dockerfile.protocol | 4 ++-- protocol/clproto_cpp/CMakeLists.txt | 2 +- python/Dockerfile.python | 2 +- python/setup.py | 2 +- source/CMakeLists.txt | 2 +- source/Dockerfile.source | 2 +- source/dynamical_systems/CMakeLists.txt | 2 -- update_version.sh | 6 +++++- 15 files changed, 29 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95e251421..be4af44b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Release Versions: - Extend clproto tests (#297) - Set default values of empty Parameters correctly (#298) +- Remove CMake error preventing build on 22.04 and minor improvements (#299) ## 6.0.0 diff --git a/Dockerfile.base b/Dockerfile.base index 666971714..2e0efc4b2 100644 --- a/Dockerfile.base +++ b/Dockerfile.base @@ -21,6 +21,8 @@ RUN apt-get update && apt-get install -y \ FROM core-build-dependencies as project-dependencies +ARG OSQP_TAG=v0.6.2 +ARG OSQP_EIGEN_TAG=v0.6.4 # add pinocchio to package list RUN echo "deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub $(lsb_release -cs) robotpkg" \ @@ -40,10 +42,10 @@ RUN apt-get update && apt-get install -y \ # install osqp and eigen wrapper WORKDIR /tmp/osqp_build -RUN git clone --recursive https://github.com/oxfordcontrol/osqp \ +RUN git clone --depth 1 -b ${OSQP_TAG} --recursive https://github.com/oxfordcontrol/osqp \ && cd osqp && mkdir build && cd build && cmake -G "Unix Makefiles" .. && cmake --build . --target install -RUN git clone https://github.com/robotology/osqp-eigen.git \ +RUN git clone --depth 1 -b ${OSQP_EIGEN_TAG} https://github.com/robotology/osqp-eigen.git \ && cd osqp-eigen && mkdir build && cd build && cmake .. && make -j && make install ENV LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/usr/local/lib:/opt/openrobots/lib/ @@ -116,7 +118,7 @@ FROM ssh-configuration as development-dependencies RUN apt-get update && apt-get install -y \ clang \ gdb \ - python \ + python3 \ python3-dev \ python3-pip \ tar \ diff --git a/VERSION b/VERSION index 7a9f89d81..39c5d6a6b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.0.2 \ No newline at end of file +6.0.3 \ No newline at end of file diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 19ee77b0d..83fd3fd62 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -18,7 +18,7 @@ endif() list(APPEND CMAKE_PREFIX_PATH /opt/openrobots) include_directories(/opt/openrobots/include) -find_package(control_libraries 5.0.0 CONFIG REQUIRED) +find_package(control_libraries 6.0.3 CONFIG REQUIRED) set(DEMOS_SCRIPTS task_space_control_loop diff --git a/demos/Dockerfile b/demos/Dockerfile index 079a92d04..2683ef2e4 100644 --- a/demos/Dockerfile +++ b/demos/Dockerfile @@ -1,13 +1,13 @@ -FROM ghcr.io/epfl-lasa/control-libraries/development-dependencies +FROM ghcr.io/epfl-lasa/control-libraries/development-dependencies:latest +ARG BRANCH=develop -WORKDIR /tmp -ARG CONTROL_LIBRARIES_BRANCH=develop -RUN git clone -b ${CONTROL_LIBRARIES_BRANCH} --depth 1 https://github.com/epfl-lasa/control-libraries.git -RUN cd control-libraries/source && ./install.sh --auto -RUN cd control-libraries/protocol && ./install.sh --auto +WORKDIR /source +RUN git clone --depth 1 --branch ${BRANCH} https://github.com/epfl-lasa/control-libraries +RUN bash control-libraries/source/install.sh --auto +RUN bash control-libraries/protocol/install.sh --auto RUN pip3 install control-libraries/python -RUN rm -rf /tmp/* +RUN rm -rf /source USER developer WORKDIR ${HOME}/control_loop_examples diff --git a/demos/run-demo.sh b/demos/run-demo.sh index 308338491..daea9971d 100755 --- a/demos/run-demo.sh +++ b/demos/run-demo.sh @@ -31,7 +31,7 @@ while [[ $# -gt 0 ]]; do done echo "Using control libraries branch ${BRANCH}" -BUILD_FLAGS+=(--build-arg CONTROL_LIBRARIES_BRANCH="${BRANCH}") +BUILD_FLAGS+=(--build-arg BRANCH="${BRANCH}") docker pull ghcr.io/epfl-lasa/control-libraries/development-dependencies DOCKER_BUILDKIT=1 docker build "${BUILD_FLAGS[@]}" . -t "${IMAGE_NAME}:${IMAGE_TAG}" || exit 1 diff --git a/doxygen/doxygen.conf b/doxygen/doxygen.conf index 9ecb77d7e..6119bc216 100644 --- a/doxygen/doxygen.conf +++ b/doxygen/doxygen.conf @@ -38,7 +38,7 @@ PROJECT_NAME = "Control Libraries" # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = 6.0.2 +PROJECT_NUMBER = 6.0.3 # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a diff --git a/protocol/Dockerfile.protocol b/protocol/Dockerfile.protocol index 88fc8d4fa..e29453872 100644 --- a/protocol/Dockerfile.protocol +++ b/protocol/Dockerfile.protocol @@ -2,7 +2,7 @@ FROM ghcr.io/epfl-lasa/control-libraries/development-dependencies:latest as depe ARG BRANCH=develop WORKDIR /source -RUN git clone --depth 1 --branch "${BRANCH}" https://github.com/epfl-lasa/control-libraries +RUN git clone --depth 1 --branch ${BRANCH} https://github.com/epfl-lasa/control-libraries RUN bash control-libraries/source/install.sh --auto --no-controllers --no-dynamical-systems --no-robot-model WORKDIR /tmp/protocol @@ -16,7 +16,7 @@ FROM dependencies as build ARG BUILD_TESTING=ON WORKDIR /tmp/protocol/clproto_cpp/build -RUN cmake -DBUILD_TESTING="${BUILD_TESTING}" .. && make -j all +RUN cmake -DBUILD_TESTING=${BUILD_TESTING} .. && make -j all FROM build as testing diff --git a/protocol/clproto_cpp/CMakeLists.txt b/protocol/clproto_cpp/CMakeLists.txt index 4ea966727..2c1af6d94 100644 --- a/protocol/clproto_cpp/CMakeLists.txt +++ b/protocol/clproto_cpp/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.15) -project(clproto VERSION 6.0.2) +project(clproto VERSION 6.0.3) # Default to C99 if(NOT CMAKE_C_STANDARD) diff --git a/python/Dockerfile.python b/python/Dockerfile.python index 787571ec1..d64e60d40 100644 --- a/python/Dockerfile.python +++ b/python/Dockerfile.python @@ -2,7 +2,7 @@ FROM ghcr.io/epfl-lasa/control-libraries/development-dependencies:latest as pyth ARG BRANCH=develop WORKDIR /source -RUN git clone --depth 1 --branch $BRANCH https://github.com/epfl-lasa/control-libraries +RUN git clone --depth 1 --branch ${BRANCH} https://github.com/epfl-lasa/control-libraries RUN bash control-libraries/source/install.sh --auto RUN bash control-libraries/protocol/install.sh --auto diff --git a/python/setup.py b/python/setup.py index c45701650..a4e353abe 100644 --- a/python/setup.py +++ b/python/setup.py @@ -10,7 +10,7 @@ osqp_path_var = 'OSQP_INCLUDE_DIR' openrobots_path_var = 'OPENROBOTS_INCLUDE_DIR' -__version__ = "6.0.2" +__version__ = "6.0.3" __libraries__ = ['state_representation', 'clproto', 'controllers', 'dynamical_systems', 'robot_model'] __include_dirs__ = ['include'] diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 60d50bf77..d75c423a4 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.15) -project(control_libraries VERSION 6.0.2) +project(control_libraries VERSION 6.0.3) # Build options option(BUILD_TESTING "Build all tests." OFF) diff --git a/source/Dockerfile.source b/source/Dockerfile.source index f01d6fea4..583b0d476 100644 --- a/source/Dockerfile.source +++ b/source/Dockerfile.source @@ -1,4 +1,4 @@ -FROM ghcr.io/epfl-lasa/control-libraries/development-dependencies as build +FROM ghcr.io/epfl-lasa/control-libraries/development-dependencies:latest as build ARG BUILD_TESTING=ON ARG BUILD_CONTROLLERS=ON ARG BUILD_DYNAMICAL_SYSTEMS=ON diff --git a/source/dynamical_systems/CMakeLists.txt b/source/dynamical_systems/CMakeLists.txt index 41686598c..a0c487459 100644 --- a/source/dynamical_systems/CMakeLists.txt +++ b/source/dynamical_systems/CMakeLists.txt @@ -1,7 +1,5 @@ set(LIBRARY_NAME dynamical_systems) -find_library(state_representation REQUIRED) - set(CORE_SOURCES src/IDynamicalSystem.cpp src/DynamicalSystemFactory.cpp diff --git a/update_version.sh b/update_version.sh index c6cc9d311..9f24c6e47 100755 --- a/update_version.sh +++ b/update_version.sh @@ -109,6 +109,7 @@ SED_STR_SOURCE="s/project(control_libraries VERSION ${VERSION})/project(control_ SED_STR_PYTHON="s/__version__ = \"${VERSION}\"/__version__ = \"${NEW_VERSION}\"/g" SED_STR_CLPROTO="s/project(clproto VERSION ${VERSION})/project(clproto VERSION ${NEW_VERSION})/g" SED_STR_DOXYGEN="s/PROJECT_NUMBER = ${VERSION}/PROJECT_NUMBER = ${NEW_VERSION}/g" +SED_STR_DEMOS="s/control_libraries ${VERSION}/control_libraries ${NEW_VERSION}/g" if [[ "$OSTYPE" == "darwin"* ]]; then sed -i '' "${SED_STR_VERSION}" ./VERSION @@ -116,16 +117,19 @@ if [[ "$OSTYPE" == "darwin"* ]]; then sed -i '' "${SED_STR_PYTHON}" ./python/setup.py sed -i '' "${SED_STR_CLPROTO}" ./protocol/clproto_cpp/CMakeLists.txt sed -i '' "${SED_STR_DOXYGEN}" ./doxygen/doxygen.conf + sed -i '' "${SED_STR_DEMOS}" ./demos/CMakeLists.txt else sed -i "${SED_STR_VERSION}" ./VERSION sed -i "${SED_STR_SOURCE}" ./source/CMakeLists.txt sed -i "${SED_STR_PYTHON}" ./python/setup.py sed -i "${SED_STR_CLPROTO}" ./protocol/clproto_cpp/CMakeLists.txt sed -i "${SED_STR_DOXYGEN}" ./doxygen/doxygen.conf + sed -i "${SED_STR_DEMOS}" ./demos/CMakeLists.txt fi if [ "${COMMIT}" == true ]; then echo "Committing changes to source control" - git add VERSION ./source/CMakeLists.txt ./python/setup.py ./protocol/clproto_cpp/CMakeLists.txt ./doxygen/doxygen.conf + git add VERSION ./source/CMakeLists.txt ./python/setup.py \ + ./protocol/clproto_cpp/CMakeLists.txt ./doxygen/doxygen.conf ./demos/CMakeLists.txt git commit -m "${VERSION} -> ${NEW_VERSION}" fi \ No newline at end of file