From 8106f9937f53c5fcf7ec38823a253b24732255c4 Mon Sep 17 00:00:00 2001 From: eloise dalin <eloise.dalin@inria.fr> Date: Wed, 31 Aug 2022 10:17:17 +0200 Subject: [PATCH] updated with latest devel and format_code --- README.md | 1 + base-icub/Dockerfile | 9 +++++++-- base-pal/Dockerfile | 7 ++++++- base/Dockerfile | 5 ++++- make.py | 12 ++++++++---- pinocchio_tsid/Dockerfile | 4 ++-- ros/Dockerfile | 12 ++++++++++++ 7 files changed, 40 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index a9d5e54..719f84a 100644 --- a/README.md +++ b/README.md @@ -224,3 +224,4 @@ Install the following apps: - docker - Remote Development - Remote X11 (optional) +- Clang-Format diff --git a/base-icub/Dockerfile b/base-icub/Dockerfile index 1e9943a..42f0107 100644 --- a/base-icub/Dockerfile +++ b/base-icub/Dockerfile @@ -33,7 +33,8 @@ RUN apt-get install -qqy \ python \ python-numpy \ swig \ - clang-10 + clang-10 \ + clang-format-6.0 RUN sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 100 @@ -51,8 +52,12 @@ RUN useradd -ms /bin/bash ${USERNAME} && \ USER $USERNAME WORKDIR /home/${USERNAME} -RUN mkdir install +RUN /bin/bash -c "cd /home/$USERNAME; \ + git clone https://github.com/resibots/format_code.git;" + + +RUN mkdir install # we start from a CLEAN .bashrc ADD .bashrc .bashrc diff --git a/base-pal/Dockerfile b/base-pal/Dockerfile index 2372859..6bec70c 100644 --- a/base-pal/Dockerfile +++ b/base-pal/Dockerfile @@ -43,7 +43,8 @@ RUN apt-get install -y \ libssl-dev \ dbus-x11 \ terminator \ - clang-10 + clang-10 \ + clang-format-6.0 RUN sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 100 RUN sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 100 @@ -72,6 +73,10 @@ RUN useradd -ms /bin/bash ${USERNAME} && \ USER $USERNAME WORKDIR /home/${USERNAME} + +RUN /bin/bash -c "cd /home/$USERNAME; \ + git clone https://github.com/resibots/format_code.git;" + RUN mkdir install diff --git a/base/Dockerfile b/base/Dockerfile index 4cf5ea1..48080c8 100644 --- a/base/Dockerfile +++ b/base/Dockerfile @@ -30,7 +30,8 @@ RUN apt-get update && apt-get install -y \ libssl-dev \ bash-completion \ cmake-curses-gui \ - clang-10 + clang-10 \ + clang-format-6.0 RUN sudo update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-10 100 RUN sudo update-alternatives --install /usr/bin/clang clang /usr/bin/clang-10 100 @@ -62,6 +63,8 @@ RUN /bin/bash -c "echo 'export LD_LIBRARY_PATH=:/home/pal/install/lib:$LD_LIBRAR && echo 'export PATH=/home/pal/bin:$PATH' >> /home/$USERNAME/.bashrc \ && echo 'PS1=\"\[\033[1;36m\][DOCKER:inria_wbc] \[\033[1;34m\]\w\[\033[0;35m\] \[\033[1;36m\]> \[\033[0m\]\"' >> /home/pal/.bashrc" +RUN /bin/bash -c "cd /home/$USERNAME; \ + git clone https://github.com/resibots/format_code.git;" USER root diff --git a/make.py b/make.py index 4897442..0869de7 100755 --- a/make.py +++ b/make.py @@ -28,6 +28,7 @@ promp = clone_repo("promp", "git@gitlab.inria.fr:H2020-AnDy/promp.git") inria_xsens = clone_repo("inria_xsens", "git@gitlab.inria.fr:locolearn/inria_xsens.git") iwbc_teleop = clone_repo("inria_wbc_teleop", "git@gitlab.inria.fr:locolearn/inria_wbc_teleop.git") bashrc = "cd base && rm -f .bashrc && cp ../files/.bashrc .bashrc" +icub_bashrc = "cd base-icub && rm -f .bashrc && cp ../files/.bashrc .bashrc" # for PAL pal_bashrc = "cd base-pal && rm -f .bashrc && cp ../files/.bashrc .bashrc" @@ -71,7 +72,7 @@ images = { "registry.gitlab.inria.fr/locolearn/public/docker_inria_wbc/inria_wbc_icub", # where to push ["base-icub", "dart", "robot_dart", "pinocchio_tsid", "inria_wbc", "robotology", "iwbc_icub_controller"], # base packages [], # extended packages - [bashrc, iwbc_icub_controller],# preparation commands + [icub_bashrc, iwbc_icub_controller],# preparation commands [] # extended preparation commands ], } @@ -88,10 +89,13 @@ def build_image(image_name, lightweight, use_cache, sub_tag, dryrun, verbose, wi image = images[image_name] base_image = image[0] tag_lightweight = "-light" if lightweight else "" - tag = image[1] + ":" + sub_tag + tag_lightweight + tag_fast = "-fast" if (architecture != "") else "" + tag = image[1] + ":" + sub_tag + tag_fast + tag_lightweight subdirs = image[2] if lightweight else image[2] + image[3] cache = "--no-cache" if use_cache else "" - cxxflags = "-march=" + architecture + cxxflags = "" + if (architecture != ""): + cxxflags = "-march=" + architecture cmds = [] if without_prep_cmds else image[4] if lightweight else image[4] + image[5] for i in cmds: run(i, dryrun, verbose) @@ -129,7 +133,7 @@ def parse_args(): parser.add_argument("-v", '--verbose', action="store_true", help='verbose') parser.add_argument("-w", '--without_prep_cmds', action="store_true", help='without_preparation_commands avoids to clone again the repos') parser.add_argument("-r", '--registry', action="store_true", help='list the registry URLs') - parser.add_argument("-a", '--architecture', default="ivybridge", help='compile for a specific architecture, e.g.: native or broadwell [default:ivybridge]') + parser.add_argument("-a", '--architecture', default="", help='compile for a specific architecture, e.g.: ivybridge (talos), native or broadwell [default:""]') args = parser.parse_args() return args, parser diff --git a/pinocchio_tsid/Dockerfile b/pinocchio_tsid/Dockerfile index 017691d..538d4eb 100644 --- a/pinocchio_tsid/Dockerfile +++ b/pinocchio_tsid/Dockerfile @@ -67,9 +67,9 @@ RUN /bin/bash -c "cd /home/$USERNAME; \ RUN /bin/bash -c "cd /home/$USERNAME; \ - git clone --recursive https://github.com/hucebot/tsid.git; \ + git clone --recursive https://github.com/stack-of-tasks/tsid.git; \ cd tsid; \ - git checkout qpmad;\ + git checkout devel;\ mkdir build; \ cd build; \ CC=clang CXX=clang++ CXXFLAGS=\"${CXXFLAGS}\" cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX='/home/$USERNAME/install' -DCMAKE_PREFIX_PATH='/home/$USERNAME/install' -DBUILD_PYTHON_INTERFACE=OFF -DCMAKE_CXX_STANDARD=17 ..; \ diff --git a/ros/Dockerfile b/ros/Dockerfile index 7ccd4f8..40e2c1d 100644 --- a/ros/Dockerfile +++ b/ros/Dockerfile @@ -6,6 +6,18 @@ FROM $BASE_IMAGE # e.g. CXXFLAGS=-march=native or CXXFLAGS=-march=haswell ARG CXXFLAGS + + +RUN /bin/bash -c "cd /home/$USERNAME; \ + git clone https://github.com/hucebot/data_serializer.git; \ + cd data_serializer; \ + mkdir build; \ + cd build; \ + CC=clang CXX=clang++ CXXFLAGS=\"${CXXFLAGS}\" cmake -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_INSTALL_PREFIX='/home/$USERNAME/install' -DCMAKE_PREFIX_PATH='/home/$USERNAME/install' -DBUILD_PYTHON_INTERFACE=OFF -DCMAKE_CXX_STANDARD=17 ..; \ + make -j$(nproc); \ + make install; \ + make clean" + RUN /bin/bash -c ". /opt/pal/ferrum/setup.bash \ && mkdir -p /home/$USERNAME/catkin_ws/src \ && cd /home/$USERNAME/catkin_ws/src \ -- GitLab