diff --git a/.env.libpointmatcher b/.env.libpointmatcher new file mode 100644 index 000000000..c83517e6e --- /dev/null +++ b/.env.libpointmatcher @@ -0,0 +1,35 @@ +# ================================================================================================= +# +# Set project related environment variables. Those are available for convenience +# and are also required by 'norlab-shell-script-tools' library. +# +# Usage: +# +# Important! Source this file from 'libpointmatcher' repository root +# $ cd +# $ set -o allexport && source .env.libpointmatcher && set +o allexport +# +# ================================================================================================= + +PROJECT_PROMPT_NAME='LPM' + +# ....Programaticaly fetch source code information................................................. +PROJECT_GIT_REMOTE_URL="https://github.com/norlab-ulaval/libpointmatcher" +PROJECT_GIT_NAME=$( basename "${PROJECT_GIT_REMOTE_URL}" .git ) +PROJECT_PATH=$( git rev-parse --show-toplevel ) +PROJECT_SRC_NAME="$( basename ${PROJECT_PATH} )" + +# ....Set LPM related environment variable with their own prefix................................... +# Note: Those with "PROJECT_" prefix will get eventualy overiden in the case where N2ST is used +# as a library. Using generic testing logic require that environment variables with +# "PROJECT_" prefix be available. +LPM_PROMPT_NAME="${PROJECT_PROMPT_NAME}" +LPM_GIT_REMOTE_URL="${PROJECT_GIT_REMOTE_URL}" +LPM_GIT_NAME="${PROJECT_GIT_NAME}" +LPM_PATH="${PROJECT_PATH}" +LPM_SRC_NAME="${PROJECT_SRC_NAME}" + +# ....Set dependencies path........................................................................ +LPM_BUILD_SYSTEM_PATH="${PROJECT_PATH}/build_system" +N2ST_PATH="${PROJECT_PATH}/build_system/utilities/norlab-shell-script-tools" +NBS_PATH="${PROJECT_PATH}/build_system/utilities/norlab-build-system" diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 000000000..634c2cbd8 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,37 @@ +# ================================================================================================= +# Files or directories with designated code owner. +# +# Note: +# - Each line is a file pattern followed by one or more owners. +# - Branch with branch protection rule "Require review from Code Owners" +# will automaticaly trigger a request to a designated code owner +# ================================================================================================= + +# ....Repository wide code owner................................................................... +# These owners will be the default owners for everything in the repo. +#* @pomerlef + + +# ....High level files............................................................................. +/README.md @pomerlef +/LICENSE @pomerlef + +# ....Core directories and files................................................................... +/doc @boxanm @simonpierredeschenes @aguenette @pomerlef +/pointmatcher @boxanm @simonpierredeschenes @aguenette +/python @boxanm @simonpierredeschenes @aguenette +/utest @boxanm @simonpierredeschenes @aguenette +/examples @boxanm @simonpierredeschenes @aguenette + +# ....User install tools........................................................................... +/.env.libpointmatcher @RedLeader962 +/libpointmatcher_installer.bash @RedLeader962 +/libpointmatcher_dependencies_installer.bash @RedLeader962 + +# ....DevOps related............................................................................... +/.github/ @RedLeader962 +/build_system/ @RedLeader962 +/.gitmodules @RedLeader962 +/.gitignore @RedLeader962 +/.dockerignore @RedLeader962 + diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..01feac1f2 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,54 @@ +# Description + +### Summary: + +### Changes and type of changes (quick overview): + +- +- +- + +--- + +# Checklist: + +### Code related + +- [ ] I have made corresponding changes to the documentation + (i.e.: function, class, script header, README.md) +- [ ] I have commented hard-to-understand code +- [ ] I have added tests that prove my fix is effective or that my feature works +- [ ] All tests pass locally with my changes + (Check [README.md #Contributing](https://github.com/norlab-ulaval/libpointmatcher/tree/develop#contributing) + for local testing procedure using _libpointmatcher-build-system_) + +### PR creation related + +- [ ] My pull request `base ref` branch is set to the `develop` branch + (the _build-system_ won't be triggered otherwise) +- [ ] My pull request branch is up-to-date with the `develop` branch + (the _build-system_ will reject it otherwise) + +### PR description related + +- [ ] I have included a quick summary of the changes +- [ ] I have indicated the related issue's id with `# ` if changes are of type `fix` +- [ ] I have included a high-level list of changes and their corresponding type + - Types: `feat` `fix` `docs` `style` `refactor` `perf` `test` `build` `ci` `chore` `revert` + - Breaking changes: `!` + - Reference: + see [commit_msg_reference.md](https://github.com/norlab-ulaval/libpointmatcher/blob/develop/commit_msg_reference.md) + in the repository root for details + +--- + +## Note for repository admins + +### Release PR related + +- Only repository admins have the privilege to `push/merge` on the default branch (ie: `master`) + and the `release` branch. +- Keep PR in `draft` mode until all the release reviewers are ready to push the release. +- Once a PR from `release` -> `master` branch is created (not in draft mode), + - it triggers the _build-system_ test + - (in-progress) and it triggers the _semantic release automation_ diff --git a/.github/workflows/build-python.yaml b/.github/workflows/build-python.yaml index 75c18b788..74883f691 100644 --- a/.github/workflows/build-python.yaml +++ b/.github/workflows/build-python.yaml @@ -6,7 +6,7 @@ on: tags: - '[0-9]+.[0-9]+.[0-9]+' pull_request: - branches: [master] + branches: [master, develop] workflow_dispatch: env: @@ -131,6 +131,7 @@ jobs: gcc \ make \ libeigen3-dev \ + libyaml-cpp-dev \ ninja-build \ catch \ libomp-dev \ @@ -184,7 +185,7 @@ jobs: if: ${{ steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' }} working-directory: ${{ env.BOOST_SRC_DIR }}/${{ env.BOOST_DIR }} run: | - ./bootstrap.sh --with-libraries=thread,filesystem,system,program_options,date_time,chrono --with-icu --with-python=python --prefix=${{ env.BOOST_INSTALL_PATH }} + ./bootstrap.sh --with-libraries=thread,filesystem,system,program_options,date_time,chrono --with-icu --prefix=${{ env.BOOST_INSTALL_PATH }} ./b2 cxxflags=-fPIC cflags=-fPIC link=static install - name: Download source code libnabo ${{ env.LIBNABO_VERSION }} @@ -266,6 +267,7 @@ jobs: -Dpybind11_DIR=${{ env.PYBIND11_INSTALL_PATH }}/share/cmake/pybind11 \ -DBUILD_PYTHON_MODULE:BOOL=ON \ -DUSE_OPEN_MP:BOOL=ON \ + -DBoost_USE_STATIC_LIBS:BOOL=ON \ -DCMAKE_BUILD_TYPE=RelWithDebInfo \ -S . -B ${{ env.BUILD_DIR }} sudo cmake --build ${{ env.BUILD_DIR }} --target install @@ -280,6 +282,7 @@ jobs: -DLIBNABO_INSTALL_DIR:PATH="${{ env.LIBNABO_INSTALL_PATH }}" ` -Dpybind11_DIR:PATH="${{ env.PYBIND11_INSTALL_PATH }}/share/cmake/pybind11" ` -DBUILD_PYTHON_MODULE:BOOL=ON ` + -DBoost_USE_STATIC_LIBS:BOOL=ON ` -DPYTHON_INSTALL_TARGET:PATH="./python/${{ env.PYTHON_PACKAGE_NAME }}" ` -DVCPKG_TARGET_TRIPLET="x64-windows-static" ` -DUSE_OPEN_MP:BOOL=ON ` @@ -292,11 +295,14 @@ jobs: run: | python -m build --wheel --no-isolation --outdir ${{ env.PYTHON_WHEEL_DIR }} - - name: Test package + - name: Install package working-directory: ./python run: | pip install ${{ env.PYTHON_WHEEL_DIR }}/*.whl - python -c "from pypointmatcher import *" + + - name: Test import + working-directory: ${{ runner.temp }} + run: python -c "from pypointmatcher import *" - name: Upload python wheel uses: actions/upload-artifact@v3 diff --git a/.gitignore b/.gitignore index 914d404ce..2567c7cb3 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,5 @@ build dist/ *.so + +.idea/ diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..7af815303 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,6 @@ +[submodule "build_system/utilities/norlab-build-system"] + path = build_system/utilities/norlab-build-system + url = https://github.com/norlab-ulaval/norlab-build-system.git +[submodule "build_system/utilities/norlab-shell-script-tools"] + path = build_system/utilities/norlab-shell-script-tools + url = https://github.com/norlab-ulaval/norlab-shell-script-tools.git diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 686cd35a4..f19ecbd2a 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -2,6 +2,91 @@ Changelog for package libpointmatcher ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +1.4.0 (2023-12-15) +----------------- +* fix: N2ST path resolution in dependencies-doc docker image +* refactor: move libpointmatcher build-system logic to norlab-build-system submodule +* fix: build-system side unstable compilation issue fix +* Fixes to CMake library management config generation +* New DataPoints filter for descriptor augmentation Enhancement +* Fix 2D transformation tests in debug +* Fix Transformations test build when using Eigen3.4 +* Disable static boost linkage by default +* Update CompilationPython.md +* Update README.md +* Update readme_test.md for docker daemon test +* Create readme_test.md +* Updated the inner loop counter +* build-system minor mod +* libpointmatcher build-system +* Fix omega descriptor export +* Handle libnabo config mode +* Build python binding as regular package +* Fix time values after applying Sampling surface normal filter +* Add seed to Random sampling filter +* Add more details in pypointmatcher's installation docs +* Fixed compilation on Visual Studio 2022 +* Fix 4DoF PointToPlane error minimizer crash +* Use the LOG_INFO_STREAM macro instead of std::cerr +* package format=3 +* Create LICENSE file based on BSD license as per package.xml +* catkin not required for pure cmake packages +* Histogram::computeStats() without sorting the Histogram +* Windows: Fix Narrowing conversion of seed in MaxPointCount +* Change storage ordering of the eigen vectors descriptors +* Apply the transformation to eigen vectors +* Fix the surface normals datapoints filter covariance matrix bug +* Fix weird behavior of MaxPointCountDataPointsFilter +* Bug fix in SurfaceNormalOutlierFilter +* Update CompilationWindows.md +* [Matches/OutlierFiltersImpl] Made convergence error messages more informative +* RemoveBeyond option for the maxQuantileDistance filter +* refactor: Drop support for yaml-cpp old API Enhancement +* Automaticaly find eigen3 +* Strong Windows installation tutorial update +* Add libpointmatcher_INCLUDE_DIR to match with CGAL +* Add Boost_LIBRARIES to pointmatcher_LIBRARIES +* Add option to weight by reading pc +* Fixes for windows +* Fix windows doc +* Include iso646.h to add and, or, not macros +* Typo in PCL lib name +* Implemented an in-place method for transforming DataPoints objects +* The keyword "or" is not supported by windows compilers. +* Link against pthread +* [DataPoints] Added check to prevent unsigned int underflow in getEuclideanDim() +* [feature/spdf] Add SpectralDecompositionFilter (SpDF) +* Fixed the differences between examples and documentation (#409) +* Fix build of downstream packages. +* Reorganization of the compiling tutorials for ubuntu and macos +* Added reference for PointToPlaneWithCov ErrorMinimizer. +* [WIP] feature/python_module : Adding libpointmatcher's Python bindings (#222) Enhancement +* Feature/speedup random sampling filter +* Replaced the remaining raw pointers with shared pointers in Registrar.h +* Adding the new outlierfilters documentation to mkdocs .yml +* Outlier filter documentation added +* Fix/typo Fixes tutorials building failure +* Fixes tutorials formatting problem (#373) +* [WIP] Fix/typo : Tutorials improvements +* Fix out-of-bounds access +* Add missing force4DOF param to PointToPlaneWithCov +* Modernize cmake; make cmake compatible with git submoduling +* Feature/4 dof for point to plane minimizer +* Feature/geometry data points filter for master +* Get rid of the Visual C++ warnings +* Change matrix type +* Update link to documentation in readme +* Fix segfault happening in ICPSequence class +* Added missing include that made windows compilation fail. +* Change icp chain image to an svg +* Add support for Travis +* Fix typo +* Improve speed of Normal Space filtering +* Fix/normal space hashing +* Fix/clamp normals + + + 1.3.1 (2019-03-04) ------------------ * Added documentation for people using ROS. diff --git a/CMakeLists.txt b/CMakeLists.txt index 3c6d14117..f295cd250 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,8 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.8) include(GNUInstallDirs) # populate CMAKE_INSTALL_{LIB,BIN}DIR include(CheckSymbolExists) +include(CMakePackageConfigHelpers) #======================== @@ -26,12 +27,8 @@ endif () string(REGEX REPLACE ".*\"(.*)\".*" "\\1" POINTMATCHER_PROJECT_VERSION "${POINTMATCHER_PROJECT_VERSION}") # In 3.0+, project(...) should specify VERSION to satisfy CMP0048 -if (CMAKE_VERSION VERSION_LESS 3.0.0) - project(libpointmatcher) -else () - cmake_policy(SET CMP0048 NEW) - project(libpointmatcher VERSION ${POINTMATCHER_PROJECT_VERSION}) -endif () +cmake_policy(SET CMP0048 NEW) +project(libpointmatcher VERSION ${POINTMATCHER_PROJECT_VERSION}) set(CMAKE_DEBUG_POSTFIX "d") @@ -111,7 +108,7 @@ endforeach() # initially set(EXTERNAL_LIBS "") -# compile local version of gtest and yaml-cpp +# compile local version of gtest add_subdirectory(contrib) #--------------------------- @@ -127,8 +124,6 @@ endif() #-------------------- # DEPENDENCY: boost #-------------------- -set(Boost_USE_STATIC_LIBS ON) - find_package(Boost REQUIRED COMPONENTS thread filesystem system program_options date_time) if (Boost_MINOR_VERSION GREATER 47) find_package(Boost REQUIRED COMPONENTS thread filesystem system program_options date_time chrono) @@ -163,7 +158,8 @@ if (NOT TARGET nabo) # Find libnabo: find_package(libnabo REQUIRED PATHS ${LIBNABO_INSTALL_DIR}) if (TARGET libnabo::nabo) - message(STATUS "libnabo found, version ${libnabo_VERSION} (Config mode)") + set(libnabo_LIBRARIES libnabo::nabo) + message(STATUS "libnabo found, version ${libnabo_VERSION} (Config mode, libs=${libnabo_LIBRARIES})") else() message(STATUS "libnabo found, version ${libnabo_VERSION} (include=${libnabo_INCLUDE_DIRS} libs=${libnabo_LIBRARIES})") endif() @@ -175,7 +171,6 @@ endif() # This cmake target alias will be defined by either: # a) libnabo sources if built as a git submodule in the same project than this library, or # b) by libnabo-targets.cmake, included by find_package(libnabo) above. -# set(libnabo_LIBRARIES libnabo::nabo) #-------------------- # DEPENDENCY: OpenMP (optional) @@ -217,40 +212,17 @@ endif() #-------------------- -# DEPENDENCY: yaml-cpp (local or system, optional) +# DEPENDENCY: yaml-cpp #-------------------- -option(USE_SYSTEM_YAML_CPP "Use system version of yaml-cpp rather than one packaged with libpointmatcher" FALSE) - -if(USE_SYSTEM_YAML_CPP) - message(STATUS "Looking for yaml-cpp on system") - find_path(yaml-cpp_INCLUDE_DIRS yaml-cpp/yaml.h - /usr/local/include - ) - find_library(yaml-cpp_LIBRARIES yaml-cpp PATHS - /usr/local/lib - ) - if(yaml-cpp_INCLUDE_DIRS AND yaml-cpp_LIBRARIES) - set(yamlcpp_FOUND) - message("-- yaml-cpp found, text-based configuration enabled") - else() - message("-- yaml-cpp not found, text-based configuration and related applications disabled") - endif() -else() - include_directories(contrib/yaml-cpp-pm/include) -#note: this is not working.... - #get_property(yaml-cpp-pm_INCLUDE TARGET yaml-cpp-pm PROPERTY INCLUDE_DIRECTORIES) - #include_directories(${yaml-cpp-pm_INCLUDE}) - - list(APPEND EXTERNAL_LIBS $) - list(APPEND EXTRA_DEPS yaml-cpp-pm) - set(yamlcpp_FOUND) - - get_property(yaml-cpp-pm_VERSION TARGET yaml-cpp-pm PROPERTY VERSION) - message("-- using built-in yaml-cpp, version ${yaml-cpp-pm_VERSION}") - message(" -- text-based configuration enabled") +message(STATUS "Looking for yaml-cpp on system...") +find_package(yaml-cpp CONFIG REQUIRED) +if(TARGET yaml-cpp::yaml-cpp) + set(YAML_CPP_LIBRARIES "yaml-cpp::yaml-cpp") endif() - +if(YAML_CPP_LIBRARIES STREQUAL "") + set(YAML_CPP_LIBRARIES "yaml-cpp") # Fix linking issue on MacOS with yaml-cpp 0.7.0 +endif () #-------------------- # DEPENDENCY: rt (optional) @@ -263,21 +235,21 @@ check_symbol_exists(_POSIX_TIMERS "unistd.h;time.h" POSIX_TIMERS) #========================== libpointmatcher itself ============================== -# Check the compiler version as we need full C++11 support. +# Check the compiler version as we need full C++17 support. if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang") # using Clang - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "3.3") - message(WARNING, "Your clang compiler has version ${CMAKE_CXX_COMPILER_VERSION}, while only version 3.3 or later is supported") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5") + message(WARNING, "Your clang compiler has version ${CMAKE_CXX_COMPILER_VERSION}, while only version 5 or later is supported") endif () elseif(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang") # using AppleClang - if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "5.1") - message(WARNING "Your XCode environment has version ${CMAKE_CXX_COMPILER_VERSION}, while only version 5.1 or later is supported") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "7.0") + message(WARNING "Your XCode environment has version ${CMAKE_CXX_COMPILER_VERSION}, while only version 7.0 or later is supported") endif() elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # using GCC - if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.2") - message(WARNING, "Your g++ compiler has version ${CMAKE_CXX_COMPILER_VERSION}, while only version 4.8.2 or later is supported") + if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9") + message(WARNING, "Your g++ compiler has version ${CMAKE_CXX_COMPILER_VERSION}, while only version 9 or later is supported") endif () elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") # using MSVC @@ -286,18 +258,18 @@ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") endif() endif () -# enable C++11 support. -if (CMAKE_VERSION VERSION_LESS "3.1") +# enable C++17 support. +if (CMAKE_VERSION VERSION_LESS "3.8") if (MSVC) message(FATAL_ERROR, "CMake version 3.1 or later is required to compiler ${PROJECT_NAME} with Microsoft Visual C++") endif () if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU") set (CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS}") else () - set (CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}") + set (CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS}") endif () else () - set (CMAKE_CXX_STANDARD 11) + set (CMAKE_CXX_STANDARD 17) endif () # SOURCE @@ -338,6 +310,7 @@ set(POINTMATCHER_SRC pointmatcher/ErrorMinimizers/PointToPointSimilarity.cpp pointmatcher/ErrorMinimizers/Identity.cpp #DataPointsFilters + pointmatcher/DataPointsFilters/AddDescriptor.cpp pointmatcher/DataPointsFilters/Identity.cpp pointmatcher/DataPointsFilters/RemoveNaN.cpp pointmatcher/DataPointsFilters/MaxDist.cpp @@ -383,7 +356,7 @@ target_include_directories(pointmatcher PUBLIC $ $ $ - $ + $ ) if (NOT MSVC) @@ -392,14 +365,8 @@ else() target_compile_options(pointmatcher PRIVATE /bigobj) endif() -if(yaml-cpp_INCLUDE_DIRS AND yaml-cpp_LIBRARIES) - target_link_libraries(pointmatcher PRIVATE ${yaml-cpp_LIBRARIES}) - target_include_directories(pointmatcher PRIVATE ${yaml-cpp_INCLUDE_DIRS}) -else() # embedded version: - # This could be enabled if yaml-cpp-pm was in the "export set" - #target_link_libraries(pointmatcher PRIVATE yaml-cpp-pm) - # For now, let's add yaml-cpp-pm output to EXTERNAL_LIBS -endif() +target_link_libraries(pointmatcher PUBLIC ${YAML_CPP_LIBRARIES}) +target_include_directories(pointmatcher PUBLIC ${YAML_CPP_INCLUDE_DIR}) target_link_libraries(pointmatcher PUBLIC ${Boost_LIBRARIES}) @@ -457,7 +424,7 @@ set(GENERATE_API_DOC false CACHE BOOL "Set to true to build the documentation us if(GENERATE_API_DOC) - message("-- API Documentation (doxygen): enabled") + message(STATUS "API Documentation (doxygen): enabled") # Note: there seems to be equations in the documentation leading to the # use of Latex anyway. This cause problems for user without latex... @@ -477,21 +444,19 @@ endif() #=============== trigger other makefile ====================== # Example programs -option(POINTMATCHER_BUILD_EXAMPLES "Build libpointmatcher examples" ON) -if (POINTMATCHER_BUILD_EXAMPLES) +option(BUILD_EXAMPLES "Build libpointmatcher examples" ON) +if (BUILD_EXAMPLES) add_subdirectory(examples) endif() # Evaluation programs -option(POINTMATCHER_BUILD_EVALUATIONS "Build libpointmatcher evaluations" ON) -if (POINTMATCHER_BUILD_EVALUATIONS) +option(BUILD_EVALUATIONS "Build libpointmatcher evaluations" ON) +if (BUILD_EVALUATIONS) add_subdirectory(evaluations) endif() # Unit testing - option(BUILD_TESTS "Build all tests." OFF) - if (BUILD_TESTS) enable_testing() add_subdirectory(utest) @@ -515,6 +480,8 @@ endif() # target_link_libraries(executableName ${libpointmatcher_LIBRARIES}) # ... +# 1- local build # + # Install cmake config module install(EXPORT ${PROJECT_NAME}-config DESTINATION share/${PROJECT_NAME}/cmake) @@ -532,27 +499,27 @@ get_property(CONF_INCLUDE_DIRS DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY IN set(POINTMATCHER_LIB $) # Configure config file for local build tree -configure_file(libpointmatcherConfig.cmake.in - "${PROJECT_BINARY_DIR}/libpointmatcherConfig.cmake" @ONLY) +configure_package_config_file(libpointmatcherConfig.cmake.in + "${PROJECT_BINARY_DIR}/libpointmatcherConfig.cmake" + INSTALL_DESTINATION share/libnabo/cmake + PATH_VARS PROJECT_NAME + ) # 2- installation build # # Change the include location for the case of an install location set(CONF_INCLUDE_DIRS ${INSTALL_INCLUDE_DIR} ${CONF_INCLUDE_DIRS} ) -#FIXME: this will only be applied to installed files. Confirm that we want that. -# gather all the includes but remove ones in the source tree -# because we added an include for the local yaml-cpp-pm we should also remove it -list(REMOVE_ITEM CONF_INCLUDE_DIRS ${CMAKE_SOURCE_DIR} ${CMAKE_SOURCE_DIR}/contrib/yaml-cpp-pm/include) - # We put the generated file for installation in a different repository (i.e., ./CMakeFiles/) -configure_file(libpointmatcherConfig.cmake.in - "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/libpointmatcherConfig.cmake" @ONLY) +configure_package_config_file(libpointmatcherConfig.cmake.in + "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/libpointmatcherConfig.cmake" + INSTALL_DESTINATION share/libnabo/cmake + PATH_VARS PROJECT_NAME + ) # The same versioning file can be used for both cases -configure_file(libpointmatcherConfigVersion.cmake.in - "${PROJECT_BINARY_DIR}/libpointmatcherConfigVersion.cmake" @ONLY) - +write_basic_package_version_file(libpointmatcherConfigVersion.cmake + COMPATIBILITY AnyNewerVersion) # Install the libpointmatcherConfig.cmake and libpointmatcherConfigVersion.cmake install( diff --git a/LICENSE b/LICENSE index e9f13856f..9703c25ec 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause License -Copyright (c) 2010-2021, the libpointmatcher authors +Copyright (c) 2010-2023, the libpointmatcher authors All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/README.md b/README.md index 737fbd0a3..f26ac4f4e 100644 --- a/README.md +++ b/README.md @@ -1,27 +1,85 @@ -[![Mentioned in Awesome LIDAR](https://awesome.re/mentioned-badge.svg)](https://github.com/szenergy/awesome-lidar#basic-matching-algorithms) Awesome LIDAR; [![Mentioned in Awesome Robotics Libraries](https://awesome.re/mentioned-badge.svg)](http://jslee02.github.io/awesome-robotics-libraries/#3d-mapping) Awesome Robotics Libraries; [![Mentioned in Awesome Robotics](https://awesome.re/mentioned-badge.svg)](https://github.com/ahundt/awesome-robotics#point-clouds) Awesome Robotics +
+ ![banner](doc/images/banner_light.jpeg) +[//]: # (====Awesome badges=======================================================================) + +[![Mentioned in Awesome LIDAR](https://awesome.re/mentioned-badge.svg)](https://github.com/szenergy/awesome-lidar#basic-matching-algorithms) +      +[![Mentioned in Awesome Robotics Libraries](https://awesome.re/mentioned-badge.svg)](http://jslee02.github.io/awesome-robotics-libraries/#3d-mapping) +      +[![Mentioned in Awesome Robotics](https://awesome.re/mentioned-badge.svg)](https://github.com/ahundt/awesome-robotics#point-clouds) +
+ +            +LIDAR +                            +Robotics +                +Robotics Libraries + + + +[//]: # (====GitHub badges========================================================================) + +GitHub Repo stars +GitHub forks +GitHub License +GitHub release (with filter) + +
+
+
+ + +[//]: # (====Supported OS and aarch===============================================================) + +`libpointmatcher` is tested on our build system under the following architecture and OS: +- x86 and arm64/v8 +- Ubuntu bionic (18.04) and focal (20.04) + +Note: +- support for Ubuntu jammy (22.04) comming soon +- `libpointmatcher` reportedly works on MacOs OsX (latest) and Windows (latest) + --- +[//]: # (====Release note=========================================================================) + +### ★ Version `1.4.0` release note (important) +This release of _libpointmatcher_ introduces the integration of [norlab-build-system (NBS)](https://github.com/norlab-ulaval/norlab-build-system) as a _git submodule_ for codebase development and testing. + +Execute the following to clone the repository with its submodule: +```shell +git clone --recurse-submodules https://github.com/norlab-ulaval/libpointmatcher.git +``` +If _libpointmatcher_ was previously cloned, execute the following to fetch its new submodule +```shell +git submodule update --remote --recursive --init +``` +[//]: # (====Body=================================================================================) # Documentation and Tutorials libpointmatcher is a modular library implementing the Iterative Closest Point (ICP) algorithm for aligning point clouds. It has applications in robotics and computer vision. -The library is written in C++ for effeciency with [bindings in Python](https://github.com/ethz-asl/libpointmatcher/blob/master/doc/index.md#python-). - -**Quick link for the tutorial pages: [Tutorials](doc/index.md) (also available on [readthedocs.org](http://libpointmatcher.readthedocs.org/)).** +The library is written in C++ for effeciency with [bindings in Python](https://github.com/norlab-ulaval/libpointmatcher/blob/master/doc/index.md#python-). + +**Quick link for the tutorial pages: [Tutorials](doc/index.md)** (also available on [readthedocs.org](http://libpointmatcher.readthedocs.org/) but might not be up-to-date). Those tutorials are written using Markdown syntax and stored in the project's `/doc` folder. Their scope ranges from introductory material on performing point cloud registration to instructions for the more experienced developer on how to extend the library's codebase. Libpointmatcher's source code is fully documented based on doxygen to provide an easy API to developers. An example of this API can be found [here](https://norlab.ulaval.ca/libpointmatcher-doc/), but it is suggested to use the one build for your version in `doc/html`. -libpointmatcher is being developed by [François Pomerleau](mailto:f.pomerleau@gmail.com) and [Stéphane Magnenat](http://stephane.magnenat.net) as part of our work at [ASL-ETH](http://www.asl.ethz.ch). +libpointmatcher was orginaly developed by [François Pomerleau](mailto:f.pomerleau@gmail.com) and [Stéphane Magnenat](http://stephane.magnenat.net) as part of our work at [ASL-ETH](http://www.asl.ethz.ch). +It is now maintained by the Northern Robotics Laboratory ([Norlab](https://norlab.ulaval.ca/)), led by François Pomerleau. You can read the latest changes in the [release notes](doc/ReleaseNotes.md). -# Quick Start + + +# Quick Start Although we suggest to use the [tutorials](doc/index.md), here is a quick version of it: The library has a light dependency list: @@ -37,7 +95,8 @@ and was compiled on: ### Compilation & Installation -For beginner users who are not familiar with compiling and installing a library in Linux, go [here](doc/CompilationUbuntu.md) for detailed instructions on how to compile libpointmatcher from the source code. If you are comfortable with Linux and CMake and have already installed the prerequisites above, the following commands should install libpointmatcher on your system. +For beginner users unfamiliar with compiling and installing a library in Linux, go [here](doc/CompilationUbuntu.md) for detailed instructions on compiling libpointmatcher from the source code. +If you are comfortable with Linux and CMake and have already installed the prerequisites above, the following commands should install libpointmatcher on your system. ```bash mkdir build && cd build @@ -57,21 +116,120 @@ utest/utest --path ../examples/data/ ### Linking to external projects. -We mainly develop for __cmake projects__ and we provide example files under [`examples/demo_cmake/`](https://github.com/ethz-asl/libpointmatcher/tree/master/examples/demo_cmake) to help you in your own project. We also provide a __QT Creator__ example in [`examples/demo_QT/`](https://github.com/ethz-asl/libpointmatcher/tree/master/examples/demo_Qt), which manually list all the dependencies in the file [`demo.pro`](https://github.com/ethz-asl/libpointmatcher/blob/master/examples/demo_Qt/demo.pro). You would need to ajust those paths to point at the appropriate locations on your system. For a more detailled procedure, check the [Linking Projects to libpointmatcher](doc/LinkingProjects.md) section. +We mainly develop for __cmake projects__ and we provide example files under [`examples/demo_cmake/`](https://github.com/norlab-ulaval/libpointmatcher/tree/master/examples/demo_cmake) to help you in your own project. We also provide a __QT Creator__ example in [`examples/demo_QT/`](https://github.com/norlab-ulaval/libpointmatcher/tree/master/examples/demo_Qt), which manually lists all the dependencies in the file [`demo.pro`](https://github.com/norlab-ulaval/libpointmatcher/blob/master/examples/demo_Qt/demo.pro). You would need to ajust those paths to point at the appropriate locations on your system. For a more detailed procedure, check the [Linking Projects to libpointmatcher](doc/LinkingProjects.md) section. +## File formats -### Bug reporting +The library support different file formats for importing or exporting data: -Please use our [github's issue tracker](http://github.com/ethz-asl/libpointmatcher/issues) to report bugs. If you are running the library on Ubuntu, copy-paste the output of the script [listVersionsUbuntu.sh](https://github.com/ethz-asl/libpointmatcher/blob/master/utest/listVersionsUbuntu.sh) to simplify the search of an answer. +* csv (Comma Separated Values) +* vtk (Visualization Toolkit Files) +* ply (Polygon File Format) +* pcd (Point Cloud Library Format) -## File formats -The library support different file formats for importing or exporting data: - * csv (Comma Separated Values) - * vtk (Visualization Toolkit Files) - * ply (Polygon File Format) - * pcd (Point Cloud Library Format) +Those functionnalities are available without increasing the list of dependencies at the expense of +limited functionality support. For more details, see the +tutorial [Importing and Exporting Point Clouds](doc/ImportExport.md). Example executables using +those file formats from the command line can be found in the `/examples` directory and are +described [here](doc/ICPIntro.md) in more detail. + +--- + +# Contributing -Those functionnalities are available without increasing the list of dependencies at the expense of a limited functionality support. For more details, see the tutorial [Importing and Exporting Point Clouds](doc/ImportExport.md). Example executables using those file formats from the command line can be found in the `/examples` directory and are described [here](doc/ICPIntro.md) in more details. +## Bug reporting + +Please use our [github's issue tracker](http://github.com/ethz-asl/libpointmatcher/issues) to report bugs. If you are running the library on Ubuntu, copy-paste the output of the script [listVersionsUbuntu.sh](https://github.com/norlab-ulaval/libpointmatcher/blob/master/utest/listVersionsUbuntu.sh) to simplify the search of an answer. + +## Codebase development + +Libpointmatcher codebase now integrate [norlab-build-system (NBS)](https://github.com/norlab-ulaval/norlab-build-system) and [norlab-shell-script-tools (N2ST)](https://github.com/norlab-ulaval/norlab-shell-script-tools). +`NBS` is a build-infrastructure-agnostic build system custom-made to meet our needs in robotic software engineering at NorLab and `N2ST` is a library of shell script functions as well as a shell testing tools leveraging _**bats-core**_ and _**docker**_ . +`N2ST` purpose is to speed up shell script development and improve reliability. + +`NBS` is deployed on our [TeamCity](https://www.jetbrains.com/teamcity/) continuous integration/deployment server and oversees protected branches of the [libpointmatcher](https://github.com/norlab-ulaval/libpointmatcher) GitHub repository: + +- The `develop` branch can only be merged through a pull-request from any `` branches. Any contributor can submit a pull request to the `develop` branch; +- the `release` branch is a revision and preparation branch where we can freeze the codebase in a given state without stalling to `develop` branch progression; +- The `master` branch can only be merged through a pull-request from the `release` branch. Only repository admin can submit a PR to the `master` branch. + +In any cases, submitting a pull request to `develop` or `master` will trigger a build/test configuration on our build system and the pull request will be granted if the build/test run succeed. + +**Current build matrix:** +`[latest] x [x86, arm64] x [ubuntu] x [bionic, focal] x [Release, RelWithDebInfo, MinSizeRel]` + +### Development workflow + +To speed up the development process, you can run the build system localy on your workstation and have access to stacktrace and build log. +It support multi-OS and multi-architecture through docker container. + +#### Install _libpointmatcher-build-system_ dependencies +```shell +cd + +# If libpointmatcher is already cloned, fetch the NBS and N2ST submodule +git submodule update --remote --recursive --init + +cd ./build_system/lpm_utility_script + +# Execute docker tools install script i.e. docker daemon, docker compose, docker buildx +bash lpm_install_docker_tools.bash + +# Configure a multi-architecture docker builder +bash lpm_create_multiarch_docker_builder.bash +``` + +#### libpointmatcher development › to execute build/test step locally +```shell +cd /build_system + +# Run the build matrix as specified in ".env.build_matrix.libpointmatcher" +# on native architecture using "ci_PR" service +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 +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 focal \ + --fail-fast \ + -- build ci_PR_amd64 ci_PR_arm64v8 + +# Read the help for details +bash lpm_crawl_libpointmatcher_build_matrix.bash --help +``` +Note: To assess the state of the codebase, even for cases that are known the break the build, +execute `lpm_crawl_libpointmatcher_build_matrix.bleeding.bash` with build matrix `.env.build_matrix.libpointmatcher.bleeding`. +The stable build matrix used for release is `.env.build_matrix.libpointmatcher`. + + +#### Build system development +```shell +cd /build_system/tests/ + +# To execute docker dryrun and configuration tests +bash run_all_docker_dryrun_and_config_tests.bash + +# To execute shell script tests +bash run_bats_core_test_in_n2st.bash + +# To spin a container in interactive mode with the codebase cloned but not compiled +cd ./tests_docker_interactive/ +bash build_and_run_IamBuildSystemTester.bash bash +``` + +#### Build system notes: +- `lpm_crawl_dependencies_build_matrix.bash` execute the build matrix for the libpointmatcher dependencies. + It's not required to build them locally as they are pre-build by our TeamCity server periodically push to dockerhub. + When executing `lpm_crawl_libpointmatcher_build_matrix.bash`, the `libpointmatcher-dependencies` docker images are pull and used as base image for the `libpointmatcher-[ci_PR_test|release]` images. +- About `libpointmatcher/.github/workflow/` vs `libpointmatcher/build_system/` logic: Those are separate build logic. + `.github/workflow/` was community contributed and as the responsibilities of building python-binding and pushing packages. + For this reason, it run a one-dimension build matrix: multiple python version, single OS version, single arch (x86) and + single compile flag which GitHub action computing resources can handle just fine. + +--- # Citing @@ -123,11 +281,11 @@ You can download the files in CSV or VTK formats, which are directly supported b If you are using libpointmatcher in your project and you would like to have it listed here, please contact [François Pomerleau](mailto:f.pomerleau@gmail.com). * European Project [NIFTi](http://www.nifti.eu/) (FP7 ICT-247870): Search and rescue project in dynamic environments. Results: [video of multi-floor reconstruction](http://www.youtube.com/watch?v=lP5Mj-TGaiw) and [video of railyard reconstruction](http://www.youtube.com/watch?v=ygIvzWVfPYk). All results with real-time computation. - * NASA Ames [Stereo Pipeline](https://ti.arc.nasa.gov/tech/asr/groups/intelligent-robotics/ngt/stereo/): Planetary reconstruction from satellite observations. Results: used for Mars, Moon and Earth point clouds. + * NASA Ames [Stereo Pipeline](https://ti.arc.nasa.gov/tech/asr/groups/intelligent-robotics/ngt/stereo/): Planetary reconstruction from satellite observations. Results: used for Mars, Moon, and Earth point clouds. * Armasuisse S+T UGV research program [ARTOR](http://www.artor.ethz.ch/): Development of techniques for reliable autonomous navigation of a wheeled robot in rough, outdoor terrain. Results: [video of urban and dynamic 3D reconstruction](http://www.youtube.com/watch?v=UCCAUf64tD0) and [video of open space 3D reconstruction](http://www.youtube.com/watch?v=M5Y99o7um88) with real-time computation. * Swiss National Science Foundation - [Limnobotics](http://www.limnobotics.ch/): Robotic solution for toxic algae monitoring in lacs. Result: [video of 3D shore reconstruction](http://www.youtube.com/watch?v=g8l-Xq4qYeE) with real-time computation. * [CGAL](https://www.cgal.org/) includes our library for their registration pipeline. - * [Norlab](https://norlab.ulaval.ca/) is maintaining and using the library for their research on autonomous navigation in harsh environments. + * [Norlab](https://norlab.ulaval.ca/) is maintaining and using the library for its research on autonomous navigation in harsh environments. * [ANYbotics AG](https://www.anybotics.com) is investigating autonomous navigation algorithms using this library. * [Point Laz Mining LiDAR Expert](https://www.pointlaz.com/) is scanning mine shafts to ensure infrastructure safety. diff --git a/build_system/.env b/build_system/.env index d30c0d3a4..bd79b2a99 100644 --- a/build_system/.env +++ b/build_system/.env @@ -2,26 +2,35 @@ # # Dockerhub or self hosted hub domain name # -LPM_PROJECT_DOCKERHUB=norlabulaval +NBS_DOCKERHUB_NAMESPACE=norlabulaval # # Repository url # # Note: -# - Original repo: https://github.com/ethz-asl/libpointmatcher -# - DEV repo: https://github.com/norlab-ulaval/libpointmatcher-build-system +# - Main repo: https://github.com/norlab-ulaval/libpointmatcher +# - Legacy repo: https://github.com/ethz-asl/libpointmatcher -# ToDo: on repository ownership transfer >> modify next bloc ↓↓ -LPM_LIBPOINTMATCHER_SRC_DOMAIN=ethz-asl -#LPM_LIBPOINTMATCHER_SRC_DOMAIN=norlab-ulaval +NBS_REPOSITORY_DOMAIN=norlab-ulaval -#LPM_LIBPOINTMATCHER_SRC_REPO_NAME=libpointmatcher-build-system # Temporary dev fork -LPM_LIBPOINTMATCHER_SRC_REPO_NAME=libpointmatcher +NBS_REPOSITORY_NAME=libpointmatcher # # Install script variables # -LPM_INSTALLED_LIBRARIES_PATH=/opt/percep3d_libraries +NBS_LIB_INSTALL_PATH=/opt/percep3d_libraries + +# +# Path to the NBS build system directory (.env.build_matrix should be there) +# +NBS_SUPERPROJECT_BUILD_SYSTEM_DIR=./build_system + +# +# NorLab-build-system & NorLab-sheel-script-tools +# +PROJECT_PROMPT_NAME=LPM +NBS_SPLASH_NAME="Libpointmatcher" +NBS_SPLASH_NAME_BUILD_SYSTEM="Libpointmatcher Build System" # # Docker built-in environment variable (do not change the variable name diff --git a/build_system/.env.build_matrix b/build_system/.env.build_matrix deleted file mode 100644 index b75eba850..000000000 --- a/build_system/.env.build_matrix +++ /dev/null @@ -1,43 +0,0 @@ -# -# Build matrix variables -# - -# -# Libpointmatcher version -# -# 'head' is the latest push to the libpointmatcher master branch -#LPM_MATRIX_LIBPOINTMATCHER_VERSIONS=( 'v1.3.1' 'head' 'v2.0.test' ) -LPM_MATRIX_LIBPOINTMATCHER_VERSIONS=( 'head' ) - -# -# Libpointmatcher CMAKE_BUILD_TYPE -# -# Part of the build matrix used for assessing the state of the codebase -# Note: 'None' for building dependencies images -LPM_MATRIX_LIBPOINTMATCHER_CMAKE_BUILD_TYPE_SITREP=( 'Debug' 'Release' 'RelWithDebInfo' 'MinSizeRel' ) -# Part of the build matrix used for PR -LPM_MATRIX_LIBPOINTMATCHER_CMAKE_BUILD_TYPE=( 'Release' 'RelWithDebInfo' 'MinSizeRel' ) - -# -# LIBPOINTMATCHER supported OS -# -# (Priority) ToDo: implement OsX support for arm64-Darwin (ref task NMO-213) -#LPM_MATRIX_SUPPORTED_OS=( 'ubuntu' 'osx' ) -LPM_MATRIX_SUPPORTED_OS=( 'ubuntu' ) - -# -# ubuntu supported versions -# -# Ubuntu release: https://ubuntu.com/about/release-cycle -# bionic=18.04 focal=20.04 jammy=22.04 -# Part of the build matrix used for PR -LPM_MATRIX_UBUNTU_SUPPORTED_VERSIONS_SITREP=( 'bionic' 'focal' 'jammy' ) -# Part of the build matrix used for assessing the state of the codebase -# ToDo: fixme!! (ref task NMO-305 ﹅→ Build fail: ubuntu jammy with utest compilation). -# Mute 'jammy' from the build matrix until then. -LPM_MATRIX_UBUNTU_SUPPORTED_VERSIONS=( 'bionic' 'focal' ) -# -# iceboxed: implement other OS support (ref task NMO-213 OsX arm64-Darwin and NMO-210 OsX x86 CD components) -#LPM_MATRIX_OSX_SUPPORTED_VERSIONS=( 'monterey' 'ventura' ) -LPM_MATRIX_OSX_SUPPORTED_VERSIONS=( ) - diff --git a/build_system/.env.build_matrix.dependencies b/build_system/.env.build_matrix.dependencies new file mode 100644 index 000000000..aa0467157 --- /dev/null +++ b/build_system/.env.build_matrix.dependencies @@ -0,0 +1,42 @@ +# +# Build matrix variables +# + +# +# The compose file on which the build matrix will be crawled +# +NBS_EXECUTE_BUILD_MATRIX_OVER_COMPOSE_FILE=docker-compose.dependencies.yaml + +# +# Libpointmatcher version +# +# 'latest' is the latest push to the libpointmatcher master branch +#NBS_MATRIX_REPOSITORY_VERSIONS=( 'v1.3.1' 'latest' 'v2.0.test' ) +NBS_MATRIX_REPOSITORY_VERSIONS=( 'latest' ) + +# +# Libpointmatcher dependencies CMAKE_BUILD_TYPE +# +# Part of the build matrix used for PR +NBS_MATRIX_CMAKE_BUILD_TYPE=( 'None' ) + +# +# LIBPOINTMATCHER dependencies supported OS +# +# ToDo: implement OsX support for arm64-Darwin (ref task NMO-213) +#NBS_MATRIX_SUPPORTED_OS=( 'ubuntu' 'osx' ) +NBS_MATRIX_SUPPORTED_OS=( 'ubuntu' ) + +# +# ubuntu supported versions +# +# Ubuntu release: https://ubuntu.com/about/release-cycle +# bionic=18.04 focal=20.04 jammy=22.04 +# Part of the build matrix used for PR +#NBS_MATRIX_UBUNTU_SUPPORTED_VERSIONS=( 'bionic' 'focal' ) +NBS_MATRIX_UBUNTU_SUPPORTED_VERSIONS=( 'bionic' 'focal' 'jammy' ) +# +# iceboxed: implement other OS support (ref task NMO-213 OsX arm64-Darwin and NMO-210 OsX x86 CD components) +#NBS_MATRIX_OSX_SUPPORTED_VERSIONS=( 'monterey' 'ventura' ) +NBS_MATRIX_OSX_SUPPORTED_VERSIONS=( ) + diff --git a/build_system/.env.build_matrix.libpointmatcher b/build_system/.env.build_matrix.libpointmatcher new file mode 100644 index 000000000..641b44a2d --- /dev/null +++ b/build_system/.env.build_matrix.libpointmatcher @@ -0,0 +1,40 @@ +# +# Build matrix variables +# + +# +# The compose file on which the build matrix will be crawled +# +NBS_EXECUTE_BUILD_MATRIX_OVER_COMPOSE_FILE=docker-compose.libpointmatcher.yaml + +# +# Libpointmatcher version +# +# 'latest' is the latest push to the libpointmatcher master branch +#NBS_MATRIX_REPOSITORY_VERSIONS=( 'v1.3.1' 'latest' 'v2.0.test' ) +NBS_MATRIX_REPOSITORY_VERSIONS=( 'latest' ) + +# +# Libpointmatcher CMAKE_BUILD_TYPE +# +NBS_MATRIX_CMAKE_BUILD_TYPE=( 'Release' 'RelWithDebInfo' 'MinSizeRel' ) +# Note: 'None' for building dependencies images + +# +# LIBPOINTMATCHER supported OS +# +# ToDo: implement OsX support for arm64-Darwin (ref task NMO-213) +#NBS_MATRIX_SUPPORTED_OS=( 'ubuntu' 'l4t' 'osx' ) +NBS_MATRIX_SUPPORTED_OS=( 'ubuntu' ) + +# +# ubuntu supported versions +# +# Ubuntu release: https://ubuntu.com/about/release-cycle +# bionic=18.04 focal=20.04 jammy=22.04 +NBS_MATRIX_UBUNTU_SUPPORTED_VERSIONS=( 'bionic' 'focal' ) +# +# iceboxed: implement other OS support (ref task NMO-213 OsX arm64-Darwin and NMO-210 OsX x86 CD components) +#NBS_MATRIX_OSX_SUPPORTED_VERSIONS=( 'monterey' 'ventura' ) +NBS_MATRIX_OSX_SUPPORTED_VERSIONS=( ) + diff --git a/build_system/.env.build_matrix.libpointmatcher.bleeding b/build_system/.env.build_matrix.libpointmatcher.bleeding new file mode 100644 index 000000000..23de9f20e --- /dev/null +++ b/build_system/.env.build_matrix.libpointmatcher.bleeding @@ -0,0 +1,42 @@ +# +# Build matrix variables +# + +# +# The compose file on which the build matrix will be crawled +# +NBS_EXECUTE_BUILD_MATRIX_OVER_COMPOSE_FILE=docker-compose.libpointmatcher.yaml + +# +# Libpointmatcher version +# +# 'latest' is the latest push to the libpointmatcher master branch +#NBS_MATRIX_REPOSITORY_VERSIONS=( 'v1.3.1' 'latest' 'v2.0.test' ) +NBS_MATRIX_REPOSITORY_VERSIONS=( 'latest' ) + +# +# Libpointmatcher CMAKE_BUILD_TYPE +# +NBS_MATRIX_CMAKE_BUILD_TYPE=( 'Debug' 'Release' 'RelWithDebInfo' 'MinSizeRel' ) +# ToDo: fixme!! (ref task NMO-306 ﹅→ Test fail › install script flag `--cmake-build-type Debug --compile-test` and for all distro) +# Note: 'None' for building dependencies images + +# +# LIBPOINTMATCHER supported OS +# +# ToDo: implement OsX support for arm64-Darwin (ref task NMO-213) +#NBS_MATRIX_SUPPORTED_OS=( 'ubuntu' 'l4t' 'osx' ) +NBS_MATRIX_SUPPORTED_OS=( 'ubuntu' ) + +# +# ubuntu supported versions +# +# Ubuntu release: https://ubuntu.com/about/release-cycle +# bionic=18.04 focal=20.04 jammy=22.04 +NBS_MATRIX_UBUNTU_SUPPORTED_VERSIONS=( 'bionic' 'focal' 'jammy' ) +# ToDo: fixme!! (ref task NMO-305 ﹅→ Build fail: ubuntu jammy with utest compilation). +# +# iceboxed: implement other OS support (ref task NMO-213 OsX arm64-Darwin and NMO-210 OsX x86 CD components) +#NBS_MATRIX_OSX_SUPPORTED_VERSIONS=( 'monterey' 'ventura' ) +NBS_MATRIX_OSX_SUPPORTED_VERSIONS=( ) + diff --git a/build_system/.env.prompt b/build_system/.env.prompt deleted file mode 100644 index b4a01d917..000000000 --- a/build_system/.env.prompt +++ /dev/null @@ -1,73 +0,0 @@ - -# (NICE TO HAVE) ToDo: refactor (ref task NMO-304 ♻︎ → Refactor .env.prompt variables prefixed by LPM_ to MSG_) -LPM_PROMPT_NAME="LPM" -LPM_SPLASH_NAME="Libpoinmatcher" -LPM_BUILD_SYSTEM_SPLASH_NAME="Libpoinmatcher Build System" - -LPM_LINE_CHAR_BUILDER_LVL1='▉' -LPM_LINE_CHAR_BUILDER_LVL2='⣿' -LPM_LINE_CHAR_INSTALLER=':' -LPM_LINE_CHAR_UTIL='.' -LPM_LINE_CHAR_TEST=' ' - -# -# Formating environment variables -# -# Note on usage: -# echo -e "${MSG_WARNING} Watchout dude!" -# -# echo -e "${MSG_DIMMED_FORMAT} Hello:" -# echo -e " bklabla bla blaabla" -# echo -e "${MSG_END_FORMAT}" -# - -# -# Terminal print version -# -#MSG_EMPH_FORMAT="\033[0;37m" -MSG_EMPH_FORMAT="\033[1;97m" -MSG_DIMMED_FORMAT="\033[1;2m" -MSG_BASE_FORMAT="\033[1m" -MSG_ERROR_FORMAT="\033[1;31m" -MSG_DONE_FORMAT="\033[1;32m" -MSG_WARNING_FORMAT="\033[1;33m" -MSG_END_FORMAT="\033[0m" - -MSG_AWAITING_INPUT="${MSG_BASE_FORMAT}[${LPM_PROMPT_NAME} awaiting input]${MSG_END_FORMAT}" -MSG_BASE="${MSG_BASE_FORMAT}[${LPM_PROMPT_NAME}]${MSG_END_FORMAT}" -#MSG_DONE="\033[1;32m[${LPM_PROMPT_NAME} done]${MSG_END_FORMAT}" -MSG_DONE="${MSG_DONE_FORMAT}[${LPM_PROMPT_NAME} done]${MSG_END_FORMAT}" -MSG_WARNING="${MSG_WARNING_FORMAT}[${LPM_PROMPT_NAME} warning]${MSG_END_FORMAT}" -MSG_ERROR="${MSG_ERROR_FORMAT}[${LPM_PROMPT_NAME} error]${MSG_END_FORMAT}" - -# -# TeamCity service message version -# -MSG_DIMMED_FORMAT_TEAMCITY="|[1;2m" -MSG_BASE_FORMAT_TEAMCITY="|[1m" -MSG_ERROR_FORMAT_TEAMCITY="|[1;31m" -MSG_WARNING_FORMAT_TEAMCITY="|[1;33m" -#MSG_LPM_STEP_FORMAT_TEAMCITY="|[1;104m" -MSG_LPM_STEP_FORMAT_TEAMCITY="|[30;107m" -MSG_END_FORMAT_TEAMCITY="|[0m" - -# (!) Note: substitution fail in the TeamCity Overview tab when using -# >>> MSG_BASE_TEAMCITY="${MSG_BASE_FORMAT_TEAMCITY}|[${LPM_PROMPT_NAME}|]${MSG_END_FORMAT_TEAMCITY}" -MSG_BASE_TEAMCITY="|[${LPM_PROMPT_NAME}|]" - -# -# References: -# - Bash tips: Colors and formatting (ANSI/VT100 Control sequences): -# https://misc.flogisoft.com/bash/tip_colors_and_formatting#bash_tipscolors_and_formatting_ansivt100_control_sequences -# - ASCII art generated using image generator at https://asciiart.club -# -# Foreground colors -# - 2=Dim -# - 37=light gray -# - 90=dark gray -# - 30=black -# - 97=white -# Formatting -# - 1=Bold/bright -# - 2=Dim -# - 4=underline diff --git "a/build_system/.jetbrains_run_config/(HELP) bash libpointmatcher_installer.bash \342\200\272 --help menu.run.xml" "b/build_system/.jetbrains_run_config/(HELP) bash libpointmatcher_installer.bash \342\200\272 --help menu.run.xml" new file mode 100644 index 000000000..7365e814e --- /dev/null +++ "b/build_system/.jetbrains_run_config/(HELP) bash libpointmatcher_installer.bash \342\200\272 --help menu.run.xml" @@ -0,0 +1,19 @@ + + + + \ No newline at end of file diff --git "a/build_system/.jetbrains_run_config/(HELP) bash lpm_execute_compose._ \342\200\272 --help menu.run.xml" "b/build_system/.jetbrains_run_config/(HELP) bash lpm_execute_compose._ \342\200\272 --help menu.run.xml" new file mode 100644 index 000000000..ce856bdcf --- /dev/null +++ "b/build_system/.jetbrains_run_config/(HELP) bash lpm_execute_compose._ \342\200\272 --help menu.run.xml" @@ -0,0 +1,19 @@ + + + + \ No newline at end of file diff --git "a/build_system/.jetbrains_run_config/(HELP) bash lpm_install_libpointmatcher_ubuntu.bash \342\200\272 --help menu.run.xml" "b/build_system/.jetbrains_run_config/(HELP) bash lpm_install_libpointmatcher_ubuntu.bash \342\200\272 --help menu.run.xml" new file mode 100644 index 000000000..c77498dc2 --- /dev/null +++ "b/build_system/.jetbrains_run_config/(HELP) bash lpm_install_libpointmatcher_ubuntu.bash \342\200\272 --help menu.run.xml" @@ -0,0 +1,19 @@ + + + + \ No newline at end of file diff --git a/build_system/.jetbrains_run_config/LPM _ run_all_docker_dryrun_and_config_tests.bash.run.xml b/build_system/.jetbrains_run_config/LPM _ run_all_docker_dryrun_and_config_tests.bash.run.xml new file mode 100644 index 000000000..f71ab5bee --- /dev/null +++ b/build_system/.jetbrains_run_config/LPM _ run_all_docker_dryrun_and_config_tests.bash.run.xml @@ -0,0 +1,19 @@ + + + + \ No newline at end of file diff --git a/build_system/.jetbrains_run_config/[LPM] run all bats tests.run.xml b/build_system/.jetbrains_run_config/[LPM] run all bats tests.run.xml new file mode 100644 index 000000000..c976ae387 --- /dev/null +++ b/build_system/.jetbrains_run_config/[LPM] run all bats tests.run.xml @@ -0,0 +1,19 @@ + + + + \ 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 _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" new file mode 100644 index 000000000..35bfd93e6 --- /dev/null +++ "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build _service_ _popup_.run.xml" @@ -0,0 +1,19 @@ + + + + \ 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" new file mode 100644 index 000000000..fd730d73c --- /dev/null +++ "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" @@ -0,0 +1,19 @@ + + + + \ 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-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" new file mode 100644 index 000000000..3caec4cd5 --- /dev/null +++ "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" @@ -0,0 +1,19 @@ + + + + \ 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 test_compilation__ (Release).run.xml" "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build test_compilation__ (Release).run.xml" new file mode 100644 index 000000000..689496302 --- /dev/null +++ "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build test_compilation__ (Release).run.xml" @@ -0,0 +1,19 @@ + + + + \ 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 test_compilation_prefixed_path (BUILD MATRIX SUBSET).run.xml" "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build test_compilation_prefixed_path (BUILD MATRIX SUBSET).run.xml" new file mode 100644 index 000000000..cc0fb90f0 --- /dev/null +++ "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build test_compilation_prefixed_path (BUILD MATRIX SUBSET).run.xml" @@ -0,0 +1,19 @@ + + + + \ 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&push dependencies-general dependencies (AS IN TC).run.xml" "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build&push dependencies-general dependencies (AS IN TC).run.xml" new file mode 100644 index 000000000..bf5e3c732 --- /dev/null +++ "b/build_system/.jetbrains_run_config/bash lpm_execute_compose_over_build_matrix.bash \342\200\272 build&push dependencies-general dependencies (AS IN TC).run.xml" @@ -0,0 +1,19 @@ + + + + \ No newline at end of file diff --git a/build_system/.jetbrains_run_config/cwd tree + docker system disk usage.run.xml b/build_system/.jetbrains_run_config/cwd tree + docker system disk usage.run.xml new file mode 100644 index 000000000..7f122a19f --- /dev/null +++ b/build_system/.jetbrains_run_config/cwd tree + docker system disk usage.run.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/build_system/.jetbrains_run_config/interactive.run.xml b/build_system/.jetbrains_run_config/interactive.run.xml new file mode 100644 index 000000000..c0b9238ce --- /dev/null +++ b/build_system/.jetbrains_run_config/interactive.run.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/build_system/.jetbrains_run_config/list docker images + container.run.xml b/build_system/.jetbrains_run_config/list docker images + container.run.xml new file mode 100644 index 000000000..872f1bdfc --- /dev/null +++ b/build_system/.jetbrains_run_config/list docker images + container.run.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git "a/build_system/.jetbrains_run_config/lpm_execute_compose_over_build_matrix.bash \342\200\272 test flag (popup).run.xml" "b/build_system/.jetbrains_run_config/lpm_execute_compose_over_build_matrix.bash \342\200\272 test flag (popup).run.xml" new file mode 100644 index 000000000..9e0115490 --- /dev/null +++ "b/build_system/.jetbrains_run_config/lpm_execute_compose_over_build_matrix.bash \342\200\272 test flag (popup).run.xml" @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/build_system/.jetbrains_run_config/run and open a terminal in a Ubuntu 20.04 container.run.xml b/build_system/.jetbrains_run_config/run and open a terminal in a Ubuntu 20.04 container.run.xml new file mode 100644 index 000000000..6f3419b45 --- /dev/null +++ b/build_system/.jetbrains_run_config/run and open a terminal in a Ubuntu 20.04 container.run.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/build_system/.jetbrains_run_config/test_execute_compose_over_build_matrix.bash.run.xml b/build_system/.jetbrains_run_config/test_execute_compose_over_build_matrix.bash.run.xml new file mode 100644 index 000000000..33946fed6 --- /dev/null +++ b/build_system/.jetbrains_run_config/test_execute_compose_over_build_matrix.bash.run.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/build_system/.jetbrains_run_config/test_execute_compose_over_build_matrix_with_flag.bash.run.xml b/build_system/.jetbrains_run_config/test_execute_compose_over_build_matrix_with_flag.bash.run.xml new file mode 100644 index 000000000..2c8ac9f77 --- /dev/null +++ b/build_system/.jetbrains_run_config/test_execute_compose_over_build_matrix_with_flag.bash.run.xml @@ -0,0 +1,17 @@ + + + + \ No newline at end of file diff --git a/build_system/README.md b/build_system/README.md new file mode 100644 index 000000000..58514a982 --- /dev/null +++ b/build_system/README.md @@ -0,0 +1 @@ +See [README.md #Contributing](https://github.com/norlab-ulaval/libpointmatcher/tree/master#contributing) for instructions on how integrate the `libpointmatcher-build-system` to your local development workflow (on your workstation). diff --git a/build_system/docker-compose.dependencies.yaml b/build_system/docker-compose.dependencies.yaml new file mode 100644 index 000000000..e671ed104 --- /dev/null +++ b/build_system/docker-compose.dependencies.yaml @@ -0,0 +1,48 @@ +services: + + # ====Dependency related services================================================================ + dependencies-general: + image: ${NBS_DOCKERHUB_NAMESPACE:?err}/libpointmatcher-dependencies-general:${NBS_IMAGE_TAG:?err} + build: + target: libpointmatcher-dependencies-general + context: .. + dockerfile: ${NBS_SUPERPROJECT_BUILD_SYSTEM_DIR:?err}/ubuntu/Dockerfile.dependencies + platforms: + - "linux/amd64" + - "linux/arm64/v8" + args: + BASE_IMAGE: ${DEPENDENCIES_BASE_IMAGE:?err} + BASE_IMAGE_TAG: ${DEPENDENCIES_BASE_IMAGE_TAG:?err} + NBS_SUPERPROJECT_BUILD_SYSTEM_DIR: ${NBS_SUPERPROJECT_BUILD_SYSTEM_DIR:?err} + IS_TEAMCITY_RUN: ${IS_TEAMCITY_RUN} + NBS_LIB_INSTALL_PATH: ${NBS_LIB_INSTALL_PATH:?err} + NBS_REPOSITORY_NAME: ${NBS_REPOSITORY_NAME:?err} + tty: true + stdin_open: true + init: true # Propagate exit code (See remark in task NMO-266) + + dependencies: + extends: dependencies-general + image: ${NBS_DOCKERHUB_NAMESPACE:?err}/libpointmatcher-dependencies:${NBS_IMAGE_TAG:?err} + build: + target: libpointmatcher-dependencies-libnabo + depends_on: + - dependencies-general + + dependencies-doc: + image: ${NBS_DOCKERHUB_NAMESPACE:?err}/libpointmatcher-dependencies-doc:${NBS_IMAGE_TAG:?err} + build: + context: .. + dockerfile: ${NBS_SUPERPROJECT_BUILD_SYSTEM_DIR:?err}/ubuntu/Dockerfile.dependencies.doxygen + platforms: + - "linux/amd64" + - "linux/arm64/v8" + args: + PROJECT_HUB: ${NBS_DOCKERHUB_NAMESPACE} + BASE_IMAGE: libpointmatcher-dependencies + BASE_IMAGE_TAG: ${NBS_IMAGE_TAG} + IS_TEAMCITY_RUN: ${IS_TEAMCITY_RUN} + depends_on: + - dependencies + tty: true + stdin_open: true diff --git a/build_system/docker-compose.libpointmatcher.yaml b/build_system/docker-compose.libpointmatcher.yaml index befe24879..743851733 100644 --- a/build_system/docker-compose.libpointmatcher.yaml +++ b/build_system/docker-compose.libpointmatcher.yaml @@ -1,110 +1,99 @@ +include: + - docker-compose.dependencies.yaml + services: - # ====Dependency related services=================================================================================== - dependencies: - image: ${LPM_PROJECT_DOCKERHUB:?err}/libpointmatcher-dependencies:${LPM_IMAGE_TAG:?err} + # ====Pull-request related services============================================================== + # ....Test logic related to libpointmatcher install casses....................................... + _test_compilation: + image: ${NBS_DOCKERHUB_NAMESPACE:?err}/libpointmatcher-compilation-test:${NBS_IMAGE_TAG:?err} + pull_policy: build build: context: .. - dockerfile: ./build_system/ubuntu/Dockerfile.dependencies - platforms: - - "linux/amd64" - - "linux/arm64/v8" + dockerfile: ${NBS_SUPERPROJECT_BUILD_SYSTEM_DIR:?err}/ubuntu/Dockerfile.libpointmatcher.compilation_test + no_cache: true + target: test-compilation-auto-path-resolution + ## Mute 'platforms' while using arch virtualization with C++ build to prevent segmentation fault during lpm cmake install +# platforms: +# - "linux/amd64" +# - "linux/arm64/v8" args: - BASE_IMAGE: ${DEPENDENCIES_BASE_IMAGE:?err} - BASE_IMAGE_TAG: ${DEPENDENCIES_BASE_IMAGE_TAG:?err} + PROJECT_HUB: ${NBS_DOCKERHUB_NAMESPACE} + BASE_IMAGE: libpointmatcher-dependencies-general + BASE_IMAGE_TAG: ${NBS_IMAGE_TAG} IS_TEAMCITY_RUN: ${IS_TEAMCITY_RUN} - LPM_INSTALLED_LIBRARIES_PATH: ${LPM_INSTALLED_LIBRARIES_PATH:?err} - LPM_LIBPOINTMATCHER_SRC_REPO_NAME: ${LPM_LIBPOINTMATCHER_SRC_REPO_NAME:?err} + REPOSITORY_VERSION: 'latest' + CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE:?err} + INSTALL_SCRIPT_FLAG: '--build-system-CI-install' tty: true stdin_open: true init: true # Propagate exit code (See remark in task NMO-266) - dependencies-doc: - image: ${LPM_PROJECT_DOCKERHUB:?err}/libpointmatcher-dependencies-doc:${LPM_IMAGE_TAG:?err} + depends_on: + - dependencies-general + test_compilation_prefixed_path: + extends: _test_compilation build: - context: .. - dockerfile: ./build_system/ubuntu/Dockerfile.dependencies_doc - platforms: - - "linux/amd64" - - "linux/arm64/v8" - args: - PROJECT_HUB: ${LPM_PROJECT_DOCKERHUB} - BASE_IMAGE: libpointmatcher-dependencies - BASE_IMAGE_TAG: ${LPM_IMAGE_TAG} - IS_TEAMCITY_RUN: ${IS_TEAMCITY_RUN} - tty: true - stdin_open: true + target: test-compilation-prefixed-path + depends_on: + - _test_compilation + test_compilation_auto_path_resolution: + extends: _test_compilation + build: + target: test-compilation-auto-path-resolution + depends_on: + - _test_compilation - # ====Pull-request related services================================================================================ + # ....Test logic related to libpointmatcher codebase unit-test................................... ci_PR: - image: ${LPM_PROJECT_DOCKERHUB:?err}/libpointmatcher-ci-pr:${LPM_IMAGE_TAG:?err} + image: ${NBS_DOCKERHUB_NAMESPACE:?err}/libpointmatcher-ci-pr:${NBS_IMAGE_TAG:?err} pull_policy: build build: context: .. - dockerfile: './build_system/ubuntu/Dockerfile.libpointmatcher_ci_PR' + dockerfile: ${NBS_SUPERPROJECT_BUILD_SYSTEM_DIR}/ubuntu/Dockerfile.libpointmatcher.ci_PR no_cache: true args: - PROJECT_HUB: ${LPM_PROJECT_DOCKERHUB} + PROJECT_HUB: ${NBS_DOCKERHUB_NAMESPACE} BASE_IMAGE: libpointmatcher-dependencies - BASE_IMAGE_TAG: ${LPM_IMAGE_TAG} + BASE_IMAGE_TAG: ${NBS_IMAGE_TAG} IS_TEAMCITY_RUN: ${IS_TEAMCITY_RUN} - LIBPOINTMATCHER_VERSION: 'head' - LIBPOINTMATCHER_CMAKE_BUILD_TYPE: ${LIBPOINTMATCHER_CMAKE_BUILD_TYPE:?err} - LIBPOINTMATCHER_INSTALL_SCRIPT_FLAG: '--build-system-CI-install --compile-test' + REPOSITORY_VERSION: 'latest' + CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE:?err} + INSTALL_SCRIPT_FLAG: '--build-system-CI-install --compile-test' tty: true stdin_open: true init: true # Propagate exit code (See remark in task NMO-266) + depends_on: + - dependencies ci_PR_amd64: extends: ci_PR - platform: "linux/amd64" + build: + platforms: + - "linux/amd64" ci_PR_arm64v8: extends: ci_PR - platform: "linux/arm64/v8" - - # ====Build system assessment services============================================================================== - ci_SITREP_matrix: - image: ${LPM_PROJECT_DOCKERHUB:?err}/libpointmatcher-ci-sitrep-matrix:${LPM_IMAGE_TAG:?err} - pull_policy: build build: - context: .. - dockerfile: './build_system/ubuntu/Dockerfile.libpointmatcher_ci_SITREP_matrix' - no_cache: true - args: - PROJECT_HUB: ${LPM_PROJECT_DOCKERHUB} - BASE_IMAGE: libpointmatcher-dependencies - BASE_IMAGE_TAG: ${LPM_IMAGE_TAG} - IS_TEAMCITY_RUN: ${IS_TEAMCITY_RUN} - LIBPOINTMATCHER_VERSION: ${LIBPOINTMATCHER_VERSION:?err} - LIBPOINTMATCHER_CMAKE_BUILD_TYPE: ${LIBPOINTMATCHER_CMAKE_BUILD_TYPE:?err} - LIBPOINTMATCHER_INSTALL_SCRIPT_FLAG: '--compile-test' - tty: true - stdin_open: true - init: true # Propagate exit code (See remark in task NMO-266) - ci_SITREP_matrix_amd64: - extends: ci_SITREP_matrix - platform: "linux/amd64" - ci_SITREP_matrix_arm64v8: - extends: ci_SITREP_matrix - platform: "linux/arm64/v8" + platforms: + - "linux/arm64/v8" - # ====Dockerhub release image====================================================================================== + # ====Dockerhub release image==================================================================== release: - image: ${LPM_PROJECT_DOCKERHUB:?err}/libpointmatcher:${LPM_IMAGE_TAG:?err} + image: ${NBS_DOCKERHUB_NAMESPACE:?err}/libpointmatcher:${NBS_IMAGE_TAG:?err} container_name: libpointmatcher build: context: .. - dockerfile: ./build_system/ubuntu/Dockerfile.libpointmatcher + dockerfile: ${NBS_SUPERPROJECT_BUILD_SYSTEM_DIR}/ubuntu/Dockerfile.libpointmatcher.hub_release platforms: - "linux/amd64" - "linux/arm64/v8" no_cache: true args: - PROJECT_HUB: ${LPM_PROJECT_DOCKERHUB} + PROJECT_HUB: ${NBS_DOCKERHUB_NAMESPACE} BASE_IMAGE: libpointmatcher-dependencies-doc - BASE_IMAGE_TAG: ${LPM_IMAGE_TAG} + BASE_IMAGE_TAG: ${NBS_IMAGE_TAG} IS_TEAMCITY_RUN: ${IS_TEAMCITY_RUN} - LIBPOINTMATCHER_VERSION: ${LIBPOINTMATCHER_VERSION:?err} - LIBPOINTMATCHER_CMAKE_BUILD_TYPE: 'Release' - LIBPOINTMATCHER_INSTALL_SCRIPT_FLAG: '--compile-test --generate-doc' + REPOSITORY_VERSION: ${REPOSITORY_VERSION:?err} + CMAKE_BUILD_TYPE: 'Release' + INSTALL_SCRIPT_FLAG: '--compile-test --generate-doc' tty: true stdin_open: true init: true # Propagate exit code (See remark in task NMO-266) diff --git a/build_system/function_library/general_utilities.bash b/build_system/function_library/general_utilities.bash deleted file mode 100644 index aabc0d4d9..000000000 --- a/build_system/function_library/general_utilities.bash +++ /dev/null @@ -1,170 +0,0 @@ -#!/bin/bash -# -# General purpose function library -# -# Requirement: This script must be sourced from directory 'build_system' -# -# usage: -# $ source ./function_library/general_utilities.bash -# - -# ....Pre-condition................................................................................................ -if [[ "$(basename $(pwd))" != "build_system" ]]; then - echo -e "\nERROR: This script must be sourced from directory 'build_system'!\n cwd: $(pwd)" - exit 1 -fi - -# ....Project root logic........................................................................................... -TMP_CWD=$(pwd) - -# ....Load environment variables from file......................................................................... -set -o allexport -source .env -source .env.prompt -set +o allexport - -# ....Load helper function......................................................................................... -## import shell functions from Libpointmatcher-build-system utilities library -source ./function_library/prompt_utilities.bash - -# ================================================================================================================= -# Show docker command and execute it. Just enclose the command with argument in quote. -# -# Usage: -# $ show_and_execute_docker "" -# -# Example usage: -# $ show_and_execute_docker "run --name IamBuildSystemTester -t -i --rm lpm.ubuntu20.buildsystem.test" -# -# Returns: -# Return docker command exit code -# ================================================================================================================= -function show_and_execute_docker() { - local FULL_DOCKER_COMMAND=$1 - unset DOCKER_EXIT_CODE - - if [ -f /.dockerenv ]; then - echo - print_msg_warning "Skipping the execution of Docker command\n - ${MSG_DIMMED_FORMAT}$ docker ${FULL_DOCKER_COMMAND}${MSG_END_FORMAT}\n\nsince the script is executed inside a docker container ... and starting Docker daemon inside a container is complicated to setup and overkill for our testing case." - else - print_msg "Execute command ${MSG_DIMMED_FORMAT}$ docker ${FULL_DOCKER_COMMAND}${MSG_END_FORMAT}" - - - - # shellcheck disable=SC2086 - docker ${FULL_DOCKER_COMMAND} - DOCKER_EXIT_CODE=$? - export DOCKER_EXIT_CODE - - SUCCESS_MSG="Command ${MSG_DIMMED_FORMAT}$ docker ${FULL_DOCKER_COMMAND}${MSG_END_FORMAT} completed successfully and exited docker." - FAILURE_MSG="Command ${MSG_DIMMED_FORMAT}$ docker ${FULL_DOCKER_COMMAND}${MSG_END_FORMAT} exited with error (DOCKER_EXIT_CODE=${DOCKER_EXIT_CODE})!" - - if [[ ${DOCKER_EXIT_CODE} == 0 ]]; then - if [[ ${IS_TEAMCITY_RUN} == true ]]; then - # Report message to build log - echo -e "##teamcity[message text='${MSG_BASE_TEAMCITY} ${SUCCESS_MSG}' status='NORMAL']" - else - print_msg_done "${SUCCESS_MSG}" - fi - else - if [[ ${IS_TEAMCITY_RUN} == true ]]; then - # Report message to build log - echo -e "##teamcity[message text='${MSG_BASE_TEAMCITY} ${FAILURE_MSG}' errorDetails='$DOCKER_EXIT_CODE' status='ERROR']" - else - print_msg_error "${FAILURE_MSG}" - fi - fi - - fi -} - -# ================================================================================================================= -# Send TeamCity blockOpened/blockClosed service message -# or print the message to console when executed outside a TeamCity Agent run. -# -# Usage: -# $ teamcity_service_msg_blockOpened "" -# $ ... many steps ... -# $ teamcity_service_msg_blockClosed -# -# Globals: -# Read 'IS_TEAMCITY_RUN' -# Read|write 'CURRENT_BLOCK_SERVICE_MSG' -# Outputs: -# Output either -# - a TeamCity blockOpened/blockClosed service message -# - or print to console -# - or an error if teamcity_service_msg_blockOpened is not closed using teamcity_service_msg_blockClosed -# -# Reference: -# - TeamCity doc: https://www.jetbrains.com/help/teamcity/service-messages.html#Blocks+of+Service+Messages -# -# ================================================================================================================= -function teamcity_service_msg_blockOpened() { - local THE_MSG=$1 - if [[ ${CURRENT_BLOCK_SERVICE_MSG} ]]; then - print_msg_error_and_exit "The TeamCity bloc service message ${MSG_DIMMED_FORMAT}${CURRENT_BLOCK_SERVICE_MSG}${MSG_END_FORMAT} was not closed using function ${MSG_DIMMED_FORMAT}teamcity_service_msg_blockClosed${MSG_END_FORMAT}." - else - export CURRENT_BLOCK_SERVICE_MSG="${THE_MSG}" - fi - - if [[ ${IS_TEAMCITY_RUN} == true ]]; then - echo -e "##teamcity[blockOpened name='${MSG_BASE_TEAMCITY} ${THE_MSG}']" - else - echo && print_msg "${THE_MSG}" && echo - fi -} - -function teamcity_service_msg_blockClosed() { - if [[ ${IS_TEAMCITY_RUN} == true ]]; then - echo -e "##teamcity[blockClosed name='${MSG_BASE_TEAMCITY} ${CURRENT_BLOCK_SERVICE_MSG}']" - fi - # Reset the variable since the bloc is closed - unset CURRENT_BLOCK_SERVICE_MSG -} - -# ================================================================================================================= -# Send TeamCity compilationStarted/compilationFinished service message -# or print the message to console when executed outside a TeamCity Agent run. -# -# Usage: -# $ teamcity_service_msg_compilationStarted "" -# $ ... many compilation steps ... -# $ teamcity_service_msg_compilationFinished -# -# Globals: -# Read 'IS_TEAMCITY_RUN' -# Read|write 'CURRENT_COMPILATION_SERVICE_MSG_COMPILER' -# Outputs: -# Output either -# - a TeamCity compilationStarted/compilationFinished service message -# - or print to console -# - or an error if teamcity_service_msg_compilationStarted is not closed using teamcity_service_msg_compilationFinished -# -# Reference: -# - TeamCity doc: https://www.jetbrains.com/help/teamcity/service-messages.html#Reporting+Compilation+Messages -# -# ================================================================================================================= -function teamcity_service_msg_compilationStarted() { - local THE_MSG=$1 - if [[ ${CURRENT_COMPILATION_SERVICE_MSG_COMPILER} ]]; then - print_msg_error_and_exit "The TeamCity compilation service message ${MSG_DIMMED_FORMAT}${CURRENT_COMPILATION_SERVICE_MSG_COMPILER}${MSG_END_FORMAT} was not closed using function ${MSG_DIMMED_FORMAT}teamcity_service_msg_compilationFinished${MSG_END_FORMAT}." - else - export CURRENT_COMPILATION_SERVICE_MSG_COMPILER="${THE_MSG}" - fi - - if [[ ${IS_TEAMCITY_RUN} == true ]]; then - echo -e "##teamcity[compilationStarted compiler='${MSG_BASE_TEAMCITY} ${THE_MSG}']" - else - echo && print_msg "${THE_MSG}" && echo - fi -} - -function teamcity_service_msg_compilationFinished() { - if [[ ${IS_TEAMCITY_RUN} == true ]]; then - echo -e "##teamcity[compilationFinished compiler='${MSG_BASE_TEAMCITY} ${CURRENT_COMPILATION_SERVICE_MSG_COMPILER}']" - fi - # Reset the variable since the bloc is closed - unset CURRENT_COMPILATION_SERVICE_MSG_COMPILER -} diff --git a/build_system/function_library/prompt_utilities.bash b/build_system/function_library/prompt_utilities.bash deleted file mode 100644 index be296574a..000000000 --- a/build_system/function_library/prompt_utilities.bash +++ /dev/null @@ -1,243 +0,0 @@ -#!/bin/bash -# -# Library of function related to console formatting -# -# Requirement: This script must be sourced from directory 'build_system' -# -# Usage: -# $ source ./function_library/prompt_utilities.bash -# - -# ....Pre-condition................................................................................................ -if [[ "$(basename $(pwd))" != "build_system" ]]; then - echo -e "\nERROR: This script must be sourced from directory 'build_system'!\n cwd: $(pwd)" - exit 1 -fi - -# ....Load environment variables from file......................................................................... -set -o allexport -source .env -source .env.prompt -set +o allexport - - -# ================================================================================================================= -# Print formatted message to prompt -# -# Usage: -# $ _print_msg "" "" -# -# Arguments: -# The message type: "BASE", "DONE", "WARNING", "AWAITING_INPUT" -# The message string -# Outputs: -# The formated message to stdout -# Returns: -# none -# ================================================================================================================= -function _print_msg_formater() { - local MSG_TYPE=${1} - local MSG=${2} - - - if [[ "${MSG_TYPE}" == "BASE" ]]; then - MSG_TYPE=${MSG_BASE} - elif [[ "${MSG_TYPE}" == "DONE" ]]; then - MSG_TYPE=${MSG_DONE} - elif [[ "${MSG_TYPE}" == "WARNING" ]]; then - MSG_TYPE=${MSG_WARNING} - elif [[ "${MSG_TYPE}" == "AWAITING_INPUT" ]]; then - MSG_TYPE=${MSG_AWAITING_INPUT} - else - echo "from ${FUNCNAME[1]} › ${FUNCNAME[0]}: Unrecognized msg type '${MSG_TYPE}' (!)" - exit 1 - fi - -# echo "" - echo -e "${MSG_TYPE} ${MSG}" -# echo "" -} - -function print_msg() { - local MSG=${1} - _print_msg_formater "BASE" "${MSG}" -} -function print_msg_done() { - local MSG=${1} - _print_msg_formater "DONE" "${MSG}" -} -function print_msg_warning() { - local MSG=${1} - _print_msg_formater "WARNING" "${MSG}" -} -function print_msg_awaiting_input() { - local MSG=${1} - _print_msg_formater "AWAITING_INPUT" "${MSG}" -} - -# ================================================================================================================= -# Print formatted error message to prompt -# -# Usage: -# $ print_msg_error_and_exit "" -# or -# $ print_msg_error "" -# -# Globals: -# Read 'TMP_CWD': Required to be set prior to function usage. eg: TMP_CWD=$(pwd) -# Arguments: -# The error message to print -# Outputs: -# The formatted error message to to stderr -# Returns: -# none -# ================================================================================================================= -function print_msg_error_and_exit() { - local ERROR_MSG=$1 - - echo "" - echo -e "${MSG_ERROR}: ${ERROR_MSG}" >&2 - # Note: The >&2 sends the echo output to standard error - echo "Exiting now." - echo "" - cd "${TMP_CWD}" - exit 1 -} - -function print_msg_error() { - local ERROR_MSG=$1 - - echo "" - echo -e "${MSG_ERROR}: ${ERROR_MSG}" >&2 - echo "" -} - - -# ================================================================================================================= -# Draw horizontal line the entire width of the terminal -# Source: https://web.archive.org/web/20230402083320/http://wiki.bash-hackers.org/snipplets/print_horizontal_line#a_line_across_the_entire_width_of_the_terminal -# -# Usage: -# $ draw_horizontal_line_across_the_terminal_window [] -# -# Arguments: -# [] Symbol (a single character) for the line, default to '=' -# Outputs: -# The screen wide line -# Returns: -# none -# ================================================================================================================= -function draw_horizontal_line_across_the_terminal_window() { - local SYMBOL="${1:-=}" - local terminal_width - local pad - - # Ref https://bash.cyberciti.biz/guide/$TERM_variable - TPUT_FLAG='' - if [[ -z ${TERM} ]]; then - TPUT_FLAG='-T xterm-256color' - elif [[ ${TERM} == dumb ]]; then - # "dumb" is the one set on TeamCity Agent - TPUT_FLAG='-T xterm-256color' - fi - - # (NICE TO HAVE) ToDo: - # - var TERM should be setup in Dockerfile.dependencies - # - print a warning message if TERM is not set - - ## Original version - #printf '%*s\n' "${COLUMNS:-$(tput ${TPUT_FLAG} cols)}" '' | tr ' ' "${SYMBOL}" - - # Alt version - terminal_width="${COLUMNS:-$(tput ${TPUT_FLAG} cols)}" - pad=$(printf -- "${SYMBOL}%.0s" $(seq $terminal_width)) - printf -- "${pad}\n" -} - -# ================================================================================================================= -# Print a formatted script header or footer -# -# Usage: -# $ print_formated_script_header "