From be78596a92caa28c88f32934fd8934d230c25ac4 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Tue, 13 Aug 2024 19:52:32 -0400 Subject: [PATCH 1/8] build: add bionic specific install step and add TeamCity build script - Add logic to install GCC 9 for Ubuntu 18.04 in dependency script. - Replace "ci_PR_arm64v8" with "ci_PR_arm64" in multiple scripts. - Add TeamCity-specific script to manage build flags and dry-run options. - Update contributing documentation to reflect architecture label changes. --- ...\200\272 build _service_ _popup_.run.xml" | 4 +-- ...ies_arm64v8 ci_PR_arm64v8 _popup_.run.xml" | 6 ++-- ...libpointmatcher_build_matrix.teamcity.bash | 35 +++++++++++++++++++ ...pm_crawl_libpointmatcher_build_matrix.bash | 2 +- ...libpointmatcher_build_matrix.bleeding.bash | 2 +- ...m_install_dependencies_general_ubuntu.bash | 10 ++++++ doc/contributing/contributing_instructions.md | 6 ++-- 7 files changed, 55 insertions(+), 10 deletions(-) create mode 100644 build_system/lpm_crawl_libpointmatcher_build_matrix.teamcity.bash diff --git "a/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build _service_ _popup_.run.xml" "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build _service_ _popup_.run.xml" index 83b4f1c5..e595df70 100644 --- "a/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build _service_ _popup_.run.xml" +++ "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build _service_ _popup_.run.xml" @@ -1,6 +1,6 @@ - - \ No newline at end of file + diff --git "a/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies_arm64v8 ci_PR_arm64v8 _popup_.run.xml" "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies_arm64v8 ci_PR_arm64v8 _popup_.run.xml" index 9e65fc21..5393105d 100644 --- "a/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies_arm64v8 ci_PR_arm64v8 _popup_.run.xml" +++ "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies_arm64v8 ci_PR_arm64v8 _popup_.run.xml" @@ -1,6 +1,6 @@ - - \ No newline at end of file + diff --git a/build_system/lpm_crawl_libpointmatcher_build_matrix.teamcity.bash b/build_system/lpm_crawl_libpointmatcher_build_matrix.teamcity.bash new file mode 100644 index 00000000..53d1a1f8 --- /dev/null +++ b/build_system/lpm_crawl_libpointmatcher_build_matrix.teamcity.bash @@ -0,0 +1,35 @@ +#!/bin/bash + +# ....Architecture.............................................. +TC_LPM_BUILD_ARCH=%TC_LPM_BUILD_ARCH% +if [[ -z ${TC_LPM_BUILD_ARCH} ]]; then + TC_LPM_BUILD_ARCH=ci_PR_multiarch +fi +echo "Build architecture: ${TC_LPM_BUILD_ARCH}" + +# ....Setup flags for dn_build_all.bash......................... +LPM_CRAWL_BUILD_MATRIX_FLAGS=() +# Add flag from TeamCity custom parameters +LPM_CRAWL_BUILD_MATRIX_FLAGS+=($(echo %LPM_CRAWL_BUILD_MATRIX_FLAGS% | tr " " "\n")) +if [[ -n "${LPM_CRAWL_BUILD_MATRIX_FLAGS}" ]]; then + echo "LPM_CRAWL_BUILD_MATRIX_FLAGS=(" + for each in "${LPM_CRAWL_BUILD_MATRIX_FLAGS[@]}" ; do + echo " ${each}" + done + echo ")" +fi + +LPM_CRAWL_BUILD_MATRIX_FLAGS+=("--repository-version-build-matrix-override" "latest") +LPM_CRAWL_BUILD_MATRIX_FLAGS+=("--fail-fast") +LPM_CRAWL_BUILD_MATRIX_FLAGS+=("--" "build" "${TC_LPM_BUILD_ARCH:?err}") + +# ....Dry-run.............................................. +TC_DRY_RUN=%TC_DRY_RUN% +if [[ ${TC_DRY_RUN} == true ]]; then + echo "Run in dry-run mode" + LPM_CRAWL_BUILD_MATRIX_FLAGS+=("--dry-run") +fi + +# ....Final..................................................... +echo -e "execute: bash lpm_crawl_libpointmatcher_build_matrix.bash ${LPM_CRAWL_BUILD_MATRIX_FLAGS[*]}" +bash lpm_crawl_libpointmatcher_build_matrix.bash "${LPM_CRAWL_BUILD_MATRIX_FLAGS[@]}" diff --git a/build_system/tests/tests_docker_dryrun_and_config/dryrun_lpm_crawl_libpointmatcher_build_matrix.bash b/build_system/tests/tests_docker_dryrun_and_config/dryrun_lpm_crawl_libpointmatcher_build_matrix.bash index 17487906..9aa98b14 100644 --- a/build_system/tests/tests_docker_dryrun_and_config/dryrun_lpm_crawl_libpointmatcher_build_matrix.bash +++ b/build_system/tests/tests_docker_dryrun_and_config/dryrun_lpm_crawl_libpointmatcher_build_matrix.bash @@ -6,5 +6,5 @@ LPM_ROOT_DIR="$(dirname "${_PATH_TO_SCRIPT}")" cd "${LPM_ROOT_DIR}/../../" # ====begin======================================================================================== -#bash lpm_crawl_libpointmatcher_build_matrix.bash --fail-fast -- build --dry-run ci_PR_amd64 ci_PR_arm64v8 +#bash lpm_crawl_libpointmatcher_build_matrix.bash --fail-fast -- build --dry-run ci_PR_amd64 ci_PR_arm64 bash lpm_crawl_libpointmatcher_build_matrix.bash --fail-fast -- build --dry-run diff --git a/build_system/tests/tests_docker_dryrun_and_config/dryrun_lpm_crawl_libpointmatcher_build_matrix.bleeding.bash b/build_system/tests/tests_docker_dryrun_and_config/dryrun_lpm_crawl_libpointmatcher_build_matrix.bleeding.bash index 94f38b9b..8be5b384 100644 --- a/build_system/tests/tests_docker_dryrun_and_config/dryrun_lpm_crawl_libpointmatcher_build_matrix.bleeding.bash +++ b/build_system/tests/tests_docker_dryrun_and_config/dryrun_lpm_crawl_libpointmatcher_build_matrix.bleeding.bash @@ -6,5 +6,5 @@ LPM_ROOT_DIR="$(dirname "${_PATH_TO_SCRIPT}")" cd "${LPM_ROOT_DIR}/../../" # ====begin======================================================================================== -#bash lpm_crawl_libpointmatcher_build_matrix.bleeding.bash --fail-fast -- build --dry-run ci_PR_amd64 ci_PR_arm64v8 +#bash lpm_crawl_libpointmatcher_build_matrix.bleeding.bash --fail-fast -- build --dry-run ci_PR_amd64 ci_PR_arm64 bash lpm_crawl_libpointmatcher_build_matrix.bleeding.bash --fail-fast -- build --dry-run diff --git a/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash b/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash index d857060d..3ab1c525 100644 --- a/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash +++ b/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash @@ -87,6 +87,16 @@ sudo apt-get update && ##cmake --version +# Retrieve ubuntu version number: DISTRIB_RELEASE +source /etc/lsb-release +print_msg "Ubuntu version is ${DISTRIB_RELEASE}" +if [[ ${DISTRIB_RELEASE} == '18.04' ]]; then + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt update + sudo apt install gcc-9 g++-9 +fi + + teamcity_service_msg_blockClosed # ................................................................................................. diff --git a/doc/contributing/contributing_instructions.md b/doc/contributing/contributing_instructions.md index 9b6d1375..363c81fd 100644 --- a/doc/contributing/contributing_instructions.md +++ b/doc/contributing/contributing_instructions.md @@ -68,14 +68,14 @@ cd /build_system bash lpm_crawl_libpointmatcher_build_matrix.bash --fail-fast -- build ci_PR # Run a specific case using build flags with multi-architecture -# virtualization using "ci_PR_amd64" and "ci_PR_arm64v8" services +# virtualization using "ci_PR_amd64" and "ci_PR_arm64" services bash lpm_crawl_libpointmatcher_build_matrix.bash \ --repository-version-build-matrix-override latest \ --os-name-build-matrix-override ubuntu \ --cmake-build-type-build-matrix-override RelWithDebInfo \ --ubuntu-version-build-matrix-override jammy \ --fail-fast \ - -- build ci_PR_amd64 ci_PR_arm64v8 + -- build ci_PR_amd64 ci_PR_arm64 # Read the help for details bash lpm_crawl_libpointmatcher_build_matrix.bash --help @@ -135,4 +135,4 @@ See [Commit Message References](commit_msg_reference.md) for details. - (in-progress) and it triggers the _semantic release automation_ ## Writing Documentation -The documentation is located in the /doc folder and uses the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) Markdown framework. \ No newline at end of file +The documentation is located in the /doc folder and uses the [Material for MkDocs](https://squidfunk.github.io/mkdocs-material/) Markdown framework. From 7b81dd26013cedbbac60111366e8a1e44d2d5523 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Tue, 13 Aug 2024 21:20:42 -0400 Subject: [PATCH 2/8] feat(ubuntu): enhance dependency installation for Ubuntu 18.04 - Add `sudo apt update` and `software-properties-common` package install before adding PPA. - Ensure non-interactive package installation with `--assume-yes` flag for `gcc-9` and `g++-9`. [skip release] --- .../ubuntu/lpm_install_dependencies_general_ubuntu.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash b/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash index 3ab1c525..350ad1ce 100644 --- a/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash +++ b/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash @@ -91,9 +91,11 @@ sudo apt-get update && source /etc/lsb-release print_msg "Ubuntu version is ${DISTRIB_RELEASE}" if [[ ${DISTRIB_RELEASE} == '18.04' ]]; then + sudo apt update + sudo apt install --assume-yes software-properties-common sudo add-apt-repository ppa:ubuntu-toolchain-r/test sudo apt update - sudo apt install gcc-9 g++-9 + sudo apt install --assume-yes gcc-9 g++-9 fi From 912814a71c8eab84cbb5b81ee017061371f64c63 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Tue, 13 Aug 2024 23:07:35 -0400 Subject: [PATCH 3/8] chore: add cache invalidation logic and clean up configs - Added INVALIDATE_CACHE ARG to Dockerfiles and .env for cache invalidation. - Deleted obsolete JetBrains run configuration. - Enabled verbose flag for sudo update-ca-certificates for more detailed output. Issue NMO-585 --- build_system/.env | 3 +++ ...ependencies (BUILD MATRIX SUBSET).run.xml" | 19 ------------------- build_system/docker-compose.dependencies.yaml | 1 + .../docker-compose.libpointmatcher.yaml | 1 + build_system/ubuntu/Dockerfile.dependencies | 2 ++ ...ockerfile.libpointmatcher.compilation_test | 2 ++ 6 files changed, 9 insertions(+), 19 deletions(-) delete mode 100644 "build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies-general dependencies (BUILD MATRIX SUBSET).run.xml" diff --git a/build_system/.env b/build_system/.env index bd79b2a9..75fcc95f 100644 --- a/build_system/.env +++ b/build_system/.env @@ -41,3 +41,6 @@ COMPOSE_PROJECT_NAME=libpointmatcher ## For debuging docker build localy, use `docker build --progress=plain --no-cache` flags instead #BUILDKIT_PROGRESS=plain +# Trick for invalidating cache periodicaly +#INVALIDATE_CACHE=$(date +%Y-%m-%d:%H:%M:%S) +INVALIDATE_CACHE=$(date +%Y-%m-%d) diff --git "a/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies-general dependencies (BUILD MATRIX SUBSET).run.xml" "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies-general dependencies (BUILD MATRIX SUBSET).run.xml" deleted file mode 100644 index d2e7dd3e..00000000 --- "a/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build dependencies-general dependencies (BUILD MATRIX SUBSET).run.xml" +++ /dev/null @@ -1,19 +0,0 @@ - - - - \ No newline at end of file diff --git a/build_system/docker-compose.dependencies.yaml b/build_system/docker-compose.dependencies.yaml index e671ed10..d2ff6c6f 100644 --- a/build_system/docker-compose.dependencies.yaml +++ b/build_system/docker-compose.dependencies.yaml @@ -17,6 +17,7 @@ services: IS_TEAMCITY_RUN: ${IS_TEAMCITY_RUN} NBS_LIB_INSTALL_PATH: ${NBS_LIB_INSTALL_PATH:?err} NBS_REPOSITORY_NAME: ${NBS_REPOSITORY_NAME:?err} + INVALIDATE_CACHE: ${INVALIDATE_CACHE:?err} tty: true stdin_open: true init: true # Propagate exit code (See remark in task NMO-266) diff --git a/build_system/docker-compose.libpointmatcher.yaml b/build_system/docker-compose.libpointmatcher.yaml index 66986776..bedf4784 100644 --- a/build_system/docker-compose.libpointmatcher.yaml +++ b/build_system/docker-compose.libpointmatcher.yaml @@ -24,6 +24,7 @@ services: REPOSITORY_VERSION: 'latest' CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE:?err} INSTALL_SCRIPT_FLAG: '--build-system-CI-install' + INVALIDATE_CACHE: ${INVALIDATE_CACHE:?err} tty: true stdin_open: true init: true # Propagate exit code (See remark in task NMO-266) diff --git a/build_system/ubuntu/Dockerfile.dependencies b/build_system/ubuntu/Dockerfile.dependencies index bee478fe..b9bb10a3 100644 --- a/build_system/ubuntu/Dockerfile.dependencies +++ b/build_system/ubuntu/Dockerfile.dependencies @@ -25,6 +25,8 @@ ENV TZ=Etc/UTC ENV TERM=${TERM:-"xterm-256color"} +ARG INVALIDATE_CACHE + # ....Setup timezone and localization.............................................................. # change the locale from POSIX to UTF-8 RUN apt-get update && \ diff --git a/build_system/ubuntu/Dockerfile.libpointmatcher.compilation_test b/build_system/ubuntu/Dockerfile.libpointmatcher.compilation_test index 7e9ab11a..2684ee2f 100644 --- a/build_system/ubuntu/Dockerfile.libpointmatcher.compilation_test +++ b/build_system/ubuntu/Dockerfile.libpointmatcher.compilation_test @@ -29,6 +29,8 @@ ARG DEBIAN_FRONTEND=noninteractive # ToDo: validate ENV TERM=${TERM:-"xterm-256color"} +ARG INVALIDATE_CACHE + # ====Checkout libpointmatcher repository========================================================== WORKDIR "${NBS_LIB_INSTALL_PATH}/${NBS_REPOSITORY_NAME}" From f91ebeb8f457b93f0013dcbeffb21baf15c1d1e5 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Tue, 13 Aug 2024 23:27:20 -0400 Subject: [PATCH 4/8] feat(build): enable no-cache for dependencies and integration test builds - Set `no_cache: true` in docker-compose files for consistent builds - Remove `INVALIDATE_CACHE` environment variable and related arguments from Dockerfiles --- build_system/.env | 4 ---- build_system/docker-compose.dependencies.yaml | 2 +- build_system/docker-compose.libpointmatcher.yaml | 3 +-- build_system/ubuntu/Dockerfile.dependencies | 2 -- .../ubuntu/Dockerfile.libpointmatcher.compilation_test | 2 -- 5 files changed, 2 insertions(+), 11 deletions(-) diff --git a/build_system/.env b/build_system/.env index 75fcc95f..660be331 100644 --- a/build_system/.env +++ b/build_system/.env @@ -40,7 +40,3 @@ COMPOSE_PROJECT_NAME=libpointmatcher ## Unmute BUILDKIT_PROGRESS to set globaly for debugging dockerfile ## For debuging docker build localy, use `docker build --progress=plain --no-cache` flags instead #BUILDKIT_PROGRESS=plain - -# Trick for invalidating cache periodicaly -#INVALIDATE_CACHE=$(date +%Y-%m-%d:%H:%M:%S) -INVALIDATE_CACHE=$(date +%Y-%m-%d) diff --git a/build_system/docker-compose.dependencies.yaml b/build_system/docker-compose.dependencies.yaml index d2ff6c6f..9fcf3340 100644 --- a/build_system/docker-compose.dependencies.yaml +++ b/build_system/docker-compose.dependencies.yaml @@ -7,6 +7,7 @@ services: target: libpointmatcher-dependencies-general context: .. dockerfile: ${NBS_SUPERPROJECT_BUILD_SYSTEM_DIR:?err}/ubuntu/Dockerfile.dependencies + no_cache: true platforms: - "linux/amd64" - "linux/arm64/v8" @@ -17,7 +18,6 @@ services: IS_TEAMCITY_RUN: ${IS_TEAMCITY_RUN} NBS_LIB_INSTALL_PATH: ${NBS_LIB_INSTALL_PATH:?err} NBS_REPOSITORY_NAME: ${NBS_REPOSITORY_NAME:?err} - INVALIDATE_CACHE: ${INVALIDATE_CACHE:?err} tty: true stdin_open: true init: true # Propagate exit code (See remark in task NMO-266) diff --git a/build_system/docker-compose.libpointmatcher.yaml b/build_system/docker-compose.libpointmatcher.yaml index bedf4784..be08fd70 100644 --- a/build_system/docker-compose.libpointmatcher.yaml +++ b/build_system/docker-compose.libpointmatcher.yaml @@ -11,7 +11,7 @@ services: build: context: .. dockerfile: ${NBS_SUPERPROJECT_BUILD_SYSTEM_DIR:?err}/ubuntu/Dockerfile.libpointmatcher.compilation_test - no_cache: false + no_cache: true target: test-compilation-auto-path-resolution platforms: - "linux/amd64" @@ -24,7 +24,6 @@ services: REPOSITORY_VERSION: 'latest' CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE:?err} INSTALL_SCRIPT_FLAG: '--build-system-CI-install' - INVALIDATE_CACHE: ${INVALIDATE_CACHE:?err} tty: true stdin_open: true init: true # Propagate exit code (See remark in task NMO-266) diff --git a/build_system/ubuntu/Dockerfile.dependencies b/build_system/ubuntu/Dockerfile.dependencies index b9bb10a3..bee478fe 100644 --- a/build_system/ubuntu/Dockerfile.dependencies +++ b/build_system/ubuntu/Dockerfile.dependencies @@ -25,8 +25,6 @@ ENV TZ=Etc/UTC ENV TERM=${TERM:-"xterm-256color"} -ARG INVALIDATE_CACHE - # ....Setup timezone and localization.............................................................. # change the locale from POSIX to UTF-8 RUN apt-get update && \ diff --git a/build_system/ubuntu/Dockerfile.libpointmatcher.compilation_test b/build_system/ubuntu/Dockerfile.libpointmatcher.compilation_test index 2684ee2f..7e9ab11a 100644 --- a/build_system/ubuntu/Dockerfile.libpointmatcher.compilation_test +++ b/build_system/ubuntu/Dockerfile.libpointmatcher.compilation_test @@ -29,8 +29,6 @@ ARG DEBIAN_FRONTEND=noninteractive # ToDo: validate ENV TERM=${TERM:-"xterm-256color"} -ARG INVALIDATE_CACHE - # ====Checkout libpointmatcher repository========================================================== WORKDIR "${NBS_LIB_INSTALL_PATH}/${NBS_REPOSITORY_NAME}" From d370759aafc4040e9803477c91b2843daa77747f Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Wed, 14 Aug 2024 09:00:08 -0400 Subject: [PATCH 5/8] feat(dependencies): update Ubuntu dependencies installation process - Add `software-properties-common` to the general dependency list - Consolidate commands to remove outdated packages - Use conditional logic for installing compilers based on Ubuntu version [skip release] --- ...m_install_dependencies_general_ubuntu.bash | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash b/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash index 350ad1ce..687caa6e 100644 --- a/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash +++ b/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash @@ -76,9 +76,8 @@ sudo apt-get update && curl \ wget \ git \ + software-properties-common \ && sudo apt-get install --assume-yes "${APT_FLAGS[@]}" \ - g++ \ - gcc \ catch \ make \ cmake \ @@ -91,11 +90,20 @@ sudo apt-get update && source /etc/lsb-release print_msg "Ubuntu version is ${DISTRIB_RELEASE}" if [[ ${DISTRIB_RELEASE} == '18.04' ]]; then - sudo apt update - sudo apt install --assume-yes software-properties-common + # Update Bionic outdated compiler + # Ref https://github.com/norlab-ulaval/libpointmatcher/pull/581#issuecomment-2284415233 sudo add-apt-repository ppa:ubuntu-toolchain-r/test - sudo apt update - sudo apt install --assume-yes gcc-9 g++-9 + sudo apt-get update && + sudo apt-get install --assume-yes "${APT_FLAGS[@]}" \ + gcc-9 \ + g++-9 && + sudo rm -rf /var/lib/apt/lists/* +else + sudo apt-get update && + sudo apt-get install --assume-yes "${APT_FLAGS[@]}" \ + g++ \ + gcc && + sudo rm -rf /var/lib/apt/lists/* fi From f92d7104f942e630b3676cef8d352f336a3785f3 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Wed, 14 Aug 2024 09:37:41 -0400 Subject: [PATCH 6/8] revert: add gcc and g++ to general Ubuntu dependencies - Re-added gcc and g++ installation to the base dependencies script. - Removed redundant installation commands for gcc and g++ in non-version-specific branch. Issue NMO-585 [skip release] --- .../ubuntu/lpm_install_dependencies_general_ubuntu.bash | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash b/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash index 687caa6e..f8f2abca 100644 --- a/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash +++ b/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash @@ -78,6 +78,8 @@ sudo apt-get update && git \ software-properties-common \ && sudo apt-get install --assume-yes "${APT_FLAGS[@]}" \ + gcc \ + g++ \ catch \ make \ cmake \ @@ -98,15 +100,8 @@ if [[ ${DISTRIB_RELEASE} == '18.04' ]]; then gcc-9 \ g++-9 && sudo rm -rf /var/lib/apt/lists/* -else - sudo apt-get update && - sudo apt-get install --assume-yes "${APT_FLAGS[@]}" \ - g++ \ - gcc && - sudo rm -rf /var/lib/apt/lists/* fi - teamcity_service_msg_blockClosed # ................................................................................................. From 809bf6cfa937edf08a766f402c4f39006dd5d163 Mon Sep 17 00:00:00 2001 From: RedLeaderOne Date: Thu, 15 Aug 2024 09:55:00 -0400 Subject: [PATCH 7/8] build: update GCC and G++ alternatives - Add command to set GCC and G++ 9 as bionic alternatives Issue NMO-585 and PR #581 --- build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash | 1 + 1 file changed, 1 insertion(+) diff --git a/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash b/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash index 6a37916c..82b8b2d4 100644 --- a/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash +++ b/build_system/ubuntu/lpm_install_dependencies_general_ubuntu.bash @@ -100,6 +100,7 @@ if [[ ${DISTRIB_RELEASE} == '18.04' ]]; then gcc-9 \ g++-9 && sudo rm -rf /var/lib/apt/lists/* + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 fi n2st::teamcity_service_msg_blockClosed From fb2360e7082a4121c2f83bfa616bead4071117ba Mon Sep 17 00:00:00 2001 From: boxanm Date: Thu, 15 Aug 2024 22:48:20 +0200 Subject: [PATCH 8/8] Update docs --- doc/Compilation.md | 21 +++++++++++++++++---- mkdocs.yml | 1 + 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/doc/Compilation.md b/doc/Compilation.md index ecce5225..39ec7ba6 100644 --- a/doc/Compilation.md +++ b/doc/Compilation.md @@ -41,9 +41,9 @@ This tutorial will guide you through the different steps to install libpointmatc ### Dependencies Libpointmatcher relies on a number of standard libraries, most of which can be installed with standard package managers. The following table lists the minimum requirements necessary to instal libpointmatcher. -| Library name | cmake | boost | eigen | yaml-cpp | libnabo | doxygen (opt.) | -|:-------------|:------:|:------:|:-------:|:--------:|:-------:|:--------------:| -| **Version** | 3.10.2 | 1.65.1 | 3.3.4-4 | 0.5 | 1.1.1 | 1.8.13-10 | +| Library name | g++ | cmake | boost | eigen | yaml-cpp | libnabo | doxygen (opt.) | +|:-------------|-------|:------:|:------:|:-------:|:--------:|:-------:|:--------------:| +| **Version** | 9.4.0 | 3.10.2 | 1.65.1 | 3.3.4-4 | 0.5 | 1.1.1 | 1.8.13-10 | ## Detailed Installation Instructions The rest of this tutorial will guide you through the different requirements step by step. @@ -52,11 +52,24 @@ The rest of this tutorial will guide you through the different requirements step Some installation steps are platform-dependent and need to be done beforehand. === "Ubuntu" - You will need to install the GNU Compiler Collection, also known as GCC. The minimum supported version is 7.5.0. + You will need to install the GNU Compiler Collection, also known as GCC. The minimum supported version is 9.4.0. ```bash sudo apt update sudo apt install build-essential ``` + + ??? warning "Ubuntu 18 Bionic" + + While newer versions of Ubuntu come with gcc and g++ on newer versions than 9.4.0 and support all modern C++17 standard library features, it is not the case for Ubuntu Bionic. + You will therefore need to install it manually. + Run + ```shell + sudo add-apt-repository ppa:ubuntu-toolchain-r/test + sudo apt-get update && + sudo apt-get install gcc-9 g++-9 + sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 60 --slave /usr/bin/g++ g++ /usr/bin/g++-9 + ``` + === "MacOS" ###### Installing Xcode via the App Store (OS X 10.10.2 and later) diff --git a/mkdocs.yml b/mkdocs.yml index 53aa1d87..2409dfcf 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -46,6 +46,7 @@ markdown_extensions: - pymdownx.superfences - pymdownx.tabbed: alternate_style: true + - pymdownx.details - attr_list - md_in_html nav: