From 8983956fa14d879bb7a262734b6ab57651d761d4 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 10:09:25 +0200 Subject: [PATCH 01/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 831 +++++++++++++++-------------- CMakeLists.txt | 195 +++---- 2 files changed, 482 insertions(+), 544 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index fe4ee3248..3dbf66390 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -23,282 +23,282 @@ concurrency: cancel-in-progress: true jobs: - windows-release-node: - needs: format-taginfo-docs - runs-on: windows-2022 - continue-on-error: false - env: - BUILD_TYPE: Release - steps: - - uses: actions/checkout@v4 - - run: pip install "conan<2.0.0" - - run: conan --version - - run: cmake --version - - uses: actions/setup-node@v4 - with: - node-version: 18 - - run: node --version - - run: npm --version - - name: Prepare environment - shell: bash - run: | - PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") - echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV - - run: npm install --ignore-scripts - - run: npm link --ignore-scripts - - name: Build - shell: bash - run: | - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON .. - cmake --build . --config Release + # windows-release-node: + # needs: format-taginfo-docs + # runs-on: windows-2022 + # continue-on-error: false + # env: + # BUILD_TYPE: Release + # steps: + # - uses: actions/checkout@v4 + # - run: pip install "conan<2.0.0" + # - run: conan --version + # - run: cmake --version + # - uses: actions/setup-node@v4 + # with: + # node-version: 18 + # - run: node --version + # - run: npm --version + # - name: Prepare environment + # shell: bash + # run: | + # PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") + # echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV + # - run: npm install --ignore-scripts + # - run: npm link --ignore-scripts + # - name: Build + # shell: bash + # run: | + # mkdir build + # cd build + # cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON .. + # cmake --build . --config Release - # TODO: MSVC goes out of memory when building our tests - # - name: Run tests - # shell: bash - # run: | - # cd build - # cmake --build . --config Release --target tests - # # TODO: run tests - # - name: Run node tests - # shell: bash - # run: | - # ./lib/binding/osrm-extract.exe -p profiles/car.lua test/data/monaco.osm.pbf + # # TODO: MSVC goes out of memory when building our tests + # # - name: Run tests + # # shell: bash + # # run: | + # # cd build + # # cmake --build . --config Release --target tests + # # # TODO: run tests + # # - name: Run node tests + # # shell: bash + # # run: | + # # ./lib/binding/osrm-extract.exe -p profiles/car.lua test/data/monaco.osm.pbf - # mkdir -p test/data/ch - # cp test/data/monaco.osrm* test/data/ch/ - # ./lib/binding/osrm-contract.exe test/data/ch/monaco.osrm + # # mkdir -p test/data/ch + # # cp test/data/monaco.osrm* test/data/ch/ + # # ./lib/binding/osrm-contract.exe test/data/ch/monaco.osrm - # ./lib/binding/osrm-datastore.exe test/data/ch/monaco.osrm - # node test/nodejs/index.js - - name: Build Node package - shell: bash - run: ./scripts/ci/node_package.sh - - name: Publish Node package - if: ${{ env.PUBLISH == 'On' }} - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifactErrorsFailBuild: true - artifacts: build/stage/**/*.tar.gz - omitBody: true - omitBodyDuringUpdate: true - omitName: true - omitNameDuringUpdate: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} + # # ./lib/binding/osrm-datastore.exe test/data/ch/monaco.osrm + # # node test/nodejs/index.js + # - name: Build Node package + # shell: bash + # run: ./scripts/ci/node_package.sh + # - name: Publish Node package + # if: ${{ env.PUBLISH == 'On' }} + # uses: ncipollo/release-action@v1 + # with: + # allowUpdates: true + # artifactErrorsFailBuild: true + # artifacts: build/stage/**/*.tar.gz + # omitBody: true + # omitBodyDuringUpdate: true + # omitName: true + # omitNameDuringUpdate: true + # replacesArtifacts: true + # token: ${{ secrets.GITHUB_TOKEN }} - format-taginfo-docs: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Enable Node.js cache - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Prepare environment - run: | - npm ci --ignore-scripts - clang-format-15 --version - - name: Run checks - run: | - ./scripts/check_taginfo.py taginfo.json profiles/car.lua - ./scripts/format.sh && ./scripts/error_on_dirty.sh - node ./scripts/validate_changelog.js - npm run docs && ./scripts/error_on_dirty.sh - npm audit --production + # format-taginfo-docs: + # runs-on: ubuntu-22.04 + # steps: + # - uses: actions/checkout@v4 + # - name: Use Node.js + # uses: actions/setup-node@v4 + # with: + # node-version: 18 + # - name: Enable Node.js cache + # uses: actions/cache@v4 + # with: + # path: ~/.npm + # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + # restore-keys: | + # ${{ runner.os }}-node- + # - name: Prepare environment + # run: | + # npm ci --ignore-scripts + # clang-format-15 --version + # - name: Run checks + # run: | + # ./scripts/check_taginfo.py taginfo.json profiles/car.lua + # ./scripts/format.sh && ./scripts/error_on_dirty.sh + # node ./scripts/validate_changelog.js + # npm run docs && ./scripts/error_on_dirty.sh + # npm audit --production - docker-image-matrix: - strategy: - matrix: - docker-base-image: ["debian", "alpine"] - needs: format-taginfo-docs - runs-on: ubuntu-22.04 - continue-on-error: false - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - name: Enable osm.pbf cache - uses: actions/cache@v4 - with: - path: berlin-latest.osm.pbf - key: v1-berlin-osm-pbf - restore-keys: | - v1-berlin-osm-pbf - - name: Docker build - run: | - docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . - - name: Test Docker image - run: | - if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then - wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf - fi - TAG=osrm-backend-local - # when `--memory-swap` value equals `--memory` it means container won't use swap - # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details - MEMORY_ARGS="--memory=1g --memory-swap=1g" - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson - if [ ! -s "${PWD}/berlin-latest.geojson" ] - then - >&2 echo "No berlin-latest.geojson found" - exit 1 - fi - # removing `.osrm.nbg` to check that whole pipeline works without it - rm -rf "${PWD}/berlin-latest.osrm.nbg" + # docker-image-matrix: + # strategy: + # matrix: + # docker-base-image: ["debian", "alpine"] + # needs: format-taginfo-docs + # runs-on: ubuntu-22.04 + # continue-on-error: false + # steps: + # - name: Check out the repo + # uses: actions/checkout@v4 + # - name: Enable osm.pbf cache + # uses: actions/cache@v4 + # with: + # path: berlin-latest.osm.pbf + # key: v1-berlin-osm-pbf + # restore-keys: | + # v1-berlin-osm-pbf + # - name: Docker build + # run: | + # docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . + # - name: Test Docker image + # run: | + # if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then + # wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf + # fi + # TAG=osrm-backend-local + # # when `--memory-swap` value equals `--memory` it means container won't use swap + # # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details + # MEMORY_ARGS="--memory=1g --memory-swap=1g" + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson + # if [ ! -s "${PWD}/berlin-latest.geojson" ] + # then + # >&2 echo "No berlin-latest.geojson found" + # exit 1 + # fi + # # removing `.osrm.nbg` to check that whole pipeline works without it + # rm -rf "${PWD}/berlin-latest.osrm.nbg" - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm - docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & - curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" - docker stop osrm-container + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm + # docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & + # curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" + # docker stop osrm-container build-test-publish: - needs: format-taginfo-docs + #needs: format-taginfo-docs strategy: matrix: include: - - name: gcc-13-debug-cov - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: gcc-13 - CUCUMBER_TIMEOUT: 20000 - CXXCOMPILER: g++-13 - ENABLE_COVERAGE: ON + # - name: gcc-13-debug-cov + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: gcc-13 + # CUCUMBER_TIMEOUT: 20000 + # CXXCOMPILER: g++-13 + # ENABLE_COVERAGE: ON - - name: clang-18-debug-asan-ubsan - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CUCUMBER_TIMEOUT: 20000 - CXXCOMPILER: clang++-18 - ENABLE_SANITIZER: ON - TARGET_ARCH: x86_64-asan-ubsan - OSRM_CONNECTION_RETRIES: 10 - OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 + # - name: clang-18-debug-asan-ubsan + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CUCUMBER_TIMEOUT: 20000 + # CXXCOMPILER: clang++-18 + # ENABLE_SANITIZER: ON + # TARGET_ARCH: x86_64-asan-ubsan + # OSRM_CONNECTION_RETRIES: 10 + # OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 - - name: clang-18-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-18-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-18-debug - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-18-debug + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-18-debug-clang-tidy - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_CLANG_TIDY: ON + # - name: clang-18-debug-clang-tidy + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_CLANG_TIDY: ON - - name: clang-17-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-17 - CXXCOMPILER: clang++-17 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-17-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-17 + # CXXCOMPILER: clang++-17 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-16-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-16-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: conan-linux-debug-asan-ubsan - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - ENABLE_CONAN: ON - ENABLE_SANITIZER: ON - ENABLE_LTO: OFF + # - name: conan-linux-debug-asan-ubsan + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # ENABLE_CONAN: ON + # ENABLE_SANITIZER: ON + # ENABLE_LTO: OFF - - name: conan-linux-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - ENABLE_CONAN: ON - ENABLE_LTO: OFF + # - name: conan-linux-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # ENABLE_CONAN: ON + # ENABLE_LTO: OFF - - name: gcc-14-release - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-14 - CXXCOMPILER: g++-14 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-14-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-14 + # CXXCOMPILER: g++-14 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: gcc-13-release - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-13 - CXXCOMPILER: g++-13 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-13-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-13 + # CXXCOMPILER: g++-13 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: gcc-12-release - continue-on-error: false - node: 20 - runs-on: ubuntu-22.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-12 - CXXCOMPILER: g++-12 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-12-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-22.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-12 + # CXXCOMPILER: g++-12 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - name: conan-linux-release-node build_node_package: true @@ -311,40 +311,40 @@ jobs: ENABLE_CONAN: ON NODE_PACKAGE_TESTS_ONLY: ON - - name: conan-linux-debug-node - build_node_package: true - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TYPE: Debug - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - ENABLE_CONAN: ON - NODE_PACKAGE_TESTS_ONLY: ON + # - name: conan-linux-debug-node + # build_node_package: true + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TYPE: Debug + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # ENABLE_CONAN: ON + # NODE_PACKAGE_TESTS_ONLY: ON - - name: conan-macos-x64-release-node - build_node_package: true - continue-on-error: true - node: 20 - runs-on: macos-13 # x86_64 - BUILD_TYPE: Release - CCOMPILER: clang - CXXCOMPILER: clang++ - CUCUMBER_TIMEOUT: 60000 - ENABLE_ASSERTIONS: ON - ENABLE_CONAN: ON + # - name: conan-macos-x64-release-node + # build_node_package: true + # continue-on-error: true + # node: 20 + # runs-on: macos-13 # x86_64 + # BUILD_TYPE: Release + # CCOMPILER: clang + # CXXCOMPILER: clang++ + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_ASSERTIONS: ON + # ENABLE_CONAN: ON - - name: conan-macos-arm64-release-node - build_node_package: true - continue-on-error: true - node: 20 - runs-on: macos-14 # arm64 - BUILD_TYPE: Release - CCOMPILER: clang - CXXCOMPILER: clang++ - CUCUMBER_TIMEOUT: 60000 - ENABLE_ASSERTIONS: ON - ENABLE_CONAN: ON + # - name: conan-macos-arm64-release-node + # build_node_package: true + # continue-on-error: true + # node: 20 + # runs-on: macos-14 # arm64 + # BUILD_TYPE: Release + # CCOMPILER: clang + # CXXCOMPILER: clang++ + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_ASSERTIONS: ON + # ENABLE_CONAN: ON name: ${{ matrix.name}} continue-on-error: ${{ matrix.continue-on-error }} @@ -523,6 +523,18 @@ jobs: run: | echo "Using ${JOBS} jobs" pushd ${OSRM_BUILD_DIR} + + python3 -m venv .venv + source .venv/bin/activate + + python3 -m pip install conan==2.7.1 + + conan profile new default --detect + sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default + + if [[ "${ENABLE_CONAN}" == "ON" ]]; then + conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 + fi ccache --zero-stats cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ @@ -536,7 +548,8 @@ jobs: -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ -DENABLE_CCACHE=ON \ -DENABLE_LTO=${ENABLE_LTO:-ON} \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} + -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ + -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake make --jobs=${JOBS} if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then @@ -650,130 +663,130 @@ jobs: ccache -p ccache -s - benchmarks: - if: github.event_name == 'pull_request' - needs: [format-taginfo-docs] - runs-on: self-hosted - env: - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - CC: clang-16 - CXX: clang++-16 - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - PR_NUMBER: ${{ github.event.pull_request.number }} - GITHUB_REPOSITORY: ${{ github.repository }} - RUN_BIG_BENCHMARK: ${{ contains(github.event.pull_request.labels.*.name, 'Performance') }} - steps: - - name: Checkout PR Branch - uses: actions/checkout@v4 - with: - ref: ${{ github.head_ref }} - path: pr - - name: Activate virtualenv - run: | - python3 -m venv .venv - source .venv/bin/activate - echo PATH=$PATH >> $GITHUB_ENV - pip install "conan<2.0.0" "requests==2.31.0" "numpy==1.26.4" - - name: Prepare data - run: | - if [ "$RUN_BIG_BENCHMARK" = "true" ]; then - rm -rf ~/data.osm.pbf - wget http://download.geofabrik.de/europe/poland-latest.osm.pbf -O ~/data.osm.pbf --quiet - gunzip -c ./pr/test/data/poland_gps_traces.csv.gz > ~/gps_traces.csv - else - if [ ! -f "~/data.osm.pbf" ]; then - wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf -O ~/data.osm.pbf - else - echo "Using cached data.osm.pbf" - fi - gunzip -c ./pr/test/data/berlin_gps_traces.csv.gz > ~/gps_traces.csv - fi - - name: Prepare environment - run: | - echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV - mkdir -p $HOME/.ccache - ccache --zero-stats - ccache --max-size=256M - - name: Checkout Base Branch - uses: actions/checkout@v4 - with: - ref: ${{ github.event.pull_request.base.ref }} - path: base - - name: Build Base Branch - run: | - cd base - npm ci --ignore-scripts - cd .. - mkdir base/build - cd base/build - cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON .. - make -j$(nproc) - make -j$(nproc) benchmarks - cd .. - make -C test/data - - name: Build PR Branch - run: | - cd pr - npm ci --ignore-scripts - cd .. - mkdir -p pr/build - cd pr/build - cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON .. - make -j$(nproc) - make -j$(nproc) benchmarks - cd .. - make -C test/data - # we run benchmarks in tmpfs to avoid impact of disk IO - - name: Create folder for tmpfs - run: | - # if by any chance it was mounted before(e.g. due to previous job failed), unmount it - sudo umount ~/benchmarks | true - rm -rf ~/benchmarks - mkdir -p ~/benchmarks - # see https://llvm.org/docs/Benchmarking.html - - name: Run PR Benchmarks - run: | - sudo cset shield -c 2-3 -k on - sudo mount -t tmpfs -o size=4g none ~/benchmarks - cp -rf pr/build ~/benchmarks/build - cp -rf pr/lib ~/benchmarks/lib - mkdir -p ~/benchmarks/test - cp -rf pr/test/data ~/benchmarks/test/data - cp -rf pr/profiles ~/benchmarks/profiles + # benchmarks: + # if: github.event_name == 'pull_request' + # needs: [format-taginfo-docs] + # runs-on: self-hosted + # env: + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # CC: clang-16 + # CXX: clang++-16 + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # PR_NUMBER: ${{ github.event.pull_request.number }} + # GITHUB_REPOSITORY: ${{ github.repository }} + # RUN_BIG_BENCHMARK: ${{ contains(github.event.pull_request.labels.*.name, 'Performance') }} + # steps: + # - name: Checkout PR Branch + # uses: actions/checkout@v4 + # with: + # ref: ${{ github.head_ref }} + # path: pr + # - name: Activate virtualenv + # run: | + # python3 -m venv .venv + # source .venv/bin/activate + # echo PATH=$PATH >> $GITHUB_ENV + # pip install "conan<2.0.0" "requests==2.31.0" "numpy==1.26.4" + # - name: Prepare data + # run: | + # if [ "$RUN_BIG_BENCHMARK" = "true" ]; then + # rm -rf ~/data.osm.pbf + # wget http://download.geofabrik.de/europe/poland-latest.osm.pbf -O ~/data.osm.pbf --quiet + # gunzip -c ./pr/test/data/poland_gps_traces.csv.gz > ~/gps_traces.csv + # else + # if [ ! -f "~/data.osm.pbf" ]; then + # wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf -O ~/data.osm.pbf + # else + # echo "Using cached data.osm.pbf" + # fi + # gunzip -c ./pr/test/data/berlin_gps_traces.csv.gz > ~/gps_traces.csv + # fi + # - name: Prepare environment + # run: | + # echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV + # mkdir -p $HOME/.ccache + # ccache --zero-stats + # ccache --max-size=256M + # - name: Checkout Base Branch + # uses: actions/checkout@v4 + # with: + # ref: ${{ github.event.pull_request.base.ref }} + # path: base + # - name: Build Base Branch + # run: | + # cd base + # npm ci --ignore-scripts + # cd .. + # mkdir base/build + # cd base/build + # cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON .. + # make -j$(nproc) + # make -j$(nproc) benchmarks + # cd .. + # make -C test/data + # - name: Build PR Branch + # run: | + # cd pr + # npm ci --ignore-scripts + # cd .. + # mkdir -p pr/build + # cd pr/build + # cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON .. + # make -j$(nproc) + # make -j$(nproc) benchmarks + # cd .. + # make -C test/data + # # we run benchmarks in tmpfs to avoid impact of disk IO + # - name: Create folder for tmpfs + # run: | + # # if by any chance it was mounted before(e.g. due to previous job failed), unmount it + # sudo umount ~/benchmarks | true + # rm -rf ~/benchmarks + # mkdir -p ~/benchmarks + # # see https://llvm.org/docs/Benchmarking.html + # - name: Run PR Benchmarks + # run: | + # sudo cset shield -c 2-3 -k on + # sudo mount -t tmpfs -o size=4g none ~/benchmarks + # cp -rf pr/build ~/benchmarks/build + # cp -rf pr/lib ~/benchmarks/lib + # mkdir -p ~/benchmarks/test + # cp -rf pr/test/data ~/benchmarks/test/data + # cp -rf pr/profiles ~/benchmarks/profiles - sudo cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/pr_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv - sudo umount ~/benchmarks - sudo cset shield --reset - - name: Run Base Benchmarks - run: | - sudo cset shield -c 2-3 -k on - sudo mount -t tmpfs -o size=4g none ~/benchmarks - cp -rf base/build ~/benchmarks/build - cp -rf base/lib ~/benchmarks/lib - mkdir -p ~/benchmarks/test - cp -rf base/test/data ~/benchmarks/test/data - cp -rf base/profiles ~/benchmarks/profiles + # sudo cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/pr_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv + # sudo umount ~/benchmarks + # sudo cset shield --reset + # - name: Run Base Benchmarks + # run: | + # sudo cset shield -c 2-3 -k on + # sudo mount -t tmpfs -o size=4g none ~/benchmarks + # cp -rf base/build ~/benchmarks/build + # cp -rf base/lib ~/benchmarks/lib + # mkdir -p ~/benchmarks/test + # cp -rf base/test/data ~/benchmarks/test/data + # cp -rf base/profiles ~/benchmarks/profiles - # TODO: remove it when base branch will have this file at needed location - if [ ! -f ~/benchmarks/test/data/portugal_to_korea.json ]; then - cp base/src/benchmarks/portugal_to_korea.json ~/benchmarks/test/data/portugal_to_korea.json - fi - # we intentionally use scripts from PR branch to be able to update them and see results in the same PR - sudo cset shield --exec -- cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/base_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv - sudo umount ~/benchmarks - sudo cset shield --reset - - name: Post Benchmark Results - run: | - python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results - - name: Show CCache statistics - run: | - ccache -p - ccache -s + # # TODO: remove it when base branch will have this file at needed location + # if [ ! -f ~/benchmarks/test/data/portugal_to_korea.json ]; then + # cp base/src/benchmarks/portugal_to_korea.json ~/benchmarks/test/data/portugal_to_korea.json + # fi + # # we intentionally use scripts from PR branch to be able to update them and see results in the same PR + # sudo cset shield --exec -- cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/base_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv + # sudo umount ~/benchmarks + # sudo cset shield --reset + # - name: Post Benchmark Results + # run: | + # python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results + # - name: Show CCache statistics + # run: | + # ccache -p + # ccache -s - ci-complete: - runs-on: ubuntu-22.04 - needs: [build-test-publish, docker-image-matrix, windows-release-node, benchmarks] - steps: - - run: echo "CI complete" + # ci-complete: + # runs-on: ubuntu-22.04 + # needs: [build-test-publish, docker-image-matrix, windows-release-node, benchmarks] + # steps: + # - run: echo "CI complete" diff --git a/CMakeLists.txt b/CMakeLists.txt index 08e0a64fa..a48bae0ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR}) set(ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR}) endif() -option(ENABLE_CONAN "Use conan for dependencies" OFF) + option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON) option(BUILD_TOOLS "Build OSRM tools" OFF) option(BUILD_PACKAGE "Build OSRM package" OFF) @@ -321,125 +321,50 @@ if (MSVC) add_definitions(-DBOOST_ALL_NO_LIB) endif() -if(ENABLE_CONAN) - message(STATUS "Installing dependencies via Conan") +find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) +add_dependency_includes(${Boost_INCLUDE_DIRS}) +#message(FATAL_ERROR "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS} Boost_LIBRARIES: ${Boost_LIBRARIES}") +set(BOOST_LIBRARIES ${Boost_LIBRARIES}) +# set(BOOST_IN ${Boost_LIBRARIES}) +find_package(TBB REQUIRED) +add_dependency_includes(${TBB_INCLUDE_DIR}) +set(TBB_LIBRARIES ${TBB_LIBRARIES}) - # Conan will generate Find*.cmake files to build directory, so we use them with the highest priority - list(INSERT CMAKE_MODULE_PATH 0 ${CMAKE_BINARY_DIR}) - list(INSERT CMAKE_PREFIX_PATH 0 ${CMAKE_BINARY_DIR}) +find_package(EXPAT REQUIRED) +add_dependency_includes(${EXPAT_INCLUDE_DIRS}) +#message(FATAL_ERROR "EXPAT_INCLUDE_DIRS: ${expat_INCLUDE_DIRS} EXPAT_LIBRARIES: ${expat_LIBRARIES}") +set(EXPAT_LIBRARIES ${expat_LIBRARIES}) +set(EXPAT_INCLUDE_DIRS ${expat_INCLUDE_DIRS}) +find_package(BZip2 REQUIRED) +add_dependency_includes(${BZIP2_INCLUDE_DIR}) - include(${CMAKE_CURRENT_LIST_DIR}/cmake/conan.cmake) - - conan_check(REQUIRED) - - set(CONAN_BOOST_VERSION "1.85.0@#14265ec82b25d91305bbb3b30d3357f8") - set(CONAN_BZIP2_VERSION "1.0.8@#d1b2d5816f25865acf978501dff1f897") - set(CONAN_EXPAT_VERSION "2.6.2@#2d385d0d50eb5561006a7ff9e356656b") - set(CONAN_LUA_VERSION "5.4.6@#658d6089093cf01992c2737ab2e96763") - set(CONAN_TBB_VERSION "2021.12.0@#e56e5b44be8d690530585dd3634c0106") - - set(CONAN_SYSTEM_INCLUDES ON) - - - set(CONAN_ARGS - REQUIRES - "boost/${CONAN_BOOST_VERSION}" - "bzip2/${CONAN_BZIP2_VERSION}" - "expat/${CONAN_EXPAT_VERSION}" - "lua/${CONAN_LUA_VERSION}" - "onetbb/${CONAN_TBB_VERSION}" - BASIC_SETUP - GENERATORS cmake_find_package json # json generator generates a conanbuildinfo.json in the build folder so (non-CMake) projects can easily parse OSRM's dependencies - KEEP_RPATHS - NO_OUTPUT_DIRS - OPTIONS boost:without_stacktrace=True # Apple Silicon cross-compilation fails without it - BUILD missing - ) - - # Enable revisions in the conan config - execute_process(COMMAND ${CONAN_CMD} config set general.revisions_enabled=1 RESULT_VARIABLE RET_CODE) - if(NOT "${RET_CODE}" STREQUAL "0") - message(FATAL_ERROR "Error setting revisions for Conan: '${RET_CODE}'") - endif() - - # explicitly say Conan to use x86 dependencies if build for x86 platforms (https://github.com/conan-io/cmake-conan/issues/141) - if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) - conan_cmake_run("${CONAN_ARGS};ARCH;x86") - # cross-compilation for Apple Silicon - elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "arm64" AND CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64") - conan_cmake_run("${CONAN_ARGS};ARCH;armv8") - else() - conan_cmake_run("${CONAN_ARGS}") - endif() - - add_dependency_includes(${CONAN_INCLUDE_DIRS_BOOST}) - add_dependency_includes(${CONAN_INCLUDE_DIRS_BZIP2}) - add_dependency_includes(${CONAN_INCLUDE_DIRS_EXPAT}) - add_dependency_includes(${CONAN_INCLUDE_DIRS_LUA}) - add_dependency_includes(${CONAN_INCLUDE_DIRS_TBB}) - - set(Boost_USE_STATIC_LIBS ON) - find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) - set(Boost_DATE_TIME_LIBRARY "${Boost_date_time_LIB_TARGETS}") - set(Boost_PROGRAM_OPTIONS_LIBRARY "${Boost_program_options_LIB_TARGETS}") - set(Boost_IOSTREAMS_LIBRARY "${Boost_iostreams_LIB_TARGETS}") - set(Boost_THREAD_LIBRARY "${Boost_thread_LIB_TARGETS}") - set(Boost_ZLIB_LIBRARY "${Boost_zlib_LIB_TARGETS}") - set(Boost_UNIT_TEST_FRAMEWORK_LIBRARY "${Boost_unit_test_framework_LIB_TARGETS}") - - - find_package(BZip2 REQUIRED) - find_package(EXPAT REQUIRED) - find_package(lua REQUIRED) - set(LUA_LIBRARIES ${lua_LIBRARIES}) - - find_package(TBB REQUIRED) - - - # note: we avoid calling find_package(Osmium ...) here to ensure that the - # expat and bzip2 are used from conan rather than the system - include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include) -else() - find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) - add_dependency_includes(${Boost_INCLUDE_DIRS}) - - find_package(TBB REQUIRED) - add_dependency_includes(${TBB_INCLUDE_DIR}) - set(TBB_LIBRARIES TBB::tbb) - - find_package(EXPAT REQUIRED) - add_dependency_includes(${EXPAT_INCLUDE_DIRS}) - - find_package(BZip2 REQUIRED) - add_dependency_includes(${BZIP2_INCLUDE_DIR}) - - find_package(Lua 5.2 REQUIRED) - if (LUA_FOUND) - message(STATUS "Using Lua ${LUA_VERSION_STRING}") - endif() - - add_dependency_includes(${LUA_INCLUDE_DIR}) - - # add a target to generate API documentation with Doxygen - find_package(Doxygen) - if(DOXYGEN_FOUND) - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) - add_custom_target(doc - ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating API documentation with Doxygen" VERBATIM - ) - endif() - - # note libosmium depends on expat and bzip2 - list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake") - if(NOT OSMIUM_INCLUDE_DIR) - set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include") - endif() - find_package(Osmium REQUIRED COMPONENTS io) - include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR}) +find_package(Lua 5.2 REQUIRED) +set(LUA_LIBRARIES lua::lua) +if (LUA_FOUND) + message(STATUS "Using Lua ${LUA_VERSION_STRING}") endif() +add_dependency_includes(${lua_INCLUDE_DIRS}) + +# add a target to generate API documentation with Doxygen +find_package(Doxygen) +if(DOXYGEN_FOUND) +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) +add_custom_target(doc +${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile +WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} +COMMENT "Generating API documentation with Doxygen" VERBATIM +) +endif() + +# note libosmium depends on expat and bzip2 +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake") +if(NOT OSMIUM_INCLUDE_DIR) + set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include") +endif() +find_package(Osmium REQUIRED COMPONENTS io) +include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR}) + # prefix compilation with ccache by default if available and on clang or gcc if(ENABLE_CCACHE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")) find_program(CCACHE_FOUND ccache) @@ -464,15 +389,15 @@ add_dependency_defines(-DBOOST_PHOENIX_STL_TUPLE_H_) add_definitions(${OSRM_DEFINES}) include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS}) -set(BOOST_BASE_LIBRARIES - ${Boost_DATE_TIME_LIBRARY} - ${Boost_IOSTREAMS_LIBRARY} - ${Boost_THREAD_LIBRARY}) +# set(BOOST_LIBRARIES +# ${Boost_DATE_TIME_LIBRARY} +# ${Boost_IOSTREAMS_LIBRARY} +# ${Boost_THREAD_LIBRARY}) -set(BOOST_ENGINE_LIBRARIES - ${Boost_ZLIB_LIBRARY} - ${Boost_REGEX_LIBRARY} - ${BOOST_BASE_LIBRARIES}) +# set(BOOST_LIBRARIES +# ${Boost_ZLIB_LIBRARY} +# ${Boost_REGEX_LIBRARY} +# ${BOOST_LIBRARIES}) # Binaries target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY}) @@ -486,7 +411,7 @@ endif() set(EXTRACTOR_LIBRARIES ${BZIP2_LIBRARIES} - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${EXPAT_LIBRARIES} ${LUA_LIBRARIES} @@ -495,53 +420,53 @@ set(EXTRACTOR_LIBRARIES ${ZLIB_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(GUIDANCE_LIBRARIES - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${LUA_LIBRARIES} ${TBB_LIBRARIES} ${MAYBE_COVERAGE_LIBRARIES}) set(PARTITIONER_LIBRARIES - ${BOOST_ENGINE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES} ${ZLIB_LIBRARY}) set(CUSTOMIZER_LIBRARIES - ${BOOST_ENGINE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(UPDATER_LIBRARIES - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES} ${ZLIB_LIBRARY}) set(CONTRACTOR_LIBRARIES - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${LUA_LIBRARIES} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(ENGINE_LIBRARIES - ${BOOST_ENGINE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES} ${ZLIB_LIBRARY}) set(STORAGE_LIBRARIES - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(UTIL_LIBRARIES - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_COVERAGE_LIBRARIES} @@ -558,13 +483,13 @@ target_link_libraries(osrm_store ${STORAGE_LIBRARIES}) # BUILD_COMPONENTS add_executable(osrm-components src/tools/components.cpp $ $) -target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${UTIL_LIBRARIES}) +target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_LIBRARIES} ${UTIL_LIBRARIES}) install(TARGETS osrm-components DESTINATION bin) if(BUILD_TOOLS) message(STATUS "Activating OSRM internal tools") add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $) - target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES} ${TBB_LIBRARIES}) + target_link_libraries(osrm-io-benchmark ${BOOST_LIBRARIES} ${TBB_LIBRARIES}) install(TARGETS osrm-io-benchmark DESTINATION bin) endif() From 5359a7774e332726c7e7331cc17fe1610627ae23 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 10:11:37 +0200 Subject: [PATCH 02/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 2 +- conanfile.py | 23 +++++++++++++++++++++++ 2 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 conanfile.py diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 3dbf66390..0f0127456 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -529,7 +529,7 @@ jobs: python3 -m pip install conan==2.7.1 - conan profile new default --detect + conan profile detect --force sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default if [[ "${ENABLE_CONAN}" == "ON" ]]; then diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 000000000..355c063bf --- /dev/null +++ b/conanfile.py @@ -0,0 +1,23 @@ +from conan import ConanFile +from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps + +class OsrmConan(ConanFile): + settings = "os", "compiler", "build_type", "arch" + requires = ( + "boost/1.85.0", + "bzip2/1.0.8", + "expat/2.6.2", + "lua/5.4.6", + "onetbb/2021.12.0", + ) + generators = "CMakeDeps" + + def generate(self): + tc = CMakeToolchain(self) + tc.variables["CMAKE_CXX_STANDARD"] = "20" + tc.generate() + + def build(self): + cmake = CMake(self) + cmake.configure() + cmake.build() From e67e9ea808648740553d6e9eae0d31e452dbbfda Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 11:01:30 +0200 Subject: [PATCH 03/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 0f0127456..d334c2ac1 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -530,7 +530,8 @@ jobs: python3 -m pip install conan==2.7.1 conan profile detect --force - sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default + cat ~/.conan2/profiles/default + # sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default if [[ "${ENABLE_CONAN}" == "ON" ]]; then conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 From 3af3b11c7d77250263a8c4acde19a27238724a99 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 11:24:12 +0200 Subject: [PATCH 04/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 93 +++++++++++++++++------------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index d334c2ac1..519b059c4 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -23,36 +23,49 @@ concurrency: cancel-in-progress: true jobs: - # windows-release-node: - # needs: format-taginfo-docs - # runs-on: windows-2022 - # continue-on-error: false - # env: - # BUILD_TYPE: Release - # steps: - # - uses: actions/checkout@v4 - # - run: pip install "conan<2.0.0" - # - run: conan --version - # - run: cmake --version - # - uses: actions/setup-node@v4 - # with: - # node-version: 18 - # - run: node --version - # - run: npm --version - # - name: Prepare environment - # shell: bash - # run: | - # PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") - # echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV - # - run: npm install --ignore-scripts - # - run: npm link --ignore-scripts - # - name: Build - # shell: bash - # run: | - # mkdir build - # cd build - # cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON .. - # cmake --build . --config Release + windows-release-node: + needs: format-taginfo-docs + runs-on: windows-2022 + continue-on-error: false + env: + BUILD_TYPE: Release + steps: + - uses: actions/checkout@v4 + - run: pip install "conan<2.0.0" + - run: conan --version + - run: cmake --version + - uses: actions/setup-node@v4 + with: + node-version: 18 + - run: node --version + - run: npm --version + - name: Prepare environment + shell: bash + run: | + PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") + echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV + - run: npm install --ignore-scripts + - run: npm link --ignore-scripts + - name: Build + shell: bash + run: | + mkdir build + cd build + + python3 -m venv .venv + source .venv/bin/activate + + python3 -m pip install conan==2.7.1 + + conan profile detect --force + cat ~/.conan2/profiles/default + + if [[ "${ENABLE_CONAN}" == "ON" ]]; then + conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 + fi + + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. + cmake --build . --config Release # # TODO: MSVC goes out of memory when building our tests # # - name: Run tests @@ -311,16 +324,16 @@ jobs: ENABLE_CONAN: ON NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-linux-debug-node - # build_node_package: true - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TYPE: Debug - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # ENABLE_CONAN: ON - # NODE_PACKAGE_TESTS_ONLY: ON + - name: conan-linux-debug-node + build_node_package: true + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TYPE: Debug + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + ENABLE_CONAN: ON + NODE_PACKAGE_TESTS_ONLY: ON # - name: conan-macos-x64-release-node # build_node_package: true From dd6cf93527076db6b5bf3789232aad1c3eaf79d9 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 11:25:04 +0200 Subject: [PATCH 05/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 519b059c4..5e53a3331 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -24,7 +24,7 @@ concurrency: jobs: windows-release-node: - needs: format-taginfo-docs + #needs: format-taginfo-docs runs-on: windows-2022 continue-on-error: false env: From 324e4eecc610723147128349a80aa6baf323d369 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 11:28:14 +0200 Subject: [PATCH 06/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 74 +++++++++++++++--------------- 1 file changed, 36 insertions(+), 38 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 5e53a3331..54d396507 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -31,8 +31,6 @@ jobs: BUILD_TYPE: Release steps: - uses: actions/checkout@v4 - - run: pip install "conan<2.0.0" - - run: conan --version - run: cmake --version - uses: actions/setup-node@v4 with: @@ -470,8 +468,6 @@ jobs: - name: Install dev dependencies run: | - python3 -m pip install "conan<2.0.0" || python3 -m pip install "conan<2.0.0" --break-system-packages - # workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499 # and that's why CI cannot find conan executable installed above if [[ "${RUNNER_OS}" == "macOS" ]]; then @@ -538,45 +534,47 @@ jobs: pushd ${OSRM_BUILD_DIR} python3 -m venv .venv - source .venv/bin/activate - python3 -m pip install conan==2.7.1 + ls -R .venv + # source .venv/bin/activate - conan profile detect --force - cat ~/.conan2/profiles/default - # sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default + # python3 -m pip install conan==2.7.1 - if [[ "${ENABLE_CONAN}" == "ON" ]]; then - conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 - fi + # conan profile detect --force + # cat ~/.conan2/profiles/default + # # sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default + + # if [[ "${ENABLE_CONAN}" == "ON" ]]; then + # conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 + # fi - ccache --zero-stats - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_CONAN=${ENABLE_CONAN:-OFF} \ - -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ - -DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-OFF} \ - -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ - -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ - -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DENABLE_LTO=${ENABLE_LTO:-ON} \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake - make --jobs=${JOBS} + # ccache --zero-stats + # cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ + # -DENABLE_CONAN=${ENABLE_CONAN:-OFF} \ + # -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ + # -DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-OFF} \ + # -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ + # -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ + # -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ + # -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ + # -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ + # -DENABLE_CCACHE=ON \ + # -DENABLE_LTO=${ENABLE_LTO:-ON} \ + # -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ + # -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake + # make --jobs=${JOBS} - if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then - make tests --jobs=${JOBS} - make benchmarks --jobs=${JOBS} + # if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then + # make tests --jobs=${JOBS} + # make benchmarks --jobs=${JOBS} - sudo make install - if [[ "${RUNNER_OS}" == "Linux" ]]; then - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV - fi - echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV - fi - popd + # sudo make install + # if [[ "${RUNNER_OS}" == "Linux" ]]; then + # echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV + # fi + # echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV + # fi + # popd - name: Build example if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} run: | @@ -701,7 +699,7 @@ jobs: # python3 -m venv .venv # source .venv/bin/activate # echo PATH=$PATH >> $GITHUB_ENV - # pip install "conan<2.0.0" "requests==2.31.0" "numpy==1.26.4" + # pip install "conan==2.7.1" "requests==2.31.0" "numpy==1.26.4" # - name: Prepare data # run: | # if [ "$RUN_BIG_BENCHMARK" = "true" ]; then From 893c0d7d1dfb90b6532354520cc6051e057cc862 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 11:31:36 +0200 Subject: [PATCH 07/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 92 +++++++++++++++--------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 54d396507..2bd573344 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -51,19 +51,20 @@ jobs: cd build python3 -m venv .venv - source .venv/bin/activate + ls -R .venv + # source .venv/bin/activate - python3 -m pip install conan==2.7.1 + # python3 -m pip install conan==2.7.1 - conan profile detect --force - cat ~/.conan2/profiles/default + # conan profile detect --force + # cat ~/.conan2/profiles/default - if [[ "${ENABLE_CONAN}" == "ON" ]]; then - conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 - fi + # if [[ "${ENABLE_CONAN}" == "ON" ]]; then + # conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 + # fi - cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. - cmake --build . --config Release + # cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. + # cmake --build . --config Release # # TODO: MSVC goes out of memory when building our tests # # - name: Run tests @@ -404,10 +405,10 @@ jobs: - name: Enable Conan cache uses: actions/cache@v4 with: - path: ~/.conan - key: v9-conan-${{ matrix.name }}-${{ github.sha }} + path: ~/.conan2 + key: v10-conan-${{ matrix.name }}-${{ github.sha }} restore-keys: | - v9-conan-${{ matrix.name }}- + v10-conan-${{ matrix.name }}- - name: Enable test cache uses: actions/cache@v4 with: @@ -535,46 +536,45 @@ jobs: python3 -m venv .venv - ls -R .venv - # source .venv/bin/activate + source .venv/bin/activate - # python3 -m pip install conan==2.7.1 + python3 -m pip install conan==2.7.1 - # conan profile detect --force - # cat ~/.conan2/profiles/default - # # sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default + conan profile detect --force + cat ~/.conan2/profiles/default + # sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default - # if [[ "${ENABLE_CONAN}" == "ON" ]]; then - # conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 - # fi + if [[ "${ENABLE_CONAN}" == "ON" ]]; then + conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 + fi - # ccache --zero-stats - # cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - # -DENABLE_CONAN=${ENABLE_CONAN:-OFF} \ - # -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ - # -DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-OFF} \ - # -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ - # -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ - # -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - # -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ - # -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ - # -DENABLE_CCACHE=ON \ - # -DENABLE_LTO=${ENABLE_LTO:-ON} \ - # -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - # -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake - # make --jobs=${JOBS} + ccache --zero-stats + cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ + -DENABLE_CONAN=${ENABLE_CONAN:-OFF} \ + -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ + -DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-OFF} \ + -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ + -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ + -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ + -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ + -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ + -DENABLE_CCACHE=ON \ + -DENABLE_LTO=${ENABLE_LTO:-ON} \ + -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ + -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake + make --jobs=${JOBS} - # if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then - # make tests --jobs=${JOBS} - # make benchmarks --jobs=${JOBS} + if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then + make tests --jobs=${JOBS} + make benchmarks --jobs=${JOBS} - # sudo make install - # if [[ "${RUNNER_OS}" == "Linux" ]]; then - # echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV - # fi - # echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV - # fi - # popd + sudo make install + if [[ "${RUNNER_OS}" == "Linux" ]]; then + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV + fi + echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV + fi + popd - name: Build example if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} run: | From a885dff707586a6121c2170d1fbd1c22cc3d730a Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 11:43:21 +0200 Subject: [PATCH 08/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 64 +++++++++++++++--------------- unit_tests/CMakeLists.txt | 5 --- 2 files changed, 32 insertions(+), 37 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 2bd573344..c2aaa5d8c 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -271,16 +271,16 @@ jobs: # ENABLE_SANITIZER: ON # ENABLE_LTO: OFF - # - name: conan-linux-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # ENABLE_CONAN: ON - # ENABLE_LTO: OFF + - name: conan-linux-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + ENABLE_CONAN: ON + ENABLE_LTO: OFF # - name: gcc-14-release # continue-on-error: false @@ -334,29 +334,29 @@ jobs: ENABLE_CONAN: ON NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-macos-x64-release-node - # build_node_package: true - # continue-on-error: true - # node: 20 - # runs-on: macos-13 # x86_64 - # BUILD_TYPE: Release - # CCOMPILER: clang - # CXXCOMPILER: clang++ - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_ASSERTIONS: ON - # ENABLE_CONAN: ON + - name: conan-macos-x64-release-node + build_node_package: true + continue-on-error: true + node: 20 + runs-on: macos-13 # x86_64 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_CONAN: ON - # - name: conan-macos-arm64-release-node - # build_node_package: true - # continue-on-error: true - # node: 20 - # runs-on: macos-14 # arm64 - # BUILD_TYPE: Release - # CCOMPILER: clang - # CXXCOMPILER: clang++ - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_ASSERTIONS: ON - # ENABLE_CONAN: ON + - name: conan-macos-arm64-release-node + build_node_package: true + continue-on-error: true + node: 20 + runs-on: macos-14 # arm64 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_CONAN: ON name: ${{ matrix.name}} continue-on-error: ${{ matrix.continue-on-error }} diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index cf2ece5c0..217faa133 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -126,11 +126,6 @@ add_executable(util-tests ${UtilTestsSources} $ $) - -if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS) - add_definitions(-DBOOST_TEST_DYN_LINK) -endif() - set(UPDATER_TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/unit_tests/updater") set(TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/test/data") add_dependencies(library-tests osrm-extract osrm-contract osrm-partition) From ac3cac7cbced1dc4aea7a996da3fc3f56fba4bdb Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 11:45:10 +0200 Subject: [PATCH 09/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index c2aaa5d8c..5b52209de 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -52,9 +52,10 @@ jobs: python3 -m venv .venv ls -R .venv - # source .venv/bin/activate + + source .venv/Scripts/Activate - # python3 -m pip install conan==2.7.1 + python3 -m pip install conan==2.7.1 # conan profile detect --force # cat ~/.conan2/profiles/default From 910719819b8fbe1b4ea1e4badcfe0d0f514ca4c1 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 11:45:40 +0200 Subject: [PATCH 10/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 5b52209de..899ae1a79 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -506,13 +506,6 @@ jobs: tar zxvf onetbb.tgz sudo cp -a oneapi-tbb-${TBB_VERSION}/lib/. /usr/local/lib/ sudo cp -a oneapi-tbb-${TBB_VERSION}/include/. /usr/local/include/ - - name: Add Clang 18 to list of Conan compilers # workaround for the issue that Conan 1.x doesn't know about Clang 18 - if: ${{ matrix.ENABLE_CONAN == 'ON' && matrix.CCOMPILER == 'clang-18' }} - run: | - sudo wget https://github.com/mikefarah/yq/releases/download/v4.9.6/yq_linux_amd64 -O /usr/bin/yq && sudo chmod +x /usr/bin/yq - - conan config init - yq eval '.compiler.clang.version += ["18"]' -i "$HOME/.conan/settings.yml" - name: Prepare build run: | mkdir ${OSRM_BUILD_DIR} From 8871c9054b4769483295be1110900681bec1a6ca Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 11:49:08 +0200 Subject: [PATCH 11/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 899ae1a79..fba0112d3 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -51,21 +51,20 @@ jobs: cd build python3 -m venv .venv - ls -R .venv - + source .venv/Scripts/Activate python3 -m pip install conan==2.7.1 - # conan profile detect --force - # cat ~/.conan2/profiles/default + conan profile detect --force + cat ~/.conan2/profiles/default - # if [[ "${ENABLE_CONAN}" == "ON" ]]; then - # conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 - # fi + if [[ "${ENABLE_CONAN}" == "ON" ]]; then + conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 + fi - # cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. - # cmake --build . --config Release + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. + cmake --build . --config Release # # TODO: MSVC goes out of memory when building our tests # # - name: Run tests From ac89b85a339a2cfa5ab2faa50595d86e3ec53c38 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 30 Sep 2024 19:55:21 +0300 Subject: [PATCH 12/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 8 +++++--- conanfile.py | 4 ++++ unit_tests/util/io.cpp | 1 - 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index fba0112d3..a6c44346d 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -63,8 +63,10 @@ jobs: conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 fi - cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. - cmake --build . --config Release + ls -la + + # cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. + # cmake --build . --config Release # # TODO: MSVC goes out of memory when building our tests # # - name: Run tests @@ -538,7 +540,7 @@ jobs: # sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default if [[ "${ENABLE_CONAN}" == "ON" ]]; then - conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 + conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=Debug fi ccache --zero-stats diff --git a/conanfile.py b/conanfile.py index 355c063bf..fb5351d50 100644 --- a/conanfile.py +++ b/conanfile.py @@ -11,6 +11,10 @@ class OsrmConan(ConanFile): "onetbb/2021.12.0", ) generators = "CMakeDeps" + + def requirements(self): + self.options["boost"].without_python = True + self.options["boost"].without_coroutine = True def generate(self): tc = CMakeToolchain(self) diff --git a/unit_tests/util/io.cpp b/unit_tests/util/io.cpp index 4cc3a688b..d9f86d0e7 100644 --- a/unit_tests/util/io.cpp +++ b/unit_tests/util/io.cpp @@ -17,7 +17,6 @@ const static std::string IO_TOO_SMALL_FILE = "file_too_small_test_io.tmp"; const static std::string IO_CORRUPT_FINGERPRINT_FILE = "corrupt_fingerprint_file_test_io.tmp"; const static std::string IO_INCOMPATIBLE_FINGERPRINT_FILE = "incompatible_fingerprint_file_test_io.tmp"; -const static std::string IO_TEXT_FILE = "plain_text_file.tmp"; using namespace osrm; From ab519aae79590dc972ebab8a20344401369cda4c Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 30 Sep 2024 20:02:50 +0300 Subject: [PATCH 13/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 7 ++----- conanfile.py | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index a6c44346d..68123cfd9 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -57,15 +57,12 @@ jobs: python3 -m pip install conan==2.7.1 conan profile detect --force - cat ~/.conan2/profiles/default - if [[ "${ENABLE_CONAN}" == "ON" ]]; then - conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 - fi + conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 ls -la - # cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. # cmake --build . --config Release # # TODO: MSVC goes out of memory when building our tests diff --git a/conanfile.py b/conanfile.py index fb5351d50..bd6974634 100644 --- a/conanfile.py +++ b/conanfile.py @@ -12,7 +12,7 @@ class OsrmConan(ConanFile): ) generators = "CMakeDeps" - def requirements(self): + def configure(self): self.options["boost"].without_python = True self.options["boost"].without_coroutine = True From dcd4ddb052c18c9effc8fb3be98bedcbb4f8578e Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 30 Sep 2024 20:25:00 +0300 Subject: [PATCH 14/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 64 +++++++++++++++--------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 68123cfd9..92c1f8a99 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -322,40 +322,40 @@ jobs: ENABLE_CONAN: ON NODE_PACKAGE_TESTS_ONLY: ON - - name: conan-linux-debug-node - build_node_package: true - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TYPE: Debug - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - ENABLE_CONAN: ON - NODE_PACKAGE_TESTS_ONLY: ON + # - name: conan-linux-debug-node + # build_node_package: true + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TYPE: Debug + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # ENABLE_CONAN: ON + # NODE_PACKAGE_TESTS_ONLY: ON - - name: conan-macos-x64-release-node - build_node_package: true - continue-on-error: true - node: 20 - runs-on: macos-13 # x86_64 - BUILD_TYPE: Release - CCOMPILER: clang - CXXCOMPILER: clang++ - CUCUMBER_TIMEOUT: 60000 - ENABLE_ASSERTIONS: ON - ENABLE_CONAN: ON + # - name: conan-macos-x64-release-node + # build_node_package: true + # continue-on-error: true + # node: 20 + # runs-on: macos-13 # x86_64 + # BUILD_TYPE: Release + # CCOMPILER: clang + # CXXCOMPILER: clang++ + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_ASSERTIONS: ON + # ENABLE_CONAN: ON - - name: conan-macos-arm64-release-node - build_node_package: true - continue-on-error: true - node: 20 - runs-on: macos-14 # arm64 - BUILD_TYPE: Release - CCOMPILER: clang - CXXCOMPILER: clang++ - CUCUMBER_TIMEOUT: 60000 - ENABLE_ASSERTIONS: ON - ENABLE_CONAN: ON + # - name: conan-macos-arm64-release-node + # build_node_package: true + # continue-on-error: true + # node: 20 + # runs-on: macos-14 # arm64 + # BUILD_TYPE: Release + # CCOMPILER: clang + # CXXCOMPILER: clang++ + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_ASSERTIONS: ON + # ENABLE_CONAN: ON name: ${{ matrix.name}} continue-on-error: ${{ matrix.continue-on-error }} From 69ef347fe66d4a83a5fc61c1042d06de9bd2af9d Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 30 Sep 2024 20:38:15 +0300 Subject: [PATCH 15/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 92c1f8a99..209cee20c 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -537,7 +537,7 @@ jobs: # sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default if [[ "${ENABLE_CONAN}" == "ON" ]]; then - conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=Debug + conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 #--settings build_type=Release fi ccache --zero-stats From 2293d13c4c9e82d9dd0fa72c4ca45e9d2ff5a89d Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 30 Sep 2024 20:55:34 +0300 Subject: [PATCH 16/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 209cee20c..1ae821831 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -63,7 +63,7 @@ jobs: ls -la cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. - # cmake --build . --config Release + cmake --build . --config Release # # TODO: MSVC goes out of memory when building our tests # # - name: Run tests @@ -537,7 +537,7 @@ jobs: # sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default if [[ "${ENABLE_CONAN}" == "ON" ]]; then - conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 #--settings build_type=Release + conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=${BUILD_TYPE} fi ccache --zero-stats From fec9a42132f15c7fc1f1ba815e35b7f0b1bc028b Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 30 Sep 2024 20:58:43 +0300 Subject: [PATCH 17/73] Migrate to Conan 2.x --- src/benchmarks/CMakeLists.txt | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/benchmarks/CMakeLists.txt b/src/benchmarks/CMakeLists.txt index d2478ab4a..6aec8b6e8 100644 --- a/src/benchmarks/CMakeLists.txt +++ b/src/benchmarks/CMakeLists.txt @@ -13,7 +13,7 @@ target_include_directories(rtree-bench ${PROJECT_SOURCE_DIR}/unit_tests) target_link_libraries(rtree-bench - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -26,7 +26,7 @@ add_executable(match-bench target_link_libraries(match-bench osrm - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -39,7 +39,7 @@ add_executable(route-bench target_link_libraries(route-bench osrm - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -51,7 +51,7 @@ add_executable(bench target_link_libraries(bench osrm - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -63,7 +63,7 @@ add_executable(json-render-bench target_link_libraries(json-render-bench osrm - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -74,7 +74,7 @@ add_executable(alias-bench $) target_link_libraries(alias-bench - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -87,7 +87,7 @@ add_executable(packedvector-bench $) target_link_libraries(packedvector-bench - ${BOOST_BASE_LIBRARIES} + ${BOOST_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) From b7f0a1f482bb8096dbecaed137e92ab9e81bccb9 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 1 Oct 2024 09:02:05 +0300 Subject: [PATCH 18/73] Migrate to Conan 2.x --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a48bae0ac..a41221943 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -605,7 +605,7 @@ JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS) # the link libraries to be written to the pkg-config file. # Conan & TBB define dependencies as CMake targets too, that's why we do the same for them. foreach(engine_lib ${ENGINE_LIBRARIES}) - if("${engine_lib}" MATCHES "^Boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") + if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") else() list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") From f638b0478bf5587fcc41408817d578c4f1894b1a Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 1 Oct 2024 09:09:58 +0300 Subject: [PATCH 19/73] Migrate to Conan 2.x --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a41221943..2c016e626 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -604,13 +604,15 @@ JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS) # Boost uses imported targets, we need to use a generator expression to extract # the link libraries to be written to the pkg-config file. # Conan & TBB define dependencies as CMake targets too, that's why we do the same for them. -foreach(engine_lib ${ENGINE_LIBRARIES}) - if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") - list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") - else() - list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") - endif() -endforeach(engine_lib) +# foreach(engine_lib ${ENGINE_LIBRARIES}) +# message(STATUS "Adding ${engine_lib} to pkg-config dependencies") +# # if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") +# # list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") +# # else() +# # list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") +# # endif() +# endforeach(engine_lib) +# #message(FATAL_ERROR "XXX") JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in pkgconfig.configured @ONLY) From 4f5825f2d1305d884df622b9c209a23f8086ddfb Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 1 Oct 2024 09:57:42 +0300 Subject: [PATCH 20/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 40 +++++++++++++++--------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 1ae821831..005070354 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -270,16 +270,16 @@ jobs: # ENABLE_SANITIZER: ON # ENABLE_LTO: OFF - - name: conan-linux-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - ENABLE_CONAN: ON - ENABLE_LTO: OFF + # - name: conan-linux-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # ENABLE_CONAN: ON + # ENABLE_LTO: OFF # - name: gcc-14-release # continue-on-error: false @@ -322,16 +322,16 @@ jobs: ENABLE_CONAN: ON NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-linux-debug-node - # build_node_package: true - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TYPE: Debug - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # ENABLE_CONAN: ON - # NODE_PACKAGE_TESTS_ONLY: ON + - name: conan-linux-debug-node + build_node_package: true + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TYPE: Debug + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + ENABLE_CONAN: ON + NODE_PACKAGE_TESTS_ONLY: ON # - name: conan-macos-x64-release-node # build_node_package: true From 1d06531a5575d6f5d3495f9d5cb0b9a371c81d35 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 1 Oct 2024 14:54:33 +0300 Subject: [PATCH 21/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 005070354..76bff8747 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -567,13 +567,13 @@ jobs: echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV fi popd - - name: Build example - if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} - run: | - mkdir example/build && pushd example/build - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - make --jobs=${JOBS} - popd + # - name: Build example + # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} + # run: | + # mkdir example/build && pushd example/build + # cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + # make --jobs=${JOBS} + # popd - name: Run all tests if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} run: | From 96543393f782e9acb822cd6be6b07ab4e7ac5406 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 1 Oct 2024 15:08:32 +0300 Subject: [PATCH 22/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 90 +++++++++++++++--------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 76bff8747..0e9d39ead 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -23,47 +23,47 @@ concurrency: cancel-in-progress: true jobs: - windows-release-node: - #needs: format-taginfo-docs - runs-on: windows-2022 - continue-on-error: false - env: - BUILD_TYPE: Release - steps: - - uses: actions/checkout@v4 - - run: cmake --version - - uses: actions/setup-node@v4 - with: - node-version: 18 - - run: node --version - - run: npm --version - - name: Prepare environment - shell: bash - run: | - PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") - echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV - - run: npm install --ignore-scripts - - run: npm link --ignore-scripts - - name: Build - shell: bash - run: | - mkdir build - cd build + # windows-release-node: + # #needs: format-taginfo-docs + # runs-on: windows-2022 + # continue-on-error: false + # env: + # BUILD_TYPE: Release + # steps: + # - uses: actions/checkout@v4 + # - run: cmake --version + # - uses: actions/setup-node@v4 + # with: + # node-version: 18 + # - run: node --version + # - run: npm --version + # - name: Prepare environment + # shell: bash + # run: | + # PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") + # echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV + # - run: npm install --ignore-scripts + # - run: npm link --ignore-scripts + # - name: Build + # shell: bash + # run: | + # mkdir build + # cd build - python3 -m venv .venv + # python3 -m venv .venv - source .venv/Scripts/Activate + # source .venv/Scripts/Activate - python3 -m pip install conan==2.7.1 + # python3 -m pip install conan==2.7.1 - conan profile detect --force + # conan profile detect --force - conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 + # conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 - ls -la + # ls -la - cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. - cmake --build . --config Release + # cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. + # cmake --build . --config Release # # TODO: MSVC goes out of memory when building our tests # # - name: Run tests @@ -333,17 +333,17 @@ jobs: ENABLE_CONAN: ON NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-macos-x64-release-node - # build_node_package: true - # continue-on-error: true - # node: 20 - # runs-on: macos-13 # x86_64 - # BUILD_TYPE: Release - # CCOMPILER: clang - # CXXCOMPILER: clang++ - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_ASSERTIONS: ON - # ENABLE_CONAN: ON + - name: conan-macos-x64-release-node + build_node_package: true + continue-on-error: true + node: 20 + runs-on: macos-13 # x86_64 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_CONAN: ON # - name: conan-macos-arm64-release-node # build_node_package: true From 165853a11463a267da63cd5e293a93afbd9590a0 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 1 Oct 2024 15:33:21 +0300 Subject: [PATCH 23/73] Migrate to Conan 2.x --- conanfile.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index bd6974634..e18fa3201 100644 --- a/conanfile.py +++ b/conanfile.py @@ -15,7 +15,9 @@ class OsrmConan(ConanFile): def configure(self): self.options["boost"].without_python = True self.options["boost"].without_coroutine = True - + self.options["boost"].without_stacktrace = True + self.options["boost"].without_cobalt = True + def generate(self): tc = CMakeToolchain(self) tc.variables["CMAKE_CXX_STANDARD"] = "20" From 822c3731135dd98170933f507af2830b388dc293 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Thu, 3 Oct 2024 20:10:08 +0200 Subject: [PATCH 24/73] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 0e9d39ead..6dec28603 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -579,9 +579,9 @@ jobs: run: | make -C test/data benchmark - # macOS SIP strips the linker path. Reset this inside the running shell - export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }} - ./example/build/osrm-example test/data/mld/monaco.osrm + # # macOS SIP strips the linker path. Reset this inside the running shell + # export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }} + # ./example/build/osrm-example test/data/mld/monaco.osrm # All tests assume to be run from the build directory pushd ${OSRM_BUILD_DIR} From 9ecc91e1e9c9df9380f66c9585434e8a69e0f4a0 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Wed, 9 Oct 2024 21:03:24 +0200 Subject: [PATCH 25/73] wip --- .github/workflows/osrm-backend.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 6dec28603..03c210ba5 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -345,17 +345,17 @@ jobs: ENABLE_ASSERTIONS: ON ENABLE_CONAN: ON - # - name: conan-macos-arm64-release-node - # build_node_package: true - # continue-on-error: true - # node: 20 - # runs-on: macos-14 # arm64 - # BUILD_TYPE: Release - # CCOMPILER: clang - # CXXCOMPILER: clang++ - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_ASSERTIONS: ON - # ENABLE_CONAN: ON + - name: conan-macos-arm64-release-node + build_node_package: true + continue-on-error: true + node: 20 + runs-on: macos-14 # arm64 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_CONAN: ON name: ${{ matrix.name}} continue-on-error: ${{ matrix.continue-on-error }} From 2c40141a7049d0b92a621b769ac8bccc8336c7f2 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 12 Oct 2024 17:17:53 +0200 Subject: [PATCH 26/73] wip --- .github/workflows/osrm-backend.yml | 24 +++--- CMakeLists.txt | 125 +++++++++++++++++------------ 2 files changed, 87 insertions(+), 62 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 03c210ba5..f47ce7003 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -247,16 +247,16 @@ jobs: # CUCUMBER_TIMEOUT: 60000 # ENABLE_LTO: OFF - # - name: clang-16-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-16-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF # - name: conan-linux-debug-asan-ubsan # continue-on-error: false @@ -552,8 +552,8 @@ jobs: -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ -DENABLE_CCACHE=ON \ -DENABLE_LTO=${ENABLE_LTO:-ON} \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake + -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} + make --jobs=${JOBS} if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c016e626..d9a46f9ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,22 @@ cmake_minimum_required(VERSION 3.18) +option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON) +option(BUILD_TOOLS "Build OSRM tools" OFF) +option(BUILD_PACKAGE "Build OSRM package" OFF) +option(BUILD_ROUTED "Build osrm-routed HTTP server" ON) +option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF) +option(ENABLE_DEBUG_LOGGING "Use debug logging in release mode" OFF) +option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF) +option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF) +option(ENABLE_LTO "Use Link Time Optimisation" ON) +option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF) +option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF) +option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF) + +if (ENABLE_CONAN) + set(CMAKE_TOOLCHAIN_FILE "./conan_toolchain.cmake") +endif() + set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) @@ -22,21 +39,6 @@ if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR}) set(ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR}) endif() - -option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON) -option(BUILD_TOOLS "Build OSRM tools" OFF) -option(BUILD_PACKAGE "Build OSRM package" OFF) -option(BUILD_ROUTED "Build osrm-routed HTTP server" ON) -option(ENABLE_ASSERTIONS "Use assertions in release mode" OFF) -option(ENABLE_DEBUG_LOGGING "Use debug logging in release mode" OFF) -option(ENABLE_COVERAGE "Build with coverage instrumentalisation" OFF) -option(ENABLE_SANITIZER "Use memory sanitizer for Debug build" OFF) -option(ENABLE_LTO "Use Link Time Optimisation" ON) -option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF) -option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF) -option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF) - - if (ENABLE_CLANG_TIDY) find_program(CLANG_TIDY_COMMAND NAMES clang-tidy) if(NOT CLANG_TIDY_COMMAND) @@ -322,48 +324,71 @@ if (MSVC) endif() find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) -add_dependency_includes(${Boost_INCLUDE_DIRS}) -#message(FATAL_ERROR "Boost_INCLUDE_DIRS: ${Boost_INCLUDE_DIRS} Boost_LIBRARIES: ${Boost_LIBRARIES}") -set(BOOST_LIBRARIES ${Boost_LIBRARIES}) -# set(BOOST_IN ${Boost_LIBRARIES}) find_package(TBB REQUIRED) -add_dependency_includes(${TBB_INCLUDE_DIR}) -set(TBB_LIBRARIES ${TBB_LIBRARIES}) - find_package(EXPAT REQUIRED) -add_dependency_includes(${EXPAT_INCLUDE_DIRS}) -#message(FATAL_ERROR "EXPAT_INCLUDE_DIRS: ${expat_INCLUDE_DIRS} EXPAT_LIBRARIES: ${expat_LIBRARIES}") -set(EXPAT_LIBRARIES ${expat_LIBRARIES}) -set(EXPAT_INCLUDE_DIRS ${expat_INCLUDE_DIRS}) find_package(BZip2 REQUIRED) -add_dependency_includes(${BZIP2_INCLUDE_DIR}) - find_package(Lua 5.2 REQUIRED) -set(LUA_LIBRARIES lua::lua) -if (LUA_FOUND) - message(STATUS "Using Lua ${LUA_VERSION_STRING}") + +if (ENABLE_CONAN) + add_dependency_includes(${Boost_INCLUDE_DIRS}) + set(BOOST_LIBRARIES ${Boost_LIBRARIES}) + + add_dependency_includes(${TBB_INCLUDE_DIR}) + set(TBB_LIBRARIES ${TBB_LIBRARIES}) + + add_dependency_includes(${EXPAT_INCLUDE_DIRS}) + set(EXPAT_LIBRARIES ${expat_LIBRARIES}) + set(EXPAT_INCLUDE_DIRS ${expat_INCLUDE_DIRS}) + + add_dependency_includes(${BZIP2_INCLUDE_DIR}) + + set(LUA_LIBRARIES lua::lua) + if (LUA_FOUND) + message(STATUS "Using Lua ${LUA_VERSION_STRING}") + endif() + + add_dependency_includes(${lua_INCLUDE_DIRS}) + + # note: we avoid calling find_package(Osmium ...) here to ensure that the + # expat and bzip2 are used from conan rather than the system + include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include) +else() + add_dependency_includes(${Boost_INCLUDE_DIRS}) + add_dependency_includes(${TBB_INCLUDE_DIR}) + add_dependency_includes(${EXPAT_INCLUDE_DIRS}) + add_dependency_includes(${BZIP2_INCLUDE_DIR}) + add_dependency_includes(${LUA_INCLUDE_DIR}) + + set(TBB_LIBRARIES TBB::tbb) + + set(BOOST_LIBRARIES + ${Boost_DATE_TIME_LIBRARY} + ${Boost_IOSTREAMS_LIBRARY} + ${Boost_THREAD_LIBRARY} + ${Boost_ZLIB_LIBRARY} + ${Boost_REGEX_LIBRARY} + ) + + # add a target to generate API documentation with Doxygen + find_package(Doxygen) + if(DOXYGEN_FOUND) + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) + add_custom_target(doc + ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" VERBATIM + ) + endif() + # note libosmium depends on expat and bzip2 + list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake") + if(NOT OSMIUM_INCLUDE_DIR) + set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include") + endif() + find_package(Osmium REQUIRED COMPONENTS io) + include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR}) endif() -add_dependency_includes(${lua_INCLUDE_DIRS}) -# add a target to generate API documentation with Doxygen -find_package(Doxygen) -if(DOXYGEN_FOUND) -configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile @ONLY) -add_custom_target(doc -${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile -WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} -COMMENT "Generating API documentation with Doxygen" VERBATIM -) -endif() - -# note libosmium depends on expat and bzip2 -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/cmake") -if(NOT OSMIUM_INCLUDE_DIR) - set(OSMIUM_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include") -endif() -find_package(Osmium REQUIRED COMPONENTS io) -include_directories(SYSTEM ${OSMIUM_INCLUDE_DIR}) # prefix compilation with ccache by default if available and on clang or gcc if(ENABLE_CCACHE AND (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "GNU")) From e578e6d912d29a8ae2616aa63b04091e854ac4c4 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 12 Oct 2024 18:19:50 +0200 Subject: [PATCH 27/73] wip --- .github/workflows/osrm-backend.yml | 222 ++++++++++++++--------------- 1 file changed, 111 insertions(+), 111 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index f47ce7003..5fa4ace52 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -177,75 +177,75 @@ jobs: strategy: matrix: include: - # - name: gcc-13-debug-cov - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: gcc-13 - # CUCUMBER_TIMEOUT: 20000 - # CXXCOMPILER: g++-13 - # ENABLE_COVERAGE: ON + - name: gcc-13-debug-cov + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: gcc-13 + CUCUMBER_TIMEOUT: 20000 + CXXCOMPILER: g++-13 + ENABLE_COVERAGE: ON - # - name: clang-18-debug-asan-ubsan - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CUCUMBER_TIMEOUT: 20000 - # CXXCOMPILER: clang++-18 - # ENABLE_SANITIZER: ON - # TARGET_ARCH: x86_64-asan-ubsan - # OSRM_CONNECTION_RETRIES: 10 - # OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 + - name: clang-18-debug-asan-ubsan + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CUCUMBER_TIMEOUT: 20000 + CXXCOMPILER: clang++-18 + ENABLE_SANITIZER: ON + TARGET_ARCH: x86_64-asan-ubsan + OSRM_CONNECTION_RETRIES: 10 + OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 - # - name: clang-18-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-18-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-18-debug - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-18-debug + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-18-debug-clang-tidy - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_CLANG_TIDY: ON + - name: clang-18-debug-clang-tidy + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_CLANG_TIDY: ON - # - name: clang-17-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-17 - # CXXCOMPILER: clang++-17 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-17-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-17 + CXXCOMPILER: clang++-17 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - name: clang-16-release continue-on-error: false @@ -258,58 +258,58 @@ jobs: CUCUMBER_TIMEOUT: 60000 ENABLE_LTO: OFF - # - name: conan-linux-debug-asan-ubsan - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # ENABLE_CONAN: ON - # ENABLE_SANITIZER: ON - # ENABLE_LTO: OFF + - name: conan-linux-debug-asan-ubsan + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + ENABLE_CONAN: ON + ENABLE_SANITIZER: ON + ENABLE_LTO: OFF - # - name: conan-linux-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # ENABLE_CONAN: ON - # ENABLE_LTO: OFF + - name: conan-linux-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + ENABLE_CONAN: ON + ENABLE_LTO: OFF - # - name: gcc-14-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-14 - # CXXCOMPILER: g++-14 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-14-release + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-14 + CXXCOMPILER: g++-14 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: gcc-13-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-13 - # CXXCOMPILER: g++-13 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-13-release + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-13 + CXXCOMPILER: g++-13 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: gcc-12-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-22.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-12 - # CXXCOMPILER: g++-12 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-12-release + continue-on-error: false + node: 20 + runs-on: ubuntu-22.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-12 + CXXCOMPILER: g++-12 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - name: conan-linux-release-node build_node_package: true From cbed6bd44d6b78584db35fd2367c0cdb49d18d61 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 12 Oct 2024 18:47:40 +0200 Subject: [PATCH 28/73] wip --- .github/workflows/osrm-backend.yml | 56 +++++++++++++++--------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 5fa4ace52..a2597822d 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -387,34 +387,34 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - - name: Enable Node.js cache - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Enable compiler cache - uses: actions/cache@v4 - with: - path: ~/.ccache - key: ccache-${{ matrix.name }}-${{ github.sha }} - restore-keys: | - ccache-${{ matrix.name }}- - - name: Enable Conan cache - uses: actions/cache@v4 - with: - path: ~/.conan2 - key: v10-conan-${{ matrix.name }}-${{ github.sha }} - restore-keys: | - v10-conan-${{ matrix.name }}- - - name: Enable test cache - uses: actions/cache@v4 - with: - path: ${{github.workspace}}/test/cache - key: v4-test-${{ matrix.name }}-${{ github.sha }} - restore-keys: | - v4-test-${{ matrix.name }}- + # - name: Enable Node.js cache + # uses: actions/cache@v4 + # with: + # path: ~/.npm + # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + # restore-keys: | + # ${{ runner.os }}-node- + # - name: Enable compiler cache + # uses: actions/cache@v4 + # with: + # path: ~/.ccache + # key: ccache-${{ matrix.name }}-${{ github.sha }} + # restore-keys: | + # ccache-${{ matrix.name }}- + # - name: Enable Conan cache + # uses: actions/cache@v4 + # with: + # path: ~/.conan2 + # key: v10-conan-${{ matrix.name }}-${{ github.sha }} + # restore-keys: | + # v10-conan-${{ matrix.name }}- + # - name: Enable test cache + # uses: actions/cache@v4 + # with: + # path: ${{github.workspace}}/test/cache + # key: v4-test-${{ matrix.name }}-${{ github.sha }} + # restore-keys: | + # v4-test-${{ matrix.name }}- - name: Prepare environment run: | echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV From 6ec17cfd95eede8c7034b7056483826a1c12c7e8 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 12 Oct 2024 18:57:30 +0200 Subject: [PATCH 29/73] wip --- unit_tests/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index 217faa133..b9cd5f922 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -126,6 +126,10 @@ add_executable(util-tests ${UtilTestsSources} $ $) +if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS AND NOT ENABLE_CONAN) + add_definitions(-DBOOST_TEST_DYN_LINK) +endif() + set(UPDATER_TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/unit_tests/updater") set(TEST_DATA_DIR "${CMAKE_SOURCE_DIR}/test/data") add_dependencies(library-tests osrm-extract osrm-contract osrm-partition) From 4897275562e9d33287b1b8c720c6adf7a821db7c Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 12 Oct 2024 21:38:27 +0200 Subject: [PATCH 30/73] wip --- .github/workflows/osrm-backend.yml | 302 ++++++++++++++--------------- CMakeLists.txt | 17 +- 2 files changed, 160 insertions(+), 159 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index a2597822d..3193b0889 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -177,98 +177,98 @@ jobs: strategy: matrix: include: - - name: gcc-13-debug-cov - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: gcc-13 - CUCUMBER_TIMEOUT: 20000 - CXXCOMPILER: g++-13 - ENABLE_COVERAGE: ON + # - name: gcc-13-debug-cov + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: gcc-13 + # CUCUMBER_TIMEOUT: 20000 + # CXXCOMPILER: g++-13 + # ENABLE_COVERAGE: ON - - name: clang-18-debug-asan-ubsan - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CUCUMBER_TIMEOUT: 20000 - CXXCOMPILER: clang++-18 - ENABLE_SANITIZER: ON - TARGET_ARCH: x86_64-asan-ubsan - OSRM_CONNECTION_RETRIES: 10 - OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 + # - name: clang-18-debug-asan-ubsan + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CUCUMBER_TIMEOUT: 20000 + # CXXCOMPILER: clang++-18 + # ENABLE_SANITIZER: ON + # TARGET_ARCH: x86_64-asan-ubsan + # OSRM_CONNECTION_RETRIES: 10 + # OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 - - name: clang-18-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-18-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-18-debug - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-18-debug + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-18-debug-clang-tidy - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_CLANG_TIDY: ON + # - name: clang-18-debug-clang-tidy + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_CLANG_TIDY: ON - - name: clang-17-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-17 - CXXCOMPILER: clang++-17 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-17-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-17 + # CXXCOMPILER: clang++-17 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-16-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-16-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: conan-linux-debug-asan-ubsan - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - ENABLE_CONAN: ON - ENABLE_SANITIZER: ON - ENABLE_LTO: OFF + # - name: conan-linux-debug-asan-ubsan + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # ENABLE_CONAN: ON + # ENABLE_SANITIZER: ON + # ENABLE_LTO: OFF - name: conan-linux-release continue-on-error: false @@ -291,71 +291,71 @@ jobs: CXXCOMPILER: g++-14 CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: gcc-13-release - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-13 - CXXCOMPILER: g++-13 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-13-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-13 + # CXXCOMPILER: g++-13 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: gcc-12-release - continue-on-error: false - node: 20 - runs-on: ubuntu-22.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-12 - CXXCOMPILER: g++-12 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-12-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-22.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-12 + # CXXCOMPILER: g++-12 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: conan-linux-release-node - build_node_package: true - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TYPE: Release - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - ENABLE_CONAN: ON - NODE_PACKAGE_TESTS_ONLY: ON + # - name: conan-linux-release-node + # build_node_package: true + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TYPE: Release + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # ENABLE_CONAN: ON + # NODE_PACKAGE_TESTS_ONLY: ON - - name: conan-linux-debug-node - build_node_package: true - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TYPE: Debug - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - ENABLE_CONAN: ON - NODE_PACKAGE_TESTS_ONLY: ON + # - name: conan-linux-debug-node + # build_node_package: true + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TYPE: Debug + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # ENABLE_CONAN: ON + # NODE_PACKAGE_TESTS_ONLY: ON - - name: conan-macos-x64-release-node - build_node_package: true - continue-on-error: true - node: 20 - runs-on: macos-13 # x86_64 - BUILD_TYPE: Release - CCOMPILER: clang - CXXCOMPILER: clang++ - CUCUMBER_TIMEOUT: 60000 - ENABLE_ASSERTIONS: ON - ENABLE_CONAN: ON + # - name: conan-macos-x64-release-node + # build_node_package: true + # continue-on-error: true + # node: 20 + # runs-on: macos-13 # x86_64 + # BUILD_TYPE: Release + # CCOMPILER: clang + # CXXCOMPILER: clang++ + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_ASSERTIONS: ON + # ENABLE_CONAN: ON - - name: conan-macos-arm64-release-node - build_node_package: true - continue-on-error: true - node: 20 - runs-on: macos-14 # arm64 - BUILD_TYPE: Release - CCOMPILER: clang - CXXCOMPILER: clang++ - CUCUMBER_TIMEOUT: 60000 - ENABLE_ASSERTIONS: ON - ENABLE_CONAN: ON + # - name: conan-macos-arm64-release-node + # build_node_package: true + # continue-on-error: true + # node: 20 + # runs-on: macos-14 # arm64 + # BUILD_TYPE: Release + # CCOMPILER: clang + # CXXCOMPILER: clang++ + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_ASSERTIONS: ON + # ENABLE_CONAN: ON name: ${{ matrix.name}} continue-on-error: ${{ matrix.continue-on-error }} @@ -567,13 +567,13 @@ jobs: echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV fi popd - # - name: Build example - # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} - # run: | - # mkdir example/build && pushd example/build - # cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - # make --jobs=${JOBS} - # popd + - name: Build example + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} + run: | + mkdir example/build && pushd example/build + cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + make --jobs=${JOBS} + popd - name: Run all tests if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} run: | diff --git a/CMakeLists.txt b/CMakeLists.txt index d9a46f9ad..90558d5ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -629,14 +629,15 @@ JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS) # Boost uses imported targets, we need to use a generator expression to extract # the link libraries to be written to the pkg-config file. # Conan & TBB define dependencies as CMake targets too, that's why we do the same for them. -# foreach(engine_lib ${ENGINE_LIBRARIES}) -# message(STATUS "Adding ${engine_lib} to pkg-config dependencies") -# # if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") -# # list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") -# # else() -# # list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") -# # endif() -# endforeach(engine_lib) +foreach(engine_lib ${ENGINE_LIBRARIES}) + message(STATUS "Adding ${engine_lib} to pkg-config dependencies") + # if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") + # list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") + # else() + # list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") + # endif() + list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") +endforeach(engine_lib) # #message(FATAL_ERROR "XXX") JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) From b76dbfb9cc799f6b5ce2d28ed0972388412537ed Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 12 Oct 2024 22:14:29 +0200 Subject: [PATCH 31/73] wip --- .github/workflows/osrm-backend.yml | 2 +- CMakeLists.txt | 20 +- cmake/conan.cmake | 1026 ---------------------------- 3 files changed, 8 insertions(+), 1040 deletions(-) delete mode 100644 cmake/conan.cmake diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 3193b0889..dd4483b9a 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -568,7 +568,7 @@ jobs: fi popd - name: Build example - if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_CONAN != 'ON' }} run: | mkdir example/build && pushd example/build cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} diff --git a/CMakeLists.txt b/CMakeLists.txt index 90558d5ab..2595fe265 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -332,7 +332,6 @@ find_package(Lua 5.2 REQUIRED) if (ENABLE_CONAN) add_dependency_includes(${Boost_INCLUDE_DIRS}) set(BOOST_LIBRARIES ${Boost_LIBRARIES}) - add_dependency_includes(${TBB_INCLUDE_DIR}) set(TBB_LIBRARIES ${TBB_LIBRARIES}) @@ -626,20 +625,15 @@ list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}") list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}/osrm") JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS) -# Boost uses imported targets, we need to use a generator expression to extract -# the link libraries to be written to the pkg-config file. -# Conan & TBB define dependencies as CMake targets too, that's why we do the same for them. +# # Boost uses imported targets, we need to use a generator expression to extract +# # the link libraries to be written to the pkg-config file. +# # Conan & TBB define dependencies as CMake targets too, that's why we do the same for them. foreach(engine_lib ${ENGINE_LIBRARIES}) - message(STATUS "Adding ${engine_lib} to pkg-config dependencies") - # if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") - # list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") - # else() - # list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") - # endif() - list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") + message(STATUS "Adding ${engine_lib} to pkg-config dependencies ") + list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") endforeach(engine_lib) -# #message(FATAL_ERROR "XXX") -JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) +#message(FATAL_ERROR "XXX") +# JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in pkgconfig.configured @ONLY) file(GENERATE diff --git a/cmake/conan.cmake b/cmake/conan.cmake deleted file mode 100644 index 7c78f7415..000000000 --- a/cmake/conan.cmake +++ /dev/null @@ -1,1026 +0,0 @@ -# The MIT License (MIT) - -# Copyright (c) 2018 JFrog - -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: - -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. - -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - - - -# This file comes from: https://github.com/conan-io/cmake-conan. Please refer -# to this repository for issues and documentation. - -# Its purpose is to wrap and launch Conan C/C++ Package Manager when cmake is called. -# It will take CMake current settings (os, compiler, compiler version, architecture) -# and translate them to conan settings for installing and retrieving dependencies. - -# It is intended to facilitate developers building projects that have conan dependencies, -# but it is only necessary on the end-user side. It is not necessary to create conan -# packages, in fact it shouldn't be use for that. Check the project documentation. - -# version: 0.18.1 - -include(CMakeParseArguments) - -function(_get_msvc_ide_version result) - set(${result} "" PARENT_SCOPE) - if(NOT MSVC_VERSION VERSION_LESS 1400 AND MSVC_VERSION VERSION_LESS 1500) - set(${result} 8 PARENT_SCOPE) - elseif(NOT MSVC_VERSION VERSION_LESS 1500 AND MSVC_VERSION VERSION_LESS 1600) - set(${result} 9 PARENT_SCOPE) - elseif(NOT MSVC_VERSION VERSION_LESS 1600 AND MSVC_VERSION VERSION_LESS 1700) - set(${result} 10 PARENT_SCOPE) - elseif(NOT MSVC_VERSION VERSION_LESS 1700 AND MSVC_VERSION VERSION_LESS 1800) - set(${result} 11 PARENT_SCOPE) - elseif(NOT MSVC_VERSION VERSION_LESS 1800 AND MSVC_VERSION VERSION_LESS 1900) - set(${result} 12 PARENT_SCOPE) - elseif(NOT MSVC_VERSION VERSION_LESS 1900 AND MSVC_VERSION VERSION_LESS 1910) - set(${result} 14 PARENT_SCOPE) - elseif(NOT MSVC_VERSION VERSION_LESS 1910 AND MSVC_VERSION VERSION_LESS 1920) - set(${result} 15 PARENT_SCOPE) - elseif(NOT MSVC_VERSION VERSION_LESS 1920 AND MSVC_VERSION VERSION_LESS 1930) - set(${result} 16 PARENT_SCOPE) - elseif(NOT MSVC_VERSION VERSION_LESS 1930 AND MSVC_VERSION VERSION_LESS 1950) - set(${result} 17 PARENT_SCOPE) - else() - message(FATAL_ERROR "Conan: Unknown MSVC compiler version [${MSVC_VERSION}]") - endif() -endfunction() - -macro(_conan_detect_build_type) - conan_parse_arguments(${ARGV}) - - if(ARGUMENTS_BUILD_TYPE) - set(_CONAN_SETTING_BUILD_TYPE ${ARGUMENTS_BUILD_TYPE}) - elseif(CMAKE_BUILD_TYPE) - set(_CONAN_SETTING_BUILD_TYPE ${CMAKE_BUILD_TYPE}) - else() - message(FATAL_ERROR "Please specify in command line CMAKE_BUILD_TYPE (-DCMAKE_BUILD_TYPE=Release)") - endif() - - string(TOUPPER ${_CONAN_SETTING_BUILD_TYPE} _CONAN_SETTING_BUILD_TYPE_UPPER) - if (_CONAN_SETTING_BUILD_TYPE_UPPER STREQUAL "DEBUG") - set(_CONAN_SETTING_BUILD_TYPE "Debug") - elseif(_CONAN_SETTING_BUILD_TYPE_UPPER STREQUAL "RELEASE") - set(_CONAN_SETTING_BUILD_TYPE "Release") - elseif(_CONAN_SETTING_BUILD_TYPE_UPPER STREQUAL "RELWITHDEBINFO") - set(_CONAN_SETTING_BUILD_TYPE "RelWithDebInfo") - elseif(_CONAN_SETTING_BUILD_TYPE_UPPER STREQUAL "MINSIZEREL") - set(_CONAN_SETTING_BUILD_TYPE "MinSizeRel") - endif() -endmacro() - -macro(_conan_check_system_name) - #handle -s os setting - if(CMAKE_SYSTEM_NAME AND NOT CMAKE_SYSTEM_NAME STREQUAL "Generic") - #use default conan os setting if CMAKE_SYSTEM_NAME is not defined - set(CONAN_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}) - if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") - set(CONAN_SYSTEM_NAME Macos) - endif() - if(${CMAKE_SYSTEM_NAME} STREQUAL "QNX") - set(CONAN_SYSTEM_NAME Neutrino) - endif() - set(CONAN_SUPPORTED_PLATFORMS Windows Linux Macos Android iOS FreeBSD WindowsStore WindowsCE watchOS tvOS FreeBSD SunOS AIX Arduino Emscripten Neutrino) - list (FIND CONAN_SUPPORTED_PLATFORMS "${CONAN_SYSTEM_NAME}" _index) - if (${_index} GREATER -1) - #check if the cmake system is a conan supported one - set(_CONAN_SETTING_OS ${CONAN_SYSTEM_NAME}) - else() - message(FATAL_ERROR "cmake system ${CONAN_SYSTEM_NAME} is not supported by conan. Use one of ${CONAN_SUPPORTED_PLATFORMS}") - endif() - endif() -endmacro() - -macro(_conan_check_language) - get_property(_languages GLOBAL PROPERTY ENABLED_LANGUAGES) - if (";${_languages};" MATCHES ";CXX;") - set(LANGUAGE CXX) - set(USING_CXX 1) - elseif (";${_languages};" MATCHES ";C;") - set(LANGUAGE C) - set(USING_CXX 0) - else () - message(FATAL_ERROR "Conan: Neither C or C++ was detected as a language for the project. Unabled to detect compiler version.") - endif() -endmacro() - -macro(_conan_detect_compiler) - - conan_parse_arguments(${ARGV}) - - if(ARGUMENTS_ARCH) - set(_CONAN_SETTING_ARCH ${ARGUMENTS_ARCH}) - endif() - - if(USING_CXX) - set(_CONAN_SETTING_COMPILER_CPPSTD ${CMAKE_CXX_STANDARD}) - endif() - - if (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL GNU) - # using GCC - # TODO: Handle other params - string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION}) - list(GET VERSION_LIST 0 MAJOR) - list(GET VERSION_LIST 1 MINOR) - set(COMPILER_VERSION ${MAJOR}.${MINOR}) - if(${MAJOR} GREATER 4) - set(COMPILER_VERSION ${MAJOR}) - endif() - set(_CONAN_SETTING_COMPILER gcc) - set(_CONAN_SETTING_COMPILER_VERSION ${COMPILER_VERSION}) - if (USING_CXX) - conan_cmake_detect_unix_libcxx(_LIBCXX) - set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX}) - endif () - elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Intel) - string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION}) - list(GET VERSION_LIST 0 MAJOR) - list(GET VERSION_LIST 1 MINOR) - set(COMPILER_VERSION ${MAJOR}.${MINOR}) - set(_CONAN_SETTING_COMPILER intel) - set(_CONAN_SETTING_COMPILER_VERSION ${COMPILER_VERSION}) - if (USING_CXX) - conan_cmake_detect_unix_libcxx(_LIBCXX) - set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX}) - endif () - elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL AppleClang) - # using AppleClang - string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION}) - list(GET VERSION_LIST 0 MAJOR) - list(GET VERSION_LIST 1 MINOR) - set(_CONAN_SETTING_COMPILER apple-clang) - set(_CONAN_SETTING_COMPILER_VERSION ${MAJOR}.${MINOR}) - if (USING_CXX) - conan_cmake_detect_unix_libcxx(_LIBCXX) - set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX}) - endif () - elseif (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang - AND NOT "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC" - AND NOT "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC") - - string(REPLACE "." ";" VERSION_LIST ${CMAKE_${LANGUAGE}_COMPILER_VERSION}) - list(GET VERSION_LIST 0 MAJOR) - list(GET VERSION_LIST 1 MINOR) - set(_CONAN_SETTING_COMPILER clang) - set(_CONAN_SETTING_COMPILER_VERSION ${MAJOR}.${MINOR}) - if(APPLE) - cmake_policy(GET CMP0025 APPLE_CLANG_POLICY) - if(NOT APPLE_CLANG_POLICY STREQUAL NEW) - message(STATUS "Conan: APPLE and Clang detected. Assuming apple-clang compiler. Set CMP0025 to avoid it") - set(_CONAN_SETTING_COMPILER apple-clang) - endif() - endif() - if(${_CONAN_SETTING_COMPILER} STREQUAL clang AND ${MAJOR} GREATER 7) - set(_CONAN_SETTING_COMPILER_VERSION ${MAJOR}) - endif() - if (USING_CXX) - conan_cmake_detect_unix_libcxx(_LIBCXX) - set(_CONAN_SETTING_COMPILER_LIBCXX ${_LIBCXX}) - endif () - elseif(${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL MSVC - OR (${CMAKE_${LANGUAGE}_COMPILER_ID} STREQUAL Clang - AND "${CMAKE_${LANGUAGE}_COMPILER_FRONTEND_VARIANT}" STREQUAL "MSVC" - AND "${CMAKE_${LANGUAGE}_SIMULATE_ID}" STREQUAL "MSVC")) - - set(_VISUAL "Visual Studio") - _get_msvc_ide_version(_VISUAL_VERSION) - if("${_VISUAL_VERSION}" STREQUAL "") - message(FATAL_ERROR "Conan: Visual Studio not recognized") - else() - set(_CONAN_SETTING_COMPILER ${_VISUAL}) - set(_CONAN_SETTING_COMPILER_VERSION ${_VISUAL_VERSION}) - endif() - - if(NOT _CONAN_SETTING_ARCH) - if (MSVC_${LANGUAGE}_ARCHITECTURE_ID MATCHES "64") - set(_CONAN_SETTING_ARCH x86_64) - elseif (MSVC_${LANGUAGE}_ARCHITECTURE_ID MATCHES "^ARM") - message(STATUS "Conan: Using default ARM architecture from MSVC") - set(_CONAN_SETTING_ARCH armv6) - elseif (MSVC_${LANGUAGE}_ARCHITECTURE_ID MATCHES "86") - set(_CONAN_SETTING_ARCH x86) - else () - message(FATAL_ERROR "Conan: Unknown MSVC architecture [${MSVC_${LANGUAGE}_ARCHITECTURE_ID}]") - endif() - endif() - - conan_cmake_detect_vs_runtime(_vs_runtime ${ARGV}) - message(STATUS "Conan: Detected VS runtime: ${_vs_runtime}") - set(_CONAN_SETTING_COMPILER_RUNTIME ${_vs_runtime}) - - if (CMAKE_GENERATOR_TOOLSET) - set(_CONAN_SETTING_COMPILER_TOOLSET ${CMAKE_VS_PLATFORM_TOOLSET}) - elseif(CMAKE_VS_PLATFORM_TOOLSET AND (CMAKE_GENERATOR STREQUAL "Ninja")) - set(_CONAN_SETTING_COMPILER_TOOLSET ${CMAKE_VS_PLATFORM_TOOLSET}) - endif() - else() - message(FATAL_ERROR "Conan: compiler setup not recognized") - endif() - -endmacro() - -function(conan_cmake_settings result) - #message(STATUS "COMPILER " ${CMAKE_CXX_COMPILER}) - #message(STATUS "COMPILER " ${CMAKE_CXX_COMPILER_ID}) - #message(STATUS "VERSION " ${CMAKE_CXX_COMPILER_VERSION}) - #message(STATUS "FLAGS " ${CMAKE_LANG_FLAGS}) - #message(STATUS "LIB ARCH " ${CMAKE_CXX_LIBRARY_ARCHITECTURE}) - #message(STATUS "BUILD TYPE " ${CMAKE_BUILD_TYPE}) - #message(STATUS "GENERATOR " ${CMAKE_GENERATOR}) - #message(STATUS "GENERATOR WIN64 " ${CMAKE_CL_64}) - - message(STATUS "Conan: Automatic detection of conan settings from cmake") - - conan_parse_arguments(${ARGV}) - - _conan_detect_build_type(${ARGV}) - - _conan_check_system_name() - - _conan_check_language() - - _conan_detect_compiler(${ARGV}) - - # If profile is defined it is used - if(CMAKE_BUILD_TYPE STREQUAL "Debug" AND ARGUMENTS_DEBUG_PROFILE) - set(_APPLIED_PROFILES ${ARGUMENTS_DEBUG_PROFILE}) - elseif(CMAKE_BUILD_TYPE STREQUAL "Release" AND ARGUMENTS_RELEASE_PROFILE) - set(_APPLIED_PROFILES ${ARGUMENTS_RELEASE_PROFILE}) - elseif(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo" AND ARGUMENTS_RELWITHDEBINFO_PROFILE) - set(_APPLIED_PROFILES ${ARGUMENTS_RELWITHDEBINFO_PROFILE}) - elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel" AND ARGUMENTS_MINSIZEREL_PROFILE) - set(_APPLIED_PROFILES ${ARGUMENTS_MINSIZEREL_PROFILE}) - elseif(ARGUMENTS_PROFILE) - set(_APPLIED_PROFILES ${ARGUMENTS_PROFILE}) - endif() - - foreach(ARG ${_APPLIED_PROFILES}) - set(_SETTINGS ${_SETTINGS} -pr=${ARG}) - endforeach() - foreach(ARG ${ARGUMENTS_PROFILE_BUILD}) - conan_check(VERSION 1.24.0 REQUIRED DETECT_QUIET) - set(_SETTINGS ${_SETTINGS} -pr:b=${ARG}) - endforeach() - - if(NOT _SETTINGS OR ARGUMENTS_PROFILE_AUTO STREQUAL "ALL") - set(ARGUMENTS_PROFILE_AUTO arch build_type compiler compiler.version - compiler.runtime compiler.libcxx compiler.toolset) - endif() - - # remove any manually specified settings from the autodetected settings - foreach(ARG ${ARGUMENTS_SETTINGS}) - string(REGEX MATCH "[^=]*" MANUAL_SETTING "${ARG}") - message(STATUS "Conan: ${MANUAL_SETTING} was added as an argument. Not using the autodetected one.") - list(REMOVE_ITEM ARGUMENTS_PROFILE_AUTO "${MANUAL_SETTING}") - endforeach() - - # Automatic from CMake - foreach(ARG ${ARGUMENTS_PROFILE_AUTO}) - string(TOUPPER ${ARG} _arg_name) - string(REPLACE "." "_" _arg_name ${_arg_name}) - if(_CONAN_SETTING_${_arg_name}) - set(_SETTINGS ${_SETTINGS} -s ${ARG}=${_CONAN_SETTING_${_arg_name}}) - endif() - endforeach() - - foreach(ARG ${ARGUMENTS_SETTINGS}) - set(_SETTINGS ${_SETTINGS} -s ${ARG}) - endforeach() - - message(STATUS "Conan: Settings= ${_SETTINGS}") - - set(${result} ${_SETTINGS} PARENT_SCOPE) -endfunction() - - -function(conan_cmake_detect_unix_libcxx result) - # Take into account any -stdlib in compile options - get_directory_property(compile_options DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_OPTIONS) - string(GENEX_STRIP "${compile_options}" compile_options) - - # Take into account any _GLIBCXX_USE_CXX11_ABI in compile definitions - get_directory_property(defines DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMPILE_DEFINITIONS) - string(GENEX_STRIP "${defines}" defines) - - foreach(define ${defines}) - if(define MATCHES "_GLIBCXX_USE_CXX11_ABI") - if(define MATCHES "^-D") - set(compile_options ${compile_options} "${define}") - else() - set(compile_options ${compile_options} "-D${define}") - endif() - endif() - endforeach() - - # add additional compiler options ala cmRulePlaceholderExpander::ExpandRuleVariable - set(EXPAND_CXX_COMPILER ${CMAKE_CXX_COMPILER}) - if(CMAKE_CXX_COMPILER_ARG1) - # CMake splits CXX="foo bar baz" into CMAKE_CXX_COMPILER="foo", CMAKE_CXX_COMPILER_ARG1="bar baz" - # without this, ccache, winegcc, or other wrappers might lose all their arguments - separate_arguments(SPLIT_CXX_COMPILER_ARG1 NATIVE_COMMAND ${CMAKE_CXX_COMPILER_ARG1}) - list(APPEND EXPAND_CXX_COMPILER ${SPLIT_CXX_COMPILER_ARG1}) - endif() - - if(CMAKE_CXX_COMPILE_OPTIONS_TARGET AND CMAKE_CXX_COMPILER_TARGET) - # without --target= we may be calling the wrong underlying GCC - list(APPEND EXPAND_CXX_COMPILER "${CMAKE_CXX_COMPILE_OPTIONS_TARGET}${CMAKE_CXX_COMPILER_TARGET}") - endif() - - if(CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN AND CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN) - list(APPEND EXPAND_CXX_COMPILER "${CMAKE_CXX_COMPILE_OPTIONS_EXTERNAL_TOOLCHAIN}${CMAKE_CXX_COMPILER_EXTERNAL_TOOLCHAIN}") - endif() - - if(CMAKE_CXX_COMPILE_OPTIONS_SYSROOT) - # without --sysroot= we may find the wrong #include - if(CMAKE_SYSROOT_COMPILE) - list(APPEND EXPAND_CXX_COMPILER "${CMAKE_CXX_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT_COMPILE}") - elseif(CMAKE_SYSROOT) - list(APPEND EXPAND_CXX_COMPILER "${CMAKE_CXX_COMPILE_OPTIONS_SYSROOT}${CMAKE_SYSROOT}") - endif() - endif() - - separate_arguments(SPLIT_CXX_FLAGS NATIVE_COMMAND ${CMAKE_CXX_FLAGS}) - - if(CMAKE_OSX_SYSROOT) - set(xcode_sysroot_option "--sysroot=${CMAKE_OSX_SYSROOT}") - endif() - - execute_process( - COMMAND ${CMAKE_COMMAND} -E echo "#include " - COMMAND ${EXPAND_CXX_COMPILER} ${SPLIT_CXX_FLAGS} -x c++ ${xcode_sysroot_option} ${compile_options} -E -dM - - OUTPUT_VARIABLE string_defines - ) - - if(string_defines MATCHES "#define __GLIBCXX__") - # Allow -D_GLIBCXX_USE_CXX11_ABI=ON/OFF as argument to cmake - if(DEFINED _GLIBCXX_USE_CXX11_ABI) - if(_GLIBCXX_USE_CXX11_ABI) - set(${result} libstdc++11 PARENT_SCOPE) - return() - else() - set(${result} libstdc++ PARENT_SCOPE) - return() - endif() - endif() - - if(string_defines MATCHES "#define _GLIBCXX_USE_CXX11_ABI 1\n") - set(${result} libstdc++11 PARENT_SCOPE) - else() - # Either the compiler is missing the define because it is old, and so - # it can't use the new abi, or the compiler was configured to use the - # old abi by the user or distro (e.g. devtoolset on RHEL/CentOS) - set(${result} libstdc++ PARENT_SCOPE) - endif() - else() - set(${result} libc++ PARENT_SCOPE) - endif() -endfunction() - -function(conan_cmake_detect_vs_runtime result) - - conan_parse_arguments(${ARGV}) - if(ARGUMENTS_BUILD_TYPE) - set(build_type "${ARGUMENTS_BUILD_TYPE}") - elseif(CMAKE_BUILD_TYPE) - set(build_type "${CMAKE_BUILD_TYPE}") - else() - message(FATAL_ERROR "Please specify in command line CMAKE_BUILD_TYPE (-DCMAKE_BUILD_TYPE=Release)") - endif() - - if(build_type) - string(TOUPPER "${build_type}" build_type) - endif() - set(variables CMAKE_CXX_FLAGS_${build_type} CMAKE_C_FLAGS_${build_type} CMAKE_CXX_FLAGS CMAKE_C_FLAGS) - foreach(variable ${variables}) - if(NOT "${${variable}}" STREQUAL "") - string(REPLACE " " ";" flags "${${variable}}") - foreach (flag ${flags}) - if("${flag}" STREQUAL "/MD" OR "${flag}" STREQUAL "/MDd" OR "${flag}" STREQUAL "/MT" OR "${flag}" STREQUAL "/MTd") - string(SUBSTRING "${flag}" 1 -1 runtime) - set(${result} "${runtime}" PARENT_SCOPE) - return() - endif() - endforeach() - endif() - endforeach() - if("${build_type}" STREQUAL "DEBUG") - set(${result} "MDd" PARENT_SCOPE) - else() - set(${result} "MD" PARENT_SCOPE) - endif() -endfunction() - -function(_collect_settings result) - set(ARGUMENTS_PROFILE_AUTO arch build_type compiler compiler.version - compiler.runtime compiler.libcxx compiler.toolset - compiler.cppstd) - foreach(ARG ${ARGUMENTS_PROFILE_AUTO}) - string(TOUPPER ${ARG} _arg_name) - string(REPLACE "." "_" _arg_name ${_arg_name}) - if(_CONAN_SETTING_${_arg_name}) - set(detected_setings ${detected_setings} ${ARG}=${_CONAN_SETTING_${_arg_name}}) - endif() - endforeach() - set(${result} ${detected_setings} PARENT_SCOPE) -endfunction() - -function(conan_cmake_autodetect detected_settings) - _conan_detect_build_type(${ARGV}) - _conan_check_system_name() - _conan_check_language() - _conan_detect_compiler(${ARGV}) - _collect_settings(collected_settings) - set(${detected_settings} ${collected_settings} PARENT_SCOPE) -endfunction() - -macro(conan_parse_arguments) - set(options BASIC_SETUP CMAKE_TARGETS UPDATE KEEP_RPATHS NO_LOAD NO_OUTPUT_DIRS OUTPUT_QUIET NO_IMPORTS SKIP_STD) - set(oneValueArgs CONANFILE ARCH BUILD_TYPE INSTALL_FOLDER OUTPUT_FOLDER CONAN_COMMAND) - set(multiValueArgs DEBUG_PROFILE RELEASE_PROFILE RELWITHDEBINFO_PROFILE MINSIZEREL_PROFILE - PROFILE REQUIRES OPTIONS IMPORTS SETTINGS BUILD ENV GENERATORS PROFILE_AUTO - INSTALL_ARGS CONFIGURATION_TYPES PROFILE_BUILD BUILD_REQUIRES) - cmake_parse_arguments(ARGUMENTS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) -endmacro() - -function(old_conan_cmake_install) - # Calls "conan install" - # Argument BUILD is equivalant to --build={missing, PkgName,...} or - # --build when argument is 'BUILD all' (which builds all packages from source) - # Argument CONAN_COMMAND, to specify the conan path, e.g. in case of running from source - # cmake does not identify conan as command, even if it is +x and it is in the path - conan_parse_arguments(${ARGV}) - - if(CONAN_CMAKE_MULTI) - set(ARGUMENTS_GENERATORS ${ARGUMENTS_GENERATORS} cmake_multi) - else() - set(ARGUMENTS_GENERATORS ${ARGUMENTS_GENERATORS} cmake) - endif() - - set(CONAN_BUILD_POLICY "") - foreach(ARG ${ARGUMENTS_BUILD}) - if(${ARG} STREQUAL "all") - set(CONAN_BUILD_POLICY ${CONAN_BUILD_POLICY} --build) - break() - else() - set(CONAN_BUILD_POLICY ${CONAN_BUILD_POLICY} --build=${ARG}) - endif() - endforeach() - if(ARGUMENTS_CONAN_COMMAND) - set(CONAN_CMD ${ARGUMENTS_CONAN_COMMAND}) - else() - conan_check(REQUIRED) - endif() - set(CONAN_OPTIONS "") - if(ARGUMENTS_CONANFILE) - if(IS_ABSOLUTE ${ARGUMENTS_CONANFILE}) - set(CONANFILE ${ARGUMENTS_CONANFILE}) - else() - set(CONANFILE ${CMAKE_CURRENT_SOURCE_DIR}/${ARGUMENTS_CONANFILE}) - endif() - else() - set(CONANFILE ".") - endif() - foreach(ARG ${ARGUMENTS_OPTIONS}) - set(CONAN_OPTIONS ${CONAN_OPTIONS} -o=${ARG}) - endforeach() - if(ARGUMENTS_UPDATE) - set(CONAN_INSTALL_UPDATE --update) - endif() - if(ARGUMENTS_NO_IMPORTS) - set(CONAN_INSTALL_NO_IMPORTS --no-imports) - endif() - set(CONAN_INSTALL_FOLDER "") - if(ARGUMENTS_INSTALL_FOLDER) - set(CONAN_INSTALL_FOLDER -if=${ARGUMENTS_INSTALL_FOLDER}) - endif() - set(CONAN_OUTPUT_FOLDER "") - if(ARGUMENTS_OUTPUT_FOLDER) - set(CONAN_OUTPUT_FOLDER -of=${ARGUMENTS_OUTPUT_FOLDER}) - endif() - foreach(ARG ${ARGUMENTS_GENERATORS}) - set(CONAN_GENERATORS ${CONAN_GENERATORS} -g=${ARG}) - endforeach() - foreach(ARG ${ARGUMENTS_ENV}) - set(CONAN_ENV_VARS ${CONAN_ENV_VARS} -e=${ARG}) - endforeach() - set(conan_args install ${CONANFILE} ${settings} ${CONAN_ENV_VARS} ${CONAN_GENERATORS} ${CONAN_BUILD_POLICY} ${CONAN_INSTALL_UPDATE} ${CONAN_INSTALL_NO_IMPORTS} ${CONAN_OPTIONS} ${CONAN_INSTALL_FOLDER} ${ARGUMENTS_INSTALL_ARGS}) - - string (REPLACE ";" " " _conan_args "${conan_args}") - message(STATUS "Conan executing: ${CONAN_CMD} ${_conan_args}") - - if(ARGUMENTS_OUTPUT_QUIET) - execute_process(COMMAND ${CONAN_CMD} ${conan_args} - RESULT_VARIABLE return_code - OUTPUT_VARIABLE conan_output - ERROR_VARIABLE conan_output - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - else() - execute_process(COMMAND ${CONAN_CMD} ${conan_args} - RESULT_VARIABLE return_code - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - endif() - - if(NOT "${return_code}" STREQUAL "0") - message(FATAL_ERROR "Conan install failed='${return_code}'") - endif() - -endfunction() - -function(conan_cmake_install) - if(DEFINED CONAN_COMMAND) - set(CONAN_CMD ${CONAN_COMMAND}) - else() - conan_check(REQUIRED) - endif() - - set(installOptions UPDATE NO_IMPORTS OUTPUT_QUIET ERROR_QUIET) - set(installOneValueArgs PATH_OR_REFERENCE REFERENCE REMOTE LOCKFILE LOCKFILE_OUT LOCKFILE_NODE_ID INSTALL_FOLDER OUTPUT_FOLDER) - set(installMultiValueArgs GENERATOR BUILD ENV ENV_HOST ENV_BUILD OPTIONS_HOST OPTIONS OPTIONS_BUILD PROFILE - PROFILE_HOST PROFILE_BUILD SETTINGS SETTINGS_HOST SETTINGS_BUILD) - cmake_parse_arguments(ARGS "${installOptions}" "${installOneValueArgs}" "${installMultiValueArgs}" ${ARGN}) - foreach(arg ${installOptions}) - if(ARGS_${arg}) - set(${arg} ${${arg}} ${ARGS_${arg}}) - endif() - endforeach() - foreach(arg ${installOneValueArgs}) - if(DEFINED ARGS_${arg}) - if("${arg}" STREQUAL "REMOTE") - set(flag "--remote") - elseif("${arg}" STREQUAL "LOCKFILE") - set(flag "--lockfile") - elseif("${arg}" STREQUAL "LOCKFILE_OUT") - set(flag "--lockfile-out") - elseif("${arg}" STREQUAL "LOCKFILE_NODE_ID") - set(flag "--lockfile-node-id") - elseif("${arg}" STREQUAL "INSTALL_FOLDER") - set(flag "--install-folder") - elseif("${arg}" STREQUAL "OUTPUT_FOLDER") - set(flag "--output-folder") - endif() - set(${arg} ${${arg}} ${flag} ${ARGS_${arg}}) - endif() - endforeach() - foreach(arg ${installMultiValueArgs}) - if(DEFINED ARGS_${arg}) - if("${arg}" STREQUAL "GENERATOR") - set(flag "--generator") - elseif("${arg}" STREQUAL "BUILD") - set(flag "--build") - elseif("${arg}" STREQUAL "ENV") - set(flag "--env") - elseif("${arg}" STREQUAL "ENV_HOST") - set(flag "--env:host") - elseif("${arg}" STREQUAL "ENV_BUILD") - set(flag "--env:build") - elseif("${arg}" STREQUAL "OPTIONS") - set(flag "--options") - elseif("${arg}" STREQUAL "OPTIONS_HOST") - set(flag "--options:host") - elseif("${arg}" STREQUAL "OPTIONS_BUILD") - set(flag "--options:build") - elseif("${arg}" STREQUAL "PROFILE") - set(flag "--profile") - elseif("${arg}" STREQUAL "PROFILE_HOST") - set(flag "--profile:host") - elseif("${arg}" STREQUAL "PROFILE_BUILD") - set(flag "--profile:build") - elseif("${arg}" STREQUAL "SETTINGS") - set(flag "--settings") - elseif("${arg}" STREQUAL "SETTINGS_HOST") - set(flag "--settings:host") - elseif("${arg}" STREQUAL "SETTINGS_BUILD") - set(flag "--settings:build") - endif() - list(LENGTH ARGS_${arg} numargs) - foreach(item ${ARGS_${arg}}) - if(${item} STREQUAL "all" AND ${arg} STREQUAL "BUILD") - set(${arg} "--build") - break() - endif() - set(${arg} ${${arg}} ${flag} ${item}) - endforeach() - endif() - endforeach() - if(DEFINED UPDATE) - set(UPDATE --update) - endif() - if(DEFINED NO_IMPORTS) - set(NO_IMPORTS --no-imports) - endif() - set(install_args install ${PATH_OR_REFERENCE} ${REFERENCE} ${UPDATE} ${NO_IMPORTS} ${REMOTE} ${LOCKFILE} ${LOCKFILE_OUT} ${LOCKFILE_NODE_ID} ${INSTALL_FOLDER} ${OUTPUT_FOLDER} - ${GENERATOR} ${BUILD} ${ENV} ${ENV_HOST} ${ENV_BUILD} ${OPTIONS} ${OPTIONS_HOST} ${OPTIONS_BUILD} - ${PROFILE} ${PROFILE_HOST} ${PROFILE_BUILD} ${SETTINGS} ${SETTINGS_HOST} ${SETTINGS_BUILD}) - - string(REPLACE ";" " " _install_args "${install_args}") - message(STATUS "Conan executing: ${CONAN_CMD} ${_install_args}") - - if(ARGS_OUTPUT_QUIET) - set(OUTPUT_OPT OUTPUT_QUIET) - endif() - if(ARGS_ERROR_QUIET) - set(ERROR_OPT ERROR_QUIET) - endif() - - execute_process(COMMAND ${CONAN_CMD} ${install_args} - RESULT_VARIABLE return_code - ${OUTPUT_OPT} - ${ERROR_OPT} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - - if(NOT "${return_code}" STREQUAL "0") - if (ARGS_ERROR_QUIET) - message(WARNING "Conan install failed='${return_code}'") - else() - message(FATAL_ERROR "Conan install failed='${return_code}'") - endif() - endif() - -endfunction() - -function(conan_cmake_lock_create) - if(DEFINED CONAN_COMMAND) - set(CONAN_CMD ${CONAN_COMMAND}) - else() - conan_check(REQUIRED) - endif() - - set(lockCreateOptions UPDATE BASE OUTPUT_QUIET ERROR_QUIET) - set(lockCreateOneValueArgs PATH REFERENCE REMOTE LOCKFILE LOCKFILE_OUT) - set(lockCreateMultiValueArgs BUILD ENV ENV_HOST ENV_BUILD OPTIONS_HOST OPTIONS OPTIONS_BUILD PROFILE - PROFILE_HOST PROFILE_BUILD SETTINGS SETTINGS_HOST SETTINGS_BUILD) - cmake_parse_arguments(ARGS "${lockCreateOptions}" "${lockCreateOneValueArgs}" "${lockCreateMultiValueArgs}" ${ARGN}) - foreach(arg ${lockCreateOptions}) - if(ARGS_${arg}) - set(${arg} ${${arg}} ${ARGS_${arg}}) - endif() - endforeach() - foreach(arg ${lockCreateOneValueArgs}) - if(DEFINED ARGS_${arg}) - if("${arg}" STREQUAL "REMOTE") - set(flag "--remote") - elseif("${arg}" STREQUAL "LOCKFILE") - set(flag "--lockfile") - elseif("${arg}" STREQUAL "LOCKFILE_OUT") - set(flag "--lockfile-out") - endif() - set(${arg} ${${arg}} ${flag} ${ARGS_${arg}}) - endif() - endforeach() - foreach(arg ${lockCreateMultiValueArgs}) - if(DEFINED ARGS_${arg}) - if("${arg}" STREQUAL "BUILD") - set(flag "--build") - elseif("${arg}" STREQUAL "ENV") - set(flag "--env") - elseif("${arg}" STREQUAL "ENV_HOST") - set(flag "--env:host") - elseif("${arg}" STREQUAL "ENV_BUILD") - set(flag "--env:build") - elseif("${arg}" STREQUAL "OPTIONS") - set(flag "--options") - elseif("${arg}" STREQUAL "OPTIONS_HOST") - set(flag "--options:host") - elseif("${arg}" STREQUAL "OPTIONS_BUILD") - set(flag "--options:build") - elseif("${arg}" STREQUAL "PROFILE") - set(flag "--profile") - elseif("${arg}" STREQUAL "PROFILE_HOST") - set(flag "--profile:host") - elseif("${arg}" STREQUAL "PROFILE_BUILD") - set(flag "--profile:build") - elseif("${arg}" STREQUAL "SETTINGS") - set(flag "--settings") - elseif("${arg}" STREQUAL "SETTINGS_HOST") - set(flag "--settings:host") - elseif("${arg}" STREQUAL "SETTINGS_BUILD") - set(flag "--settings:build") - endif() - list(LENGTH ARGS_${arg} numargs) - foreach(item ${ARGS_${arg}}) - if(${item} STREQUAL "all" AND ${arg} STREQUAL "BUILD") - set(${arg} "--build") - break() - endif() - set(${arg} ${${arg}} ${flag} ${item}) - endforeach() - endif() - endforeach() - if(DEFINED UPDATE) - set(UPDATE --update) - endif() - if(DEFINED BASE) - set(BASE --base) - endif() - set(lock_create_Args lock create ${PATH} ${REFERENCE} ${UPDATE} ${BASE} ${REMOTE} ${LOCKFILE} ${LOCKFILE_OUT} ${LOCKFILE_NODE_ID} ${INSTALL_FOLDER} - ${GENERATOR} ${BUILD} ${ENV} ${ENV_HOST} ${ENV_BUILD} ${OPTIONS} ${OPTIONS_HOST} ${OPTIONS_BUILD} - ${PROFILE} ${PROFILE_HOST} ${PROFILE_BUILD} ${SETTINGS} ${SETTINGS_HOST} ${SETTINGS_BUILD}) - - string(REPLACE ";" " " _lock_create_Args "${lock_create_Args}") - message(STATUS "Conan executing: ${CONAN_CMD} ${_lock_create_Args}") - - if(ARGS_OUTPUT_QUIET) - set(OUTPUT_OPT OUTPUT_QUIET) - endif() - if(ARGS_ERROR_QUIET) - set(ERROR_OPT ERROR_QUIET) - endif() - - execute_process(COMMAND ${CONAN_CMD} ${lock_create_Args} - RESULT_VARIABLE return_code - ${OUTPUT_OPT} - ${ERROR_OPT} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) - - if(NOT "${return_code}" STREQUAL "0") - if (ARGS_ERROR_QUIET) - message(WARNING "Conan lock create failed='${return_code}'") - else() - message(FATAL_ERROR "Conan lock create failed='${return_code}'") - endif() - endif() -endfunction() - -function(conan_cmake_setup_conanfile) - conan_parse_arguments(${ARGV}) - if(ARGUMENTS_CONANFILE) - get_filename_component(_CONANFILE_NAME ${ARGUMENTS_CONANFILE} NAME) - # configure_file will make sure cmake re-runs when conanfile is updated - configure_file(${ARGUMENTS_CONANFILE} ${CMAKE_CURRENT_BINARY_DIR}/${_CONANFILE_NAME}.junk COPYONLY) - file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/${_CONANFILE_NAME}.junk) - else() - conan_cmake_generate_conanfile(ON ${ARGV}) - endif() -endfunction() - -function(conan_cmake_configure) - conan_cmake_generate_conanfile(OFF ${ARGV}) -endfunction() - -# Generate, writing in disk a conanfile.txt with the requires, options, and imports -# specified as arguments -# This will be considered as temporary file, generated in CMAKE_CURRENT_BINARY_DIR) -function(conan_cmake_generate_conanfile DEFAULT_GENERATOR) - - conan_parse_arguments(${ARGV}) - - set(_FN "${CMAKE_CURRENT_BINARY_DIR}/conanfile.txt") - file(WRITE ${_FN} "") - - if(DEFINED ARGUMENTS_REQUIRES) - file(APPEND ${_FN} "[requires]\n") - foreach(REQUIRE ${ARGUMENTS_REQUIRES}) - file(APPEND ${_FN} ${REQUIRE} "\n") - endforeach() - endif() - - if (DEFAULT_GENERATOR OR DEFINED ARGUMENTS_GENERATORS) - file(APPEND ${_FN} "[generators]\n") - if (DEFAULT_GENERATOR) - file(APPEND ${_FN} "cmake\n") - endif() - if (DEFINED ARGUMENTS_GENERATORS) - foreach(GENERATOR ${ARGUMENTS_GENERATORS}) - file(APPEND ${_FN} ${GENERATOR} "\n") - endforeach() - endif() - endif() - - if(DEFINED ARGUMENTS_BUILD_REQUIRES) - file(APPEND ${_FN} "[build_requires]\n") - foreach(BUILD_REQUIRE ${ARGUMENTS_BUILD_REQUIRES}) - file(APPEND ${_FN} ${BUILD_REQUIRE} "\n") - endforeach() - endif() - - if(DEFINED ARGUMENTS_IMPORTS) - file(APPEND ${_FN} "[imports]\n") - foreach(IMPORTS ${ARGUMENTS_IMPORTS}) - file(APPEND ${_FN} ${IMPORTS} "\n") - endforeach() - endif() - - if(DEFINED ARGUMENTS_OPTIONS) - file(APPEND ${_FN} "[options]\n") - foreach(OPTION ${ARGUMENTS_OPTIONS}) - file(APPEND ${_FN} ${OPTION} "\n") - endforeach() - endif() - -endfunction() - - -macro(conan_load_buildinfo) - if(CONAN_CMAKE_MULTI) - set(_CONANBUILDINFO conanbuildinfo_multi.cmake) - else() - set(_CONANBUILDINFO conanbuildinfo.cmake) - endif() - if(ARGUMENTS_INSTALL_FOLDER) - set(_CONANBUILDINFOFOLDER ${ARGUMENTS_INSTALL_FOLDER}) - else() - set(_CONANBUILDINFOFOLDER ${CMAKE_CURRENT_BINARY_DIR}) - endif() - # Checks for the existence of conanbuildinfo.cmake, and loads it - # important that it is macro, so variables defined at parent scope - if(EXISTS "${_CONANBUILDINFOFOLDER}/${_CONANBUILDINFO}") - message(STATUS "Conan: Loading ${_CONANBUILDINFO}") - include(${_CONANBUILDINFOFOLDER}/${_CONANBUILDINFO}) - else() - message(FATAL_ERROR "${_CONANBUILDINFO} doesn't exist in ${CMAKE_CURRENT_BINARY_DIR}") - endif() -endmacro() - - -macro(conan_cmake_run) - conan_parse_arguments(${ARGV}) - - if(ARGUMENTS_CONFIGURATION_TYPES AND NOT CMAKE_CONFIGURATION_TYPES) - message(WARNING "CONFIGURATION_TYPES should only be specified for multi-configuration generators") - elseif(ARGUMENTS_CONFIGURATION_TYPES AND ARGUMENTS_BUILD_TYPE) - message(WARNING "CONFIGURATION_TYPES and BUILD_TYPE arguments should not be defined at the same time.") - endif() - - if(CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE AND NOT CONAN_EXPORTED - AND NOT ARGUMENTS_BUILD_TYPE) - set(CONAN_CMAKE_MULTI ON) - if (NOT ARGUMENTS_CONFIGURATION_TYPES) - set(ARGUMENTS_CONFIGURATION_TYPES "Release;Debug") - endif() - message(STATUS "Conan: Using cmake-multi generator") - else() - set(CONAN_CMAKE_MULTI OFF) - endif() - - if(NOT CONAN_EXPORTED) - conan_cmake_setup_conanfile(${ARGV}) - if(CONAN_CMAKE_MULTI) - foreach(CMAKE_BUILD_TYPE ${ARGUMENTS_CONFIGURATION_TYPES}) - set(ENV{CONAN_IMPORT_PATH} ${CMAKE_BUILD_TYPE}) - conan_cmake_settings(settings ${ARGV}) - old_conan_cmake_install(SETTINGS ${settings} ${ARGV}) - endforeach() - set(CMAKE_BUILD_TYPE) - else() - conan_cmake_settings(settings ${ARGV}) - old_conan_cmake_install(SETTINGS ${settings} ${ARGV}) - endif() - endif() - - if (NOT ARGUMENTS_NO_LOAD) - conan_load_buildinfo() - endif() - - if(ARGUMENTS_BASIC_SETUP) - foreach(_option CMAKE_TARGETS KEEP_RPATHS NO_OUTPUT_DIRS SKIP_STD) - if(ARGUMENTS_${_option}) - if(${_option} STREQUAL "CMAKE_TARGETS") - list(APPEND _setup_options "TARGETS") - else() - list(APPEND _setup_options ${_option}) - endif() - endif() - endforeach() - conan_basic_setup(${_setup_options}) - endif() -endmacro() - -macro(conan_check) - # Checks conan availability in PATH - # Arguments REQUIRED, DETECT_QUIET and VERSION are optional - # Example usage: - # conan_check(VERSION 1.0.0 REQUIRED) - set(options REQUIRED DETECT_QUIET) - set(oneValueArgs VERSION) - cmake_parse_arguments(CONAN "${options}" "${oneValueArgs}" "" ${ARGN}) - if(NOT CONAN_DETECT_QUIET) - message(STATUS "Conan: checking conan executable") - endif() - - find_program(CONAN_CMD conan) - if(NOT CONAN_CMD AND CONAN_REQUIRED) - message(FATAL_ERROR "Conan executable not found! Please install conan.") - endif() - if(NOT CONAN_DETECT_QUIET) - message(STATUS "Conan: Found program ${CONAN_CMD}") - endif() - execute_process(COMMAND ${CONAN_CMD} --version - RESULT_VARIABLE return_code - OUTPUT_VARIABLE CONAN_VERSION_OUTPUT - ERROR_VARIABLE CONAN_VERSION_OUTPUT) - - if(NOT "${return_code}" STREQUAL "0") - message(FATAL_ERROR "Conan --version failed='${return_code}'") - endif() - - if(NOT CONAN_DETECT_QUIET) - string(STRIP "${CONAN_VERSION_OUTPUT}" _CONAN_VERSION_OUTPUT) - message(STATUS "Conan: Version found ${_CONAN_VERSION_OUTPUT}") - endif() - - if(DEFINED CONAN_VERSION) - string(REGEX MATCH ".*Conan version ([0-9]+\\.[0-9]+\\.[0-9]+)" FOO - "${CONAN_VERSION_OUTPUT}") - if(${CMAKE_MATCH_1} VERSION_LESS ${CONAN_VERSION}) - message(FATAL_ERROR "Conan outdated. Installed: ${CMAKE_MATCH_1}, \ - required: ${CONAN_VERSION}. Consider updating via 'pip \ - install conan==${CONAN_VERSION}'.") - endif() - endif() -endmacro() - -function(conan_add_remote) - # Adds a remote - # Arguments URL and NAME are required, INDEX, COMMAND and VERIFY_SSL are optional - # Example usage: - # conan_add_remote(NAME bincrafters INDEX 1 - # URL https://api.bintray.com/conan/bincrafters/public-conan - # VERIFY_SSL True) - set(oneValueArgs URL NAME INDEX COMMAND VERIFY_SSL) - cmake_parse_arguments(CONAN "" "${oneValueArgs}" "" ${ARGN}) - - if(DEFINED CONAN_INDEX) - set(CONAN_INDEX_ARG "-i ${CONAN_INDEX}") - endif() - if(DEFINED CONAN_COMMAND) - set(CONAN_CMD ${CONAN_COMMAND}) - else() - conan_check(REQUIRED DETECT_QUIET) - endif() - set(CONAN_VERIFY_SSL_ARG "True") - if(DEFINED CONAN_VERIFY_SSL) - set(CONAN_VERIFY_SSL_ARG ${CONAN_VERIFY_SSL}) - endif() - message(STATUS "Conan: Adding ${CONAN_NAME} remote repository (${CONAN_URL}) verify ssl (${CONAN_VERIFY_SSL_ARG})") - execute_process(COMMAND ${CONAN_CMD} remote add ${CONAN_NAME} ${CONAN_INDEX_ARG} -f ${CONAN_URL} ${CONAN_VERIFY_SSL_ARG} - RESULT_VARIABLE return_code) - if(NOT "${return_code}" STREQUAL "0") - message(FATAL_ERROR "Conan remote failed='${return_code}'") - endif() -endfunction() - -macro(conan_config_install) - # install a full configuration from a local or remote zip file - # Argument ITEM is required, arguments TYPE, SOURCE, TARGET and VERIFY_SSL are optional - # Example usage: - # conan_config_install(ITEM https://github.com/conan-io/cmake-conan.git - # TYPE git SOURCE source-folder TARGET target-folder VERIFY_SSL false) - set(oneValueArgs ITEM TYPE SOURCE TARGET VERIFY_SSL) - set(multiValueArgs ARGS) - cmake_parse_arguments(CONAN "" "${oneValueArgs}" "${multiValueArgs}" ${ARGN}) - - if(DEFINED CONAN_COMMAND) - set(CONAN_CMD ${CONAN_COMMAND}) - else() - conan_check(REQUIRED) - endif() - - if(DEFINED CONAN_VERIFY_SSL) - set(CONAN_VERIFY_SSL_ARG "--verify-ssl=${CONAN_VERIFY_SSL}") - endif() - - if(DEFINED CONAN_TYPE) - set(CONAN_TYPE_ARG "--type=${CONAN_TYPE}") - endif() - - if(DEFINED CONAN_ARGS) - set(CONAN_ARGS_ARGS "--args=\"${CONAN_ARGS}\"") - endif() - - if(DEFINED CONAN_SOURCE) - set(CONAN_SOURCE_ARGS "--source-folder=${CONAN_SOURCE}") - endif() - - if(DEFINED CONAN_TARGET) - set(CONAN_TARGET_ARGS "--target-folder=${CONAN_TARGET}") - endif() - - set (CONAN_CONFIG_INSTALL_ARGS ${CONAN_VERIFY_SSL_ARG} - ${CONAN_TYPE_ARG} - ${CONAN_ARGS_ARGS} - ${CONAN_SOURCE_ARGS} - ${CONAN_TARGET_ARGS}) - - message(STATUS "Conan: Installing config from ${CONAN_ITEM}") - execute_process(COMMAND ${CONAN_CMD} config install ${CONAN_ITEM} ${CONAN_CONFIG_INSTALL_ARGS} - RESULT_VARIABLE return_code) - if(NOT "${return_code}" STREQUAL "0") - message(FATAL_ERROR "Conan config failed='${return_code}'") - endif() -endmacro() From ad047741b7c1100d9247b3e153802ab491a72fc4 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 12 Oct 2024 22:23:21 +0200 Subject: [PATCH 32/73] wip --- CMakeLists.txt | 5 +++-- example/CMakeLists.txt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2595fe265..6ba1f637c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -138,7 +138,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/generated/include/) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/include) -set(BOOST_COMPONENTS date_time iostreams program_options thread unit_test_framework) +set(BOOST_COMPONENTS system date_time iostreams program_options thread unit_test_framework) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in @@ -323,7 +323,8 @@ if (MSVC) add_definitions(-DBOOST_ALL_NO_LIB) endif() -find_package(Boost 1.70 REQUIRED COMPONENTS ${BOOST_COMPONENTS}) +set(Boost_USE_STATIC_LIBS ON) +find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) find_package(TBB REQUIRED) find_package(EXPAT REQUIRED) find_package(BZip2 REQUIRED) diff --git a/example/CMakeLists.txt b/example/CMakeLists.txt index 1ec0ff9cc..7a05ec7aa 100644 --- a/example/CMakeLists.txt +++ b/example/CMakeLists.txt @@ -12,7 +12,7 @@ endif() project(osrm-example C CXX) -set(CMAKE_CXX_STANDARD 17) +set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) From 17e1c04136855cb396c28c78248ea6aecb9d0f1b Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 12 Oct 2024 22:41:29 +0200 Subject: [PATCH 33/73] wip --- .github/workflows/osrm-backend.yml | 6 +++--- CMakeLists.txt | 24 +++++++++++++++++++++++- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index dd4483b9a..427a3d674 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -536,9 +536,9 @@ jobs: cat ~/.conan2/profiles/default # sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default - if [[ "${ENABLE_CONAN}" == "ON" ]]; then - conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=${BUILD_TYPE} - fi + # if [[ "${ENABLE_CONAN}" == "ON" ]]; then + # conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=${BUILD_TYPE} + # fi ccache --zero-stats cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ba1f637c..ced40cbf9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,7 +14,29 @@ option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF) option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF) if (ENABLE_CONAN) - set(CMAKE_TOOLCHAIN_FILE "./conan_toolchain.cmake") + message(STATUS "Installing Conan packages. It may take a while...") + find_program(CONAN_EXECUTABLE NAMES conan) + + if (NOT CONAN_EXECUTABLE) + message(FATAL_ERROR "Conan not found! Please install Conan 2.x and try again.") + else() + set(CMAKE_TOOLCHAIN_FILE "./conan_toolchain.cmake") + + # message(STATUS "Conan install stdout: ${CONAN_EXECUTABLE} install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=${CMAKE_BUILD_TYPE}") + execute_process( + COMMAND ${CONAN_EXECUTABLE} install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=${CMAKE_BUILD_TYPE} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + OUTPUT_VARIABLE conan_stdout + ERROR_VARIABLE conan_stderr + RESULT_VARIABLE conan_install_result + ) + # message(STATUS "Conan install stdout: ${conan_stdout} ${CMAKE_BUILD_TYPE}") + # message(STATUS "Conan install stderr: ${conan_stderr}") + + if (NOT conan_install_result EQUAL 0) + message(FATAL_ERROR "Conan install failed.") + endif() + endif() endif() set(CMAKE_CXX_STANDARD 20) From 56ccb1ec7eef1981b6bd88ea638fb569697bb056 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 12:14:49 +0200 Subject: [PATCH 34/73] wip --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ced40cbf9..852eed09b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -345,7 +345,7 @@ if (MSVC) add_definitions(-DBOOST_ALL_NO_LIB) endif() -set(Boost_USE_STATIC_LIBS ON) +# set(Boost_USE_STATIC_LIBS ON) find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) find_package(TBB REQUIRED) find_package(EXPAT REQUIRED) From b85f235d08fea2dfebd6afe77e5ac93593e42da5 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 12:53:45 +0200 Subject: [PATCH 35/73] wip --- CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 852eed09b..acc825b39 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -652,8 +652,12 @@ JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS) # # the link libraries to be written to the pkg-config file. # # Conan & TBB define dependencies as CMake targets too, that's why we do the same for them. foreach(engine_lib ${ENGINE_LIBRARIES}) - message(STATUS "Adding ${engine_lib} to pkg-config dependencies ") - list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") + message(STATUS "Adding ${engine_lib} to pkg-config dependencies") + if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") + list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") + else() + list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") + endif() endforeach(engine_lib) #message(FATAL_ERROR "XXX") # JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) From 6a8ff7874ff545dd7c579a9d979343a5c3ede7c9 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 12:54:45 +0200 Subject: [PATCH 36/73] wip --- CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index acc825b39..ca73df7b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -659,8 +659,7 @@ foreach(engine_lib ${ENGINE_LIBRARIES}) list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") endif() endforeach(engine_lib) -#message(FATAL_ERROR "XXX") -# JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) +JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in pkgconfig.configured @ONLY) file(GENERATE From ae0913d8112bf6ec1e030c98b1fc4d04646a25af Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 14:43:20 +0200 Subject: [PATCH 37/73] wip --- CMakeLists.txt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ca73df7b7..5e09308c2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -651,14 +651,16 @@ JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS) # # Boost uses imported targets, we need to use a generator expression to extract # # the link libraries to be written to the pkg-config file. # # Conan & TBB define dependencies as CMake targets too, that's why we do the same for them. -foreach(engine_lib ${ENGINE_LIBRARIES}) - message(STATUS "Adding ${engine_lib} to pkg-config dependencies") - if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") - list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") - else() - list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") - endif() -endforeach(engine_lib) +if (NOT ENABLE_CONAN) + foreach(engine_lib ${ENGINE_LIBRARIES}) + message(STATUS "Adding ${engine_lib} to pkg-config dependencies") + if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") + list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") + else() + list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") + endif() + endforeach(engine_lib) +endif() JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in pkgconfig.configured @ONLY) From 66df8f5148f9aeb403aeabd7b69500ea1180d253 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 15:37:45 +0200 Subject: [PATCH 38/73] wip --- .github/workflows/osrm-backend.yml | 294 ++++++++++++++--------------- 1 file changed, 144 insertions(+), 150 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 427a3d674..ec598e175 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -177,98 +177,98 @@ jobs: strategy: matrix: include: - # - name: gcc-13-debug-cov - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: gcc-13 - # CUCUMBER_TIMEOUT: 20000 - # CXXCOMPILER: g++-13 - # ENABLE_COVERAGE: ON + - name: gcc-13-debug-cov + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: gcc-13 + CUCUMBER_TIMEOUT: 20000 + CXXCOMPILER: g++-13 + ENABLE_COVERAGE: ON - # - name: clang-18-debug-asan-ubsan - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CUCUMBER_TIMEOUT: 20000 - # CXXCOMPILER: clang++-18 - # ENABLE_SANITIZER: ON - # TARGET_ARCH: x86_64-asan-ubsan - # OSRM_CONNECTION_RETRIES: 10 - # OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 + - name: clang-18-debug-asan-ubsan + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CUCUMBER_TIMEOUT: 20000 + CXXCOMPILER: clang++-18 + ENABLE_SANITIZER: ON + TARGET_ARCH: x86_64-asan-ubsan + OSRM_CONNECTION_RETRIES: 10 + OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 - # - name: clang-18-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-18-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-18-debug - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-18-debug + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-18-debug-clang-tidy - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_CLANG_TIDY: ON + - name: clang-18-debug-clang-tidy + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_CLANG_TIDY: ON - # - name: clang-17-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-17 - # CXXCOMPILER: clang++-17 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-17-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-17 + CXXCOMPILER: clang++-17 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-16-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-16-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: conan-linux-debug-asan-ubsan - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # ENABLE_CONAN: ON - # ENABLE_SANITIZER: ON - # ENABLE_LTO: OFF + - name: conan-linux-debug-asan-ubsan + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + ENABLE_CONAN: ON + ENABLE_SANITIZER: ON + ENABLE_LTO: OFF - name: conan-linux-release continue-on-error: false @@ -291,71 +291,71 @@ jobs: CXXCOMPILER: g++-14 CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: gcc-13-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-13 - # CXXCOMPILER: g++-13 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-13-release + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-13 + CXXCOMPILER: g++-13 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: gcc-12-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-22.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-12 - # CXXCOMPILER: g++-12 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-12-release + continue-on-error: false + node: 20 + runs-on: ubuntu-22.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-12 + CXXCOMPILER: g++-12 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: conan-linux-release-node - # build_node_package: true - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TYPE: Release - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # ENABLE_CONAN: ON - # NODE_PACKAGE_TESTS_ONLY: ON + - name: conan-linux-release-node + build_node_package: true + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TYPE: Release + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + ENABLE_CONAN: ON + NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-linux-debug-node - # build_node_package: true - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TYPE: Debug - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # ENABLE_CONAN: ON - # NODE_PACKAGE_TESTS_ONLY: ON + - name: conan-linux-debug-node + build_node_package: true + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TYPE: Debug + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + ENABLE_CONAN: ON + NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-macos-x64-release-node - # build_node_package: true - # continue-on-error: true - # node: 20 - # runs-on: macos-13 # x86_64 - # BUILD_TYPE: Release - # CCOMPILER: clang - # CXXCOMPILER: clang++ - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_ASSERTIONS: ON - # ENABLE_CONAN: ON + - name: conan-macos-x64-release-node + build_node_package: true + continue-on-error: true + node: 20 + runs-on: macos-13 # x86_64 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_CONAN: ON - # - name: conan-macos-arm64-release-node - # build_node_package: true - # continue-on-error: true - # node: 20 - # runs-on: macos-14 # arm64 - # BUILD_TYPE: Release - # CCOMPILER: clang - # CXXCOMPILER: clang++ - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_ASSERTIONS: ON - # ENABLE_CONAN: ON + - name: conan-macos-arm64-release-node + build_node_package: true + continue-on-error: true + node: 20 + runs-on: macos-14 # arm64 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_CONAN: ON name: ${{ matrix.name}} continue-on-error: ${{ matrix.continue-on-error }} @@ -533,13 +533,7 @@ jobs: python3 -m pip install conan==2.7.1 conan profile detect --force - cat ~/.conan2/profiles/default - # sed -i '' 's/compiler.cppstd=.*$/compiler.cppstd=20/' ~/.conan/profiles/default - # if [[ "${ENABLE_CONAN}" == "ON" ]]; then - # conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=${BUILD_TYPE} - # fi - ccache --zero-stats cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ -DENABLE_CONAN=${ENABLE_CONAN:-OFF} \ From 8190a30b72c32e45731ab784c06d4c7605fdd2aa Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 16:36:17 +0200 Subject: [PATCH 39/73] wip --- .github/workflows/osrm-backend.yml | 326 ++++++++++++++--------------- 1 file changed, 163 insertions(+), 163 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index ec598e175..a72f268dd 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -23,154 +23,154 @@ concurrency: cancel-in-progress: true jobs: - # windows-release-node: - # #needs: format-taginfo-docs - # runs-on: windows-2022 - # continue-on-error: false - # env: - # BUILD_TYPE: Release - # steps: - # - uses: actions/checkout@v4 - # - run: cmake --version - # - uses: actions/setup-node@v4 - # with: - # node-version: 18 - # - run: node --version - # - run: npm --version - # - name: Prepare environment - # shell: bash - # run: | - # PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") - # echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV - # - run: npm install --ignore-scripts - # - run: npm link --ignore-scripts - # - name: Build - # shell: bash - # run: | - # mkdir build - # cd build + windows-release-node: + #needs: format-taginfo-docs + runs-on: windows-2022 + continue-on-error: false + env: + BUILD_TYPE: Release + steps: + - uses: actions/checkout@v4 + - run: cmake --version + - uses: actions/setup-node@v4 + with: + node-version: 18 + - run: node --version + - run: npm --version + - name: Prepare environment + shell: bash + run: | + PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") + echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV + - run: npm install --ignore-scripts + - run: npm link --ignore-scripts + - name: Build + shell: bash + run: | + mkdir build + cd build - # python3 -m venv .venv + python3 -m venv .venv - # source .venv/Scripts/Activate + source .venv/Scripts/Activate - # python3 -m pip install conan==2.7.1 + python3 -m pip install conan==2.7.1 - # conan profile detect --force + conan profile detect --force - # conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 + # conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 - # ls -la + # ls -la - # cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. - # cmake --build . --config Release + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON .. + cmake --build . --config Release - # # TODO: MSVC goes out of memory when building our tests - # # - name: Run tests - # # shell: bash - # # run: | - # # cd build - # # cmake --build . --config Release --target tests - # # # TODO: run tests - # # - name: Run node tests - # # shell: bash - # # run: | - # # ./lib/binding/osrm-extract.exe -p profiles/car.lua test/data/monaco.osm.pbf + # TODO: MSVC goes out of memory when building our tests + # - name: Run tests + # shell: bash + # run: | + # cd build + # cmake --build . --config Release --target tests + # # TODO: run tests + # - name: Run node tests + # shell: bash + # run: | + # ./lib/binding/osrm-extract.exe -p profiles/car.lua test/data/monaco.osm.pbf - # # mkdir -p test/data/ch - # # cp test/data/monaco.osrm* test/data/ch/ - # # ./lib/binding/osrm-contract.exe test/data/ch/monaco.osrm + # mkdir -p test/data/ch + # cp test/data/monaco.osrm* test/data/ch/ + # ./lib/binding/osrm-contract.exe test/data/ch/monaco.osrm - # # ./lib/binding/osrm-datastore.exe test/data/ch/monaco.osrm - # # node test/nodejs/index.js - # - name: Build Node package - # shell: bash - # run: ./scripts/ci/node_package.sh - # - name: Publish Node package - # if: ${{ env.PUBLISH == 'On' }} - # uses: ncipollo/release-action@v1 - # with: - # allowUpdates: true - # artifactErrorsFailBuild: true - # artifacts: build/stage/**/*.tar.gz - # omitBody: true - # omitBodyDuringUpdate: true - # omitName: true - # omitNameDuringUpdate: true - # replacesArtifacts: true - # token: ${{ secrets.GITHUB_TOKEN }} + # ./lib/binding/osrm-datastore.exe test/data/ch/monaco.osrm + # node test/nodejs/index.js + - name: Build Node package + shell: bash + run: ./scripts/ci/node_package.sh + - name: Publish Node package + if: ${{ env.PUBLISH == 'On' }} + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifactErrorsFailBuild: true + artifacts: build/stage/**/*.tar.gz + omitBody: true + omitBodyDuringUpdate: true + omitName: true + omitNameDuringUpdate: true + replacesArtifacts: true + token: ${{ secrets.GITHUB_TOKEN }} - # format-taginfo-docs: - # runs-on: ubuntu-22.04 - # steps: - # - uses: actions/checkout@v4 - # - name: Use Node.js - # uses: actions/setup-node@v4 - # with: - # node-version: 18 - # - name: Enable Node.js cache - # uses: actions/cache@v4 - # with: - # path: ~/.npm - # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-node- - # - name: Prepare environment - # run: | - # npm ci --ignore-scripts - # clang-format-15 --version - # - name: Run checks - # run: | - # ./scripts/check_taginfo.py taginfo.json profiles/car.lua - # ./scripts/format.sh && ./scripts/error_on_dirty.sh - # node ./scripts/validate_changelog.js - # npm run docs && ./scripts/error_on_dirty.sh - # npm audit --production + format-taginfo-docs: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Enable Node.js cache + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Prepare environment + run: | + npm ci --ignore-scripts + clang-format-15 --version + - name: Run checks + run: | + ./scripts/check_taginfo.py taginfo.json profiles/car.lua + ./scripts/format.sh && ./scripts/error_on_dirty.sh + node ./scripts/validate_changelog.js + npm run docs && ./scripts/error_on_dirty.sh + npm audit --production - # docker-image-matrix: - # strategy: - # matrix: - # docker-base-image: ["debian", "alpine"] - # needs: format-taginfo-docs - # runs-on: ubuntu-22.04 - # continue-on-error: false - # steps: - # - name: Check out the repo - # uses: actions/checkout@v4 - # - name: Enable osm.pbf cache - # uses: actions/cache@v4 - # with: - # path: berlin-latest.osm.pbf - # key: v1-berlin-osm-pbf - # restore-keys: | - # v1-berlin-osm-pbf - # - name: Docker build - # run: | - # docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . - # - name: Test Docker image - # run: | - # if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then - # wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf - # fi - # TAG=osrm-backend-local - # # when `--memory-swap` value equals `--memory` it means container won't use swap - # # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details - # MEMORY_ARGS="--memory=1g --memory-swap=1g" - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson - # if [ ! -s "${PWD}/berlin-latest.geojson" ] - # then - # >&2 echo "No berlin-latest.geojson found" - # exit 1 - # fi - # # removing `.osrm.nbg` to check that whole pipeline works without it - # rm -rf "${PWD}/berlin-latest.osrm.nbg" + docker-image-matrix: + strategy: + matrix: + docker-base-image: ["debian", "alpine"] + needs: format-taginfo-docs + runs-on: ubuntu-22.04 + continue-on-error: false + steps: + - name: Check out the repo + uses: actions/checkout@v4 + - name: Enable osm.pbf cache + uses: actions/cache@v4 + with: + path: berlin-latest.osm.pbf + key: v1-berlin-osm-pbf + restore-keys: | + v1-berlin-osm-pbf + - name: Docker build + run: | + docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . + - name: Test Docker image + run: | + if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then + wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf + fi + TAG=osrm-backend-local + # when `--memory-swap` value equals `--memory` it means container won't use swap + # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details + MEMORY_ARGS="--memory=1g --memory-swap=1g" + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson + if [ ! -s "${PWD}/berlin-latest.geojson" ] + then + >&2 echo "No berlin-latest.geojson found" + exit 1 + fi + # removing `.osrm.nbg` to check that whole pipeline works without it + rm -rf "${PWD}/berlin-latest.osrm.nbg" - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm - # docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & - # curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" - # docker stop osrm-container + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm + docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & + curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" + docker stop osrm-container build-test-publish: #needs: format-taginfo-docs @@ -387,34 +387,34 @@ jobs: uses: actions/setup-node@v4 with: node-version: ${{ matrix.node }} - # - name: Enable Node.js cache - # uses: actions/cache@v4 - # with: - # path: ~/.npm - # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-node- - # - name: Enable compiler cache - # uses: actions/cache@v4 - # with: - # path: ~/.ccache - # key: ccache-${{ matrix.name }}-${{ github.sha }} - # restore-keys: | - # ccache-${{ matrix.name }}- - # - name: Enable Conan cache - # uses: actions/cache@v4 - # with: - # path: ~/.conan2 - # key: v10-conan-${{ matrix.name }}-${{ github.sha }} - # restore-keys: | - # v10-conan-${{ matrix.name }}- - # - name: Enable test cache - # uses: actions/cache@v4 - # with: - # path: ${{github.workspace}}/test/cache - # key: v4-test-${{ matrix.name }}-${{ github.sha }} - # restore-keys: | - # v4-test-${{ matrix.name }}- + - name: Enable Node.js cache + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Enable compiler cache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ccache-${{ matrix.name }}-${{ github.sha }} + restore-keys: | + ccache-${{ matrix.name }}- + - name: Enable Conan cache + uses: actions/cache@v4 + with: + path: ~/.conan2 + key: v10-conan-${{ matrix.name }}-${{ github.sha }} + restore-keys: | + v10-conan-${{ matrix.name }}- + - name: Enable test cache + uses: actions/cache@v4 + with: + path: ${{github.workspace}}/test/cache + key: v4-test-${{ matrix.name }}-${{ github.sha }} + restore-keys: | + v4-test-${{ matrix.name }}- - name: Prepare environment run: | echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV From b59fff2d62ac969f566fc4784905386ac932b25e Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 17:22:38 +0200 Subject: [PATCH 40/73] wip --- .github/workflows/osrm-backend.yml | 1036 ++++++++++++++-------------- CMakeLists.txt | 4 + conanfile.py | 1 + 3 files changed, 523 insertions(+), 518 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index a72f268dd..6861be62b 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -100,566 +100,566 @@ jobs: replacesArtifacts: true token: ${{ secrets.GITHUB_TOKEN }} - format-taginfo-docs: - runs-on: ubuntu-22.04 - steps: - - uses: actions/checkout@v4 - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Enable Node.js cache - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Prepare environment - run: | - npm ci --ignore-scripts - clang-format-15 --version - - name: Run checks - run: | - ./scripts/check_taginfo.py taginfo.json profiles/car.lua - ./scripts/format.sh && ./scripts/error_on_dirty.sh - node ./scripts/validate_changelog.js - npm run docs && ./scripts/error_on_dirty.sh - npm audit --production + # format-taginfo-docs: + # runs-on: ubuntu-22.04 + # steps: + # - uses: actions/checkout@v4 + # - name: Use Node.js + # uses: actions/setup-node@v4 + # with: + # node-version: 18 + # - name: Enable Node.js cache + # uses: actions/cache@v4 + # with: + # path: ~/.npm + # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + # restore-keys: | + # ${{ runner.os }}-node- + # - name: Prepare environment + # run: | + # npm ci --ignore-scripts + # clang-format-15 --version + # - name: Run checks + # run: | + # ./scripts/check_taginfo.py taginfo.json profiles/car.lua + # ./scripts/format.sh && ./scripts/error_on_dirty.sh + # node ./scripts/validate_changelog.js + # npm run docs && ./scripts/error_on_dirty.sh + # npm audit --production - docker-image-matrix: - strategy: - matrix: - docker-base-image: ["debian", "alpine"] - needs: format-taginfo-docs - runs-on: ubuntu-22.04 - continue-on-error: false - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - name: Enable osm.pbf cache - uses: actions/cache@v4 - with: - path: berlin-latest.osm.pbf - key: v1-berlin-osm-pbf - restore-keys: | - v1-berlin-osm-pbf - - name: Docker build - run: | - docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . - - name: Test Docker image - run: | - if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then - wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf - fi - TAG=osrm-backend-local - # when `--memory-swap` value equals `--memory` it means container won't use swap - # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details - MEMORY_ARGS="--memory=1g --memory-swap=1g" - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson - if [ ! -s "${PWD}/berlin-latest.geojson" ] - then - >&2 echo "No berlin-latest.geojson found" - exit 1 - fi - # removing `.osrm.nbg` to check that whole pipeline works without it - rm -rf "${PWD}/berlin-latest.osrm.nbg" + # docker-image-matrix: + # strategy: + # matrix: + # docker-base-image: ["debian", "alpine"] + # needs: format-taginfo-docs + # runs-on: ubuntu-22.04 + # continue-on-error: false + # steps: + # - name: Check out the repo + # uses: actions/checkout@v4 + # - name: Enable osm.pbf cache + # uses: actions/cache@v4 + # with: + # path: berlin-latest.osm.pbf + # key: v1-berlin-osm-pbf + # restore-keys: | + # v1-berlin-osm-pbf + # - name: Docker build + # run: | + # docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . + # - name: Test Docker image + # run: | + # if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then + # wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf + # fi + # TAG=osrm-backend-local + # # when `--memory-swap` value equals `--memory` it means container won't use swap + # # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details + # MEMORY_ARGS="--memory=1g --memory-swap=1g" + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson + # if [ ! -s "${PWD}/berlin-latest.geojson" ] + # then + # >&2 echo "No berlin-latest.geojson found" + # exit 1 + # fi + # # removing `.osrm.nbg` to check that whole pipeline works without it + # rm -rf "${PWD}/berlin-latest.osrm.nbg" - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm - docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & - curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" - docker stop osrm-container + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm + # docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & + # curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" + # docker stop osrm-container - build-test-publish: - #needs: format-taginfo-docs - strategy: - matrix: - include: - - name: gcc-13-debug-cov - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: gcc-13 - CUCUMBER_TIMEOUT: 20000 - CXXCOMPILER: g++-13 - ENABLE_COVERAGE: ON + # build-test-publish: + # #needs: format-taginfo-docs + # strategy: + # matrix: + # include: + # - name: gcc-13-debug-cov + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: gcc-13 + # CUCUMBER_TIMEOUT: 20000 + # CXXCOMPILER: g++-13 + # ENABLE_COVERAGE: ON - - name: clang-18-debug-asan-ubsan - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CUCUMBER_TIMEOUT: 20000 - CXXCOMPILER: clang++-18 - ENABLE_SANITIZER: ON - TARGET_ARCH: x86_64-asan-ubsan - OSRM_CONNECTION_RETRIES: 10 - OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 + # - name: clang-18-debug-asan-ubsan + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CUCUMBER_TIMEOUT: 20000 + # CXXCOMPILER: clang++-18 + # ENABLE_SANITIZER: ON + # TARGET_ARCH: x86_64-asan-ubsan + # OSRM_CONNECTION_RETRIES: 10 + # OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 - - name: clang-18-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-18-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-18-debug - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-18-debug + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-18-debug-clang-tidy - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_CLANG_TIDY: ON + # - name: clang-18-debug-clang-tidy + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_CLANG_TIDY: ON - - name: clang-17-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-17 - CXXCOMPILER: clang++-17 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-17-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-17 + # CXXCOMPILER: clang++-17 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-16-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-16-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: conan-linux-debug-asan-ubsan - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - ENABLE_CONAN: ON - ENABLE_SANITIZER: ON - ENABLE_LTO: OFF + # - name: conan-linux-debug-asan-ubsan + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # ENABLE_CONAN: ON + # ENABLE_SANITIZER: ON + # ENABLE_LTO: OFF - - name: conan-linux-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - ENABLE_CONAN: ON - ENABLE_LTO: OFF + # - name: conan-linux-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # ENABLE_CONAN: ON + # ENABLE_LTO: OFF - - name: gcc-14-release - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-14 - CXXCOMPILER: g++-14 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-14-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-14 + # CXXCOMPILER: g++-14 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: gcc-13-release - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-13 - CXXCOMPILER: g++-13 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-13-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-13 + # CXXCOMPILER: g++-13 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: gcc-12-release - continue-on-error: false - node: 20 - runs-on: ubuntu-22.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-12 - CXXCOMPILER: g++-12 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-12-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-22.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-12 + # CXXCOMPILER: g++-12 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: conan-linux-release-node - build_node_package: true - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TYPE: Release - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - ENABLE_CONAN: ON - NODE_PACKAGE_TESTS_ONLY: ON + # - name: conan-linux-release-node + # build_node_package: true + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TYPE: Release + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # ENABLE_CONAN: ON + # NODE_PACKAGE_TESTS_ONLY: ON - - name: conan-linux-debug-node - build_node_package: true - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TYPE: Debug - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - ENABLE_CONAN: ON - NODE_PACKAGE_TESTS_ONLY: ON + # - name: conan-linux-debug-node + # build_node_package: true + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TYPE: Debug + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # ENABLE_CONAN: ON + # NODE_PACKAGE_TESTS_ONLY: ON - - name: conan-macos-x64-release-node - build_node_package: true - continue-on-error: true - node: 20 - runs-on: macos-13 # x86_64 - BUILD_TYPE: Release - CCOMPILER: clang - CXXCOMPILER: clang++ - CUCUMBER_TIMEOUT: 60000 - ENABLE_ASSERTIONS: ON - ENABLE_CONAN: ON + # - name: conan-macos-x64-release-node + # build_node_package: true + # continue-on-error: true + # node: 20 + # runs-on: macos-13 # x86_64 + # BUILD_TYPE: Release + # CCOMPILER: clang + # CXXCOMPILER: clang++ + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_ASSERTIONS: ON + # ENABLE_CONAN: ON - - name: conan-macos-arm64-release-node - build_node_package: true - continue-on-error: true - node: 20 - runs-on: macos-14 # arm64 - BUILD_TYPE: Release - CCOMPILER: clang - CXXCOMPILER: clang++ - CUCUMBER_TIMEOUT: 60000 - ENABLE_ASSERTIONS: ON - ENABLE_CONAN: ON + # - name: conan-macos-arm64-release-node + # build_node_package: true + # continue-on-error: true + # node: 20 + # runs-on: macos-14 # arm64 + # BUILD_TYPE: Release + # CCOMPILER: clang + # CXXCOMPILER: clang++ + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_ASSERTIONS: ON + # ENABLE_CONAN: ON - name: ${{ matrix.name}} - continue-on-error: ${{ matrix.continue-on-error }} - runs-on: ${{ matrix.runs-on }} - env: - BUILD_TOOLS: ${{ matrix.BUILD_TOOLS }} - BUILD_TYPE: ${{ matrix.BUILD_TYPE }} - BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS }} - CCOMPILER: ${{ matrix.CCOMPILER }} - CFLAGS: ${{ matrix.CFLAGS }} - CUCUMBER_TIMEOUT: ${{ matrix.CUCUMBER_TIMEOUT }} - CXXCOMPILER: ${{ matrix.CXXCOMPILER }} - CXXFLAGS: ${{ matrix.CXXFLAGS }} - ENABLE_ASSERTIONS: ${{ matrix.ENABLE_ASSERTIONS }} - ENABLE_CLANG_TIDY: ${{ matrix.ENABLE_CLANG_TIDY }} - ENABLE_COVERAGE: ${{ matrix.ENABLE_COVERAGE }} - ENABLE_CONAN: ${{ matrix.ENABLE_CONAN }} - ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }} - NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }} - TARGET_ARCH: ${{ matrix.TARGET_ARCH }} - OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }} - OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }} - ENABLE_LTO: ${{ matrix.ENABLE_LTO }} - steps: - - uses: actions/checkout@v4 - - name: Build machine architecture - run: uname -m - - name: Use Node.js - uses: actions/setup-node@v4 - with: - node-version: ${{ matrix.node }} - - name: Enable Node.js cache - uses: actions/cache@v4 - with: - path: ~/.npm - key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - restore-keys: | - ${{ runner.os }}-node- - - name: Enable compiler cache - uses: actions/cache@v4 - with: - path: ~/.ccache - key: ccache-${{ matrix.name }}-${{ github.sha }} - restore-keys: | - ccache-${{ matrix.name }}- - - name: Enable Conan cache - uses: actions/cache@v4 - with: - path: ~/.conan2 - key: v10-conan-${{ matrix.name }}-${{ github.sha }} - restore-keys: | - v10-conan-${{ matrix.name }}- - - name: Enable test cache - uses: actions/cache@v4 - with: - path: ${{github.workspace}}/test/cache - key: v4-test-${{ matrix.name }}-${{ github.sha }} - restore-keys: | - v4-test-${{ matrix.name }}- - - name: Prepare environment - run: | - echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV - mkdir -p $HOME/.ccache + # name: ${{ matrix.name}} + # continue-on-error: ${{ matrix.continue-on-error }} + # runs-on: ${{ matrix.runs-on }} + # env: + # BUILD_TOOLS: ${{ matrix.BUILD_TOOLS }} + # BUILD_TYPE: ${{ matrix.BUILD_TYPE }} + # BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS }} + # CCOMPILER: ${{ matrix.CCOMPILER }} + # CFLAGS: ${{ matrix.CFLAGS }} + # CUCUMBER_TIMEOUT: ${{ matrix.CUCUMBER_TIMEOUT }} + # CXXCOMPILER: ${{ matrix.CXXCOMPILER }} + # CXXFLAGS: ${{ matrix.CXXFLAGS }} + # ENABLE_ASSERTIONS: ${{ matrix.ENABLE_ASSERTIONS }} + # ENABLE_CLANG_TIDY: ${{ matrix.ENABLE_CLANG_TIDY }} + # ENABLE_COVERAGE: ${{ matrix.ENABLE_COVERAGE }} + # ENABLE_CONAN: ${{ matrix.ENABLE_CONAN }} + # ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }} + # NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }} + # TARGET_ARCH: ${{ matrix.TARGET_ARCH }} + # OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }} + # OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }} + # ENABLE_LTO: ${{ matrix.ENABLE_LTO }} + # steps: + # - uses: actions/checkout@v4 + # - name: Build machine architecture + # run: uname -m + # - name: Use Node.js + # uses: actions/setup-node@v4 + # with: + # node-version: ${{ matrix.node }} + # - name: Enable Node.js cache + # uses: actions/cache@v4 + # with: + # path: ~/.npm + # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + # restore-keys: | + # ${{ runner.os }}-node- + # - name: Enable compiler cache + # uses: actions/cache@v4 + # with: + # path: ~/.ccache + # key: ccache-${{ matrix.name }}-${{ github.sha }} + # restore-keys: | + # ccache-${{ matrix.name }}- + # - name: Enable Conan cache + # uses: actions/cache@v4 + # with: + # path: ~/.conan2 + # key: v10-conan-${{ matrix.name }}-${{ github.sha }} + # restore-keys: | + # v10-conan-${{ matrix.name }}- + # - name: Enable test cache + # uses: actions/cache@v4 + # with: + # path: ${{github.workspace}}/test/cache + # key: v4-test-${{ matrix.name }}-${{ github.sha }} + # restore-keys: | + # v4-test-${{ matrix.name }}- + # - name: Prepare environment + # run: | + # echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV + # mkdir -p $HOME/.ccache - PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") - echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV - echo "OSRM_INSTALL_DIR=${GITHUB_WORKSPACE}/install-osrm" >> $GITHUB_ENV - echo "OSRM_BUILD_DIR=${GITHUB_WORKSPACE}/build-osrm" >> $GITHUB_ENV - if [[ "$ENABLE_SANITIZER" == 'ON' ]]; then - # We can only set this after checkout once we know the workspace directory - echo "LSAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/leaksanitizer.conf" >> $GITHUB_ENV - echo "UBSAN_OPTIONS=symbolize=1:halt_on_error=1:print_stacktrace=1:suppressions=${GITHUB_WORKSPACE}/scripts/ci/undefinedsanitizer.conf" >> $GITHUB_ENV - echo "ASAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/addresssanitizer.conf" >> $GITHUB_ENV - fi + # PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") + # echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV + # echo "OSRM_INSTALL_DIR=${GITHUB_WORKSPACE}/install-osrm" >> $GITHUB_ENV + # echo "OSRM_BUILD_DIR=${GITHUB_WORKSPACE}/build-osrm" >> $GITHUB_ENV + # if [[ "$ENABLE_SANITIZER" == 'ON' ]]; then + # # We can only set this after checkout once we know the workspace directory + # echo "LSAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/leaksanitizer.conf" >> $GITHUB_ENV + # echo "UBSAN_OPTIONS=symbolize=1:halt_on_error=1:print_stacktrace=1:suppressions=${GITHUB_WORKSPACE}/scripts/ci/undefinedsanitizer.conf" >> $GITHUB_ENV + # echo "ASAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/addresssanitizer.conf" >> $GITHUB_ENV + # fi - if [[ "${RUNNER_OS}" == "Linux" ]]; then - echo "JOBS=$((`nproc` + 1))" >> $GITHUB_ENV - elif [[ "${RUNNER_OS}" == "macOS" ]]; then - echo "JOBS=$((`sysctl -n hw.ncpu` + 1))" >> $GITHUB_ENV - fi - # See: https://github.com/actions/toolkit/issues/946#issuecomment-1590016041 - # We need it to be able to access system folders while restoring cached Boost below - - name: Give tar root ownership - if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' - run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar - - name: Cache Boost - if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' - id: cache-boost - uses: actions/cache@v4 - with: - path: | - /usr/local/include/boost - /usr/local/lib/libboost* - key: v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }} - restore-keys: | - v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }} + # if [[ "${RUNNER_OS}" == "Linux" ]]; then + # echo "JOBS=$((`nproc` + 1))" >> $GITHUB_ENV + # elif [[ "${RUNNER_OS}" == "macOS" ]]; then + # echo "JOBS=$((`sysctl -n hw.ncpu` + 1))" >> $GITHUB_ENV + # fi + # # See: https://github.com/actions/toolkit/issues/946#issuecomment-1590016041 + # # We need it to be able to access system folders while restoring cached Boost below + # - name: Give tar root ownership + # if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' + # run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar + # - name: Cache Boost + # if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' + # id: cache-boost + # uses: actions/cache@v4 + # with: + # path: | + # /usr/local/include/boost + # /usr/local/lib/libboost* + # key: v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }} + # restore-keys: | + # v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }} - - name: Install Boost - if: steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' - run: | - BOOST_VERSION="1.85.0" - BOOST_VERSION_UNDERSCORE="${BOOST_VERSION//./_}" - wget -q https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORE}.tar.gz - tar xzf boost_${BOOST_VERSION_UNDERSCORE}.tar.gz - cd boost_${BOOST_VERSION_UNDERSCORE} - sudo ./bootstrap.sh - sudo ./b2 install - cd .. - sudo rm -rf boost_${BOOST_VERSION_UNDERSCORE}* + # - name: Install Boost + # if: steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' + # run: | + # BOOST_VERSION="1.85.0" + # BOOST_VERSION_UNDERSCORE="${BOOST_VERSION//./_}" + # wget -q https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORE}.tar.gz + # tar xzf boost_${BOOST_VERSION_UNDERSCORE}.tar.gz + # cd boost_${BOOST_VERSION_UNDERSCORE} + # sudo ./bootstrap.sh + # sudo ./b2 install + # cd .. + # sudo rm -rf boost_${BOOST_VERSION_UNDERSCORE}* - - name: Install dev dependencies - run: | - # workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499 - # and that's why CI cannot find conan executable installed above - if [[ "${RUNNER_OS}" == "macOS" ]]; then - echo "/Library/Frameworks/Python.framework/Versions/Current/bin" >> $GITHUB_PATH - fi + # - name: Install dev dependencies + # run: | + # # workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499 + # # and that's why CI cannot find conan executable installed above + # if [[ "${RUNNER_OS}" == "macOS" ]]; then + # echo "/Library/Frameworks/Python.framework/Versions/Current/bin" >> $GITHUB_PATH + # fi - # ccache - if [[ "${RUNNER_OS}" == "Linux" ]]; then - sudo apt-get update -y && sudo apt-get install ccache - elif [[ "${RUNNER_OS}" == "macOS" ]]; then - brew install ccache - fi + # # ccache + # if [[ "${RUNNER_OS}" == "Linux" ]]; then + # sudo apt-get update -y && sudo apt-get install ccache + # elif [[ "${RUNNER_OS}" == "macOS" ]]; then + # brew install ccache + # fi - # Linux dev packages - if [ "${ENABLE_CONAN}" != "ON" ]; then - sudo apt-get update -y - sudo apt-get install -y libbz2-dev libxml2-dev libzip-dev liblua5.2-dev - if [[ "${CCOMPILER}" != clang-* ]]; then - sudo apt-get install -y ${CXXCOMPILER} - fi - if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then - sudo apt-get install -y lcov - fi - fi + # # Linux dev packages + # if [ "${ENABLE_CONAN}" != "ON" ]; then + # sudo apt-get update -y + # sudo apt-get install -y libbz2-dev libxml2-dev libzip-dev liblua5.2-dev + # if [[ "${CCOMPILER}" != clang-* ]]; then + # sudo apt-get install -y ${CXXCOMPILER} + # fi + # if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then + # sudo apt-get install -y lcov + # fi + # fi - # TBB - TBB_VERSION=2021.12.0 - if [[ "${RUNNER_OS}" == "Linux" ]]; then - TBB_URL="https://github.com/oneapi-src/oneTBB/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-lin.tgz" - elif [[ "${RUNNER_OS}" == "macOS" ]]; then - TBB_URL="https://github.com/oneapi-src/oneTBB/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-mac.tgz" - fi - wget --tries 5 ${TBB_URL} -O onetbb.tgz - tar zxvf onetbb.tgz - sudo cp -a oneapi-tbb-${TBB_VERSION}/lib/. /usr/local/lib/ - sudo cp -a oneapi-tbb-${TBB_VERSION}/include/. /usr/local/include/ - - name: Prepare build - run: | - mkdir ${OSRM_BUILD_DIR} - ccache --max-size=256M - npm ci --ignore-scripts - if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then - lcov --directory . --zerocounters # clean cached files - fi - echo "CC=${CCOMPILER}" >> $GITHUB_ENV - echo "CXX=${CXXCOMPILER}" >> $GITHUB_ENV - if [[ "${RUNNER_OS}" == "macOS" ]]; then - # missing from GCC path, needed for conan builds of libiconv, for example. - sudo xcode-select --switch /Library/Developer/CommandLineTools - echo "LIBRARY_PATH=${LIBRARY_PATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" >> $GITHUB_ENV - echo "CPATH=${CPATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" >> $GITHUB_ENV - fi + # # TBB + # TBB_VERSION=2021.12.0 + # if [[ "${RUNNER_OS}" == "Linux" ]]; then + # TBB_URL="https://github.com/oneapi-src/oneTBB/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-lin.tgz" + # elif [[ "${RUNNER_OS}" == "macOS" ]]; then + # TBB_URL="https://github.com/oneapi-src/oneTBB/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-mac.tgz" + # fi + # wget --tries 5 ${TBB_URL} -O onetbb.tgz + # tar zxvf onetbb.tgz + # sudo cp -a oneapi-tbb-${TBB_VERSION}/lib/. /usr/local/lib/ + # sudo cp -a oneapi-tbb-${TBB_VERSION}/include/. /usr/local/include/ + # - name: Prepare build + # run: | + # mkdir ${OSRM_BUILD_DIR} + # ccache --max-size=256M + # npm ci --ignore-scripts + # if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then + # lcov --directory . --zerocounters # clean cached files + # fi + # echo "CC=${CCOMPILER}" >> $GITHUB_ENV + # echo "CXX=${CXXCOMPILER}" >> $GITHUB_ENV + # if [[ "${RUNNER_OS}" == "macOS" ]]; then + # # missing from GCC path, needed for conan builds of libiconv, for example. + # sudo xcode-select --switch /Library/Developer/CommandLineTools + # echo "LIBRARY_PATH=${LIBRARY_PATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" >> $GITHUB_ENV + # echo "CPATH=${CPATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" >> $GITHUB_ENV + # fi - - name: Build and install OSRM - run: | - echo "Using ${JOBS} jobs" - pushd ${OSRM_BUILD_DIR} + # - name: Build and install OSRM + # run: | + # echo "Using ${JOBS} jobs" + # pushd ${OSRM_BUILD_DIR} - python3 -m venv .venv + # python3 -m venv .venv - source .venv/bin/activate + # source .venv/bin/activate - python3 -m pip install conan==2.7.1 + # python3 -m pip install conan==2.7.1 - conan profile detect --force + # conan profile detect --force - ccache --zero-stats - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_CONAN=${ENABLE_CONAN:-OFF} \ - -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ - -DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-OFF} \ - -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ - -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ - -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DENABLE_LTO=${ENABLE_LTO:-ON} \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} + # ccache --zero-stats + # cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ + # -DENABLE_CONAN=${ENABLE_CONAN:-OFF} \ + # -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ + # -DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-OFF} \ + # -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ + # -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ + # -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ + # -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ + # -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ + # -DENABLE_CCACHE=ON \ + # -DENABLE_LTO=${ENABLE_LTO:-ON} \ + # -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} - make --jobs=${JOBS} + # make --jobs=${JOBS} - if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then - make tests --jobs=${JOBS} - make benchmarks --jobs=${JOBS} + # if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then + # make tests --jobs=${JOBS} + # make benchmarks --jobs=${JOBS} - sudo make install - if [[ "${RUNNER_OS}" == "Linux" ]]; then - echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV - fi - echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV - fi - popd - - name: Build example - if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_CONAN != 'ON' }} - run: | - mkdir example/build && pushd example/build - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - make --jobs=${JOBS} - popd - - name: Run all tests - if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} - run: | - make -C test/data benchmark + # sudo make install + # if [[ "${RUNNER_OS}" == "Linux" ]]; then + # echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV + # fi + # echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV + # fi + # popd + # - name: Build example + # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_CONAN != 'ON' }} + # run: | + # mkdir example/build && pushd example/build + # cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + # make --jobs=${JOBS} + # popd + # - name: Run all tests + # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} + # run: | + # make -C test/data benchmark - # # macOS SIP strips the linker path. Reset this inside the running shell - # export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }} - # ./example/build/osrm-example test/data/mld/monaco.osrm + # # # macOS SIP strips the linker path. Reset this inside the running shell + # # export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }} + # # ./example/build/osrm-example test/data/mld/monaco.osrm - # All tests assume to be run from the build directory - pushd ${OSRM_BUILD_DIR} - for i in ./unit_tests/*-tests ; do echo Running $i ; $i ; done - if [ -z "${ENABLE_SANITIZER}" ]; then - npm run nodejs-tests - fi - popd - npm test + # # All tests assume to be run from the build directory + # pushd ${OSRM_BUILD_DIR} + # for i in ./unit_tests/*-tests ; do echo Running $i ; $i ; done + # if [ -z "${ENABLE_SANITIZER}" ]; then + # npm run nodejs-tests + # fi + # popd + # npm test - - name: Use Node 18 - if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - uses: actions/setup-node@v4 - with: - node-version: 18 - - name: Run Node package tests on Node 18 - if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - run: | - node --version - npm run nodejs-tests - - name: Use Node 20 - if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - uses: actions/setup-node@v4 - with: - node-version: 20 - - name: Run Node package tests on Node 20 - if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - run: | - node --version - npm run nodejs-tests - - name: Use Node latest - if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - uses: actions/setup-node@v4 - with: - node-version: latest - - name: Run Node package tests on Node-latest - if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - run: | - node --version - npm run nodejs-tests + # - name: Use Node 18 + # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + # uses: actions/setup-node@v4 + # with: + # node-version: 18 + # - name: Run Node package tests on Node 18 + # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + # run: | + # node --version + # npm run nodejs-tests + # - name: Use Node 20 + # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + # uses: actions/setup-node@v4 + # with: + # node-version: 20 + # - name: Run Node package tests on Node 20 + # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + # run: | + # node --version + # npm run nodejs-tests + # - name: Use Node latest + # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + # uses: actions/setup-node@v4 + # with: + # node-version: latest + # - name: Run Node package tests on Node-latest + # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + # run: | + # node --version + # npm run nodejs-tests - - name: Upload test logs - uses: actions/upload-artifact@v4 - if: failure() - with: - name: logs - path: test/logs/ + # - name: Upload test logs + # uses: actions/upload-artifact@v4 + # if: failure() + # with: + # name: logs + # path: test/logs/ - # - name: Generate code coverage - # if: ${{ matrix.ENABLE_COVERAGE == 'ON' }} - # run: | - # lcov --directory . --capture --output-file coverage.info # capture coverage info - # lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system - # lcov --list coverage.info #debug info + # # - name: Generate code coverage + # # if: ${{ matrix.ENABLE_COVERAGE == 'ON' }} + # # run: | + # # lcov --directory . --capture --output-file coverage.info # capture coverage info + # # lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system + # # lcov --list coverage.info #debug info - # # Uploading report to CodeCov - # - name: Upload code coverage - # if: ${{ matrix.ENABLE_COVERAGE == 'ON' }} - # uses: codecov/codecov-action@v4 - # with: - # files: coverage.info - # name: codecov-osrm-backend - # fail_ci_if_error: true - # verbose: true - - name: Build Node package - if: ${{ matrix.build_node_package }} - run: ./scripts/ci/node_package.sh - - name: Publish Node package - if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }} - uses: ncipollo/release-action@v1 - with: - allowUpdates: true - artifactErrorsFailBuild: true - artifacts: build/stage/**/*.tar.gz - omitBody: true - omitBodyDuringUpdate: true - omitName: true - omitNameDuringUpdate: true - replacesArtifacts: true - token: ${{ secrets.GITHUB_TOKEN }} - - name: Show CCache statistics - run: | - ccache -p - ccache -s + # # # Uploading report to CodeCov + # # - name: Upload code coverage + # # if: ${{ matrix.ENABLE_COVERAGE == 'ON' }} + # # uses: codecov/codecov-action@v4 + # # with: + # # files: coverage.info + # # name: codecov-osrm-backend + # # fail_ci_if_error: true + # # verbose: true + # - name: Build Node package + # if: ${{ matrix.build_node_package }} + # run: ./scripts/ci/node_package.sh + # - name: Publish Node package + # if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }} + # uses: ncipollo/release-action@v1 + # with: + # allowUpdates: true + # artifactErrorsFailBuild: true + # artifacts: build/stage/**/*.tar.gz + # omitBody: true + # omitBodyDuringUpdate: true + # omitName: true + # omitNameDuringUpdate: true + # replacesArtifacts: true + # token: ${{ secrets.GITHUB_TOKEN }} + # - name: Show CCache statistics + # run: | + # ccache -p + # ccache -s # benchmarks: # if: github.event_name == 'pull_request' diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e09308c2..27b6be1aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,6 +351,7 @@ find_package(TBB REQUIRED) find_package(EXPAT REQUIRED) find_package(BZip2 REQUIRED) find_package(Lua 5.2 REQUIRED) +fina_package(ZLIB REQUIRED) if (ENABLE_CONAN) add_dependency_includes(${Boost_INCLUDE_DIRS}) @@ -371,9 +372,12 @@ if (ENABLE_CONAN) add_dependency_includes(${lua_INCLUDE_DIRS}) + add_dependency_includes(${ZLIB_INCLUDE_DIRS}) + # note: we avoid calling find_package(Osmium ...) here to ensure that the # expat and bzip2 are used from conan rather than the system include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include) + else() add_dependency_includes(${Boost_INCLUDE_DIRS}) add_dependency_includes(${TBB_INCLUDE_DIR}) diff --git a/conanfile.py b/conanfile.py index e18fa3201..93af4c4fa 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,6 +9,7 @@ class OsrmConan(ConanFile): "expat/2.6.2", "lua/5.4.6", "onetbb/2021.12.0", + "zlib/1.3.1" ) generators = "CMakeDeps" From 7e2b7d47428267e4c04fbc9ea02cd2b45998c54c Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 17:29:25 +0200 Subject: [PATCH 41/73] wip --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 27b6be1aa..2192e4b49 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -351,7 +351,7 @@ find_package(TBB REQUIRED) find_package(EXPAT REQUIRED) find_package(BZip2 REQUIRED) find_package(Lua 5.2 REQUIRED) -fina_package(ZLIB REQUIRED) +find_package(ZLIB REQUIRED) if (ENABLE_CONAN) add_dependency_includes(${Boost_INCLUDE_DIRS}) From 022e950067ba90581fe3b7991f5b5e0b98bae801 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 17:34:24 +0200 Subject: [PATCH 42/73] wip --- CMakeLists.txt | 4 +--- conanfile.py | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 2192e4b49..8b95f04b6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,7 +160,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/generated/include/) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/include) -set(BOOST_COMPONENTS system date_time iostreams program_options thread unit_test_framework) +set(BOOST_COMPONENTS system date_time iostreams program_options thread unit_test_framework zlib) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in @@ -351,11 +351,9 @@ find_package(TBB REQUIRED) find_package(EXPAT REQUIRED) find_package(BZip2 REQUIRED) find_package(Lua 5.2 REQUIRED) -find_package(ZLIB REQUIRED) if (ENABLE_CONAN) add_dependency_includes(${Boost_INCLUDE_DIRS}) - set(BOOST_LIBRARIES ${Boost_LIBRARIES}) add_dependency_includes(${TBB_INCLUDE_DIR}) set(TBB_LIBRARIES ${TBB_LIBRARIES}) diff --git a/conanfile.py b/conanfile.py index 93af4c4fa..e653d7427 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,10 +9,10 @@ class OsrmConan(ConanFile): "expat/2.6.2", "lua/5.4.6", "onetbb/2021.12.0", - "zlib/1.3.1" ) generators = "CMakeDeps" + def configure(self): self.options["boost"].without_python = True self.options["boost"].without_coroutine = True From b6431944c45d4370b0f3db1f54e2ceaaadb0c3ce Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 17:40:02 +0200 Subject: [PATCH 43/73] wip --- CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b95f04b6..9d7afe6bb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -370,8 +370,6 @@ if (ENABLE_CONAN) add_dependency_includes(${lua_INCLUDE_DIRS}) - add_dependency_includes(${ZLIB_INCLUDE_DIRS}) - # note: we avoid calling find_package(Osmium ...) here to ensure that the # expat and bzip2 are used from conan rather than the system include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include) From ce6c050d73e5fb1fba1c15804465334af1aa0c83 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 17:41:43 +0200 Subject: [PATCH 44/73] wip --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d7afe6bb..0e5567ce6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -426,7 +426,7 @@ endif() # to ensure that osrm binaries play well with other binaries like nodejs find_package(ZLIB REQUIRED) add_dependency_includes(${ZLIB_INCLUDE_DIRS}) - +message(STATUS "Using zlib include dirs ${ZLIB_INCLUDE_DIRS}") add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3) add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE) From a67ef6f166cde568f2b512e4232ec4d63e012e0a Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 18:44:10 +0200 Subject: [PATCH 45/73] wip --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e5567ce6..71294406f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -426,6 +426,9 @@ endif() # to ensure that osrm binaries play well with other binaries like nodejs find_package(ZLIB REQUIRED) add_dependency_includes(${ZLIB_INCLUDE_DIRS}) +message(STATUS "Zlib found: ${ZLIB_FOUND}") +message(STATUS "Zlib include dirs: ${ZLIB_INCLUDE_DIRS}") +message(STATUS "Zlib libraries: ${ZLIB_LIBRARIES}") message(STATUS "Using zlib include dirs ${ZLIB_INCLUDE_DIRS}") add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3) add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE) From 34617619bb701319545d257069f2687dfe7cb8c2 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 19:10:15 +0200 Subject: [PATCH 46/73] wip --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 71294406f..91b8ed9a8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -430,6 +430,8 @@ message(STATUS "Zlib found: ${ZLIB_FOUND}") message(STATUS "Zlib include dirs: ${ZLIB_INCLUDE_DIRS}") message(STATUS "Zlib libraries: ${ZLIB_LIBRARIES}") message(STATUS "Using zlib include dirs ${ZLIB_INCLUDE_DIRS}") +set(ZLIB_LIBRARY ${ZLIB_LIBRARIES}) + add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3) add_dependency_defines(-DBOOST_RESULT_OF_USE_DECLTYPE) From c0613376500c262cc6ed94173634b5094f672a3e Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 13 Oct 2024 19:41:51 +0200 Subject: [PATCH 47/73] wip --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91b8ed9a8..b2bc4bc64 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -458,6 +458,7 @@ target_link_libraries(osrm-partition osrm_partition ${Boost_PROGRAM_OPTIONS_LIBR target_link_libraries(osrm-customize osrm_customize ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY}) if (BUILD_ROUTED) + message(STATUS "Building osrm-routed ${ZLIB_LIBRARY}") target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY}) endif() @@ -476,6 +477,7 @@ set(GUIDANCE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} ${LUA_LIBRARIES} ${TBB_LIBRARIES} + ${ZLIB_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(PARTITIONER_LIBRARIES ${BOOST_LIBRARIES} @@ -486,6 +488,7 @@ set(PARTITIONER_LIBRARIES ${ZLIB_LIBRARY}) set(CUSTOMIZER_LIBRARIES ${BOOST_LIBRARIES} + ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} @@ -499,6 +502,7 @@ set(UPDATER_LIBRARIES ${ZLIB_LIBRARY}) set(CONTRACTOR_LIBRARIES ${BOOST_LIBRARIES} + ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${LUA_LIBRARIES} ${TBB_LIBRARIES} @@ -513,6 +517,7 @@ set(ENGINE_LIBRARIES ${ZLIB_LIBRARY}) set(STORAGE_LIBRARIES ${BOOST_LIBRARIES} + ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} From d5564cc12718794c035137e6f8ed14b41a4eaaa8 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 20 Oct 2024 19:40:19 +0200 Subject: [PATCH 48/73] wip --- .github/workflows/osrm-backend.yml | 4 ---- CMakeLists.txt | 2 +- conanfile.py | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 6861be62b..d6036b06a 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -58,10 +58,6 @@ jobs: conan profile detect --force - # conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 - - # ls -la - cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON .. cmake --build . --config Release diff --git a/CMakeLists.txt b/CMakeLists.txt index b2bc4bc64..237d73e29 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -345,7 +345,7 @@ if (MSVC) add_definitions(-DBOOST_ALL_NO_LIB) endif() -# set(Boost_USE_STATIC_LIBS ON) +set(Boost_USE_STATIC_LIBS ON) find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) find_package(TBB REQUIRED) find_package(EXPAT REQUIRED) diff --git a/conanfile.py b/conanfile.py index e653d7427..384a146cc 100644 --- a/conanfile.py +++ b/conanfile.py @@ -9,6 +9,7 @@ class OsrmConan(ConanFile): "expat/2.6.2", "lua/5.4.6", "onetbb/2021.12.0", + "zlib/1.3.1" ) generators = "CMakeDeps" From 22c8a3dd2a4db47ae95bcc252060b1d7e0d074ca Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 20 Oct 2024 19:43:30 +0200 Subject: [PATCH 49/73] wip --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 237d73e29..e187c62a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,8 +30,8 @@ if (ENABLE_CONAN) ERROR_VARIABLE conan_stderr RESULT_VARIABLE conan_install_result ) - # message(STATUS "Conan install stdout: ${conan_stdout} ${CMAKE_BUILD_TYPE}") - # message(STATUS "Conan install stderr: ${conan_stderr}") + message(STATUS "Conan install stdout: ${conan_stdout} ${CMAKE_BUILD_TYPE}") + message(STATUS "Conan install stderr: ${conan_stderr}") if (NOT conan_install_result EQUAL 0) message(FATAL_ERROR "Conan install failed.") @@ -354,6 +354,8 @@ find_package(Lua 5.2 REQUIRED) if (ENABLE_CONAN) add_dependency_includes(${Boost_INCLUDE_DIRS}) + set(BOOST_LIBRARIES ${Boost_LIBRARIES}) + add_dependency_includes(${TBB_INCLUDE_DIR}) set(TBB_LIBRARIES ${TBB_LIBRARIES}) From df5da66b8f13b7b02354a516681e59e252ab1adb Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 21 Oct 2024 17:24:25 +0200 Subject: [PATCH 50/73] wip --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e187c62a2..ec1cd8137 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -359,7 +359,7 @@ if (ENABLE_CONAN) add_dependency_includes(${TBB_INCLUDE_DIR}) set(TBB_LIBRARIES ${TBB_LIBRARIES}) - add_dependency_includes(${EXPAT_INCLUDE_DIRS}) + add_dependency_includes(${expat_INCLUDE_DIRS}) set(EXPAT_LIBRARIES ${expat_LIBRARIES}) set(EXPAT_INCLUDE_DIRS ${expat_INCLUDE_DIRS}) From c127194b263723c8653d833ad7d8bcb28958ba4b Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 21 Oct 2024 20:49:16 +0200 Subject: [PATCH 51/73] wip --- .github/workflows/osrm-backend.yml | 3 +++ conanfile.py | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index d6036b06a..e03568262 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -44,6 +44,9 @@ jobs: echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV - run: npm install --ignore-scripts - run: npm link --ignore-scripts + - name: Install zlib + run: | + choco install zlib - name: Build shell: bash run: | diff --git a/conanfile.py b/conanfile.py index 384a146cc..1fb98a2e9 100644 --- a/conanfile.py +++ b/conanfile.py @@ -8,8 +8,7 @@ class OsrmConan(ConanFile): "bzip2/1.0.8", "expat/2.6.2", "lua/5.4.6", - "onetbb/2021.12.0", - "zlib/1.3.1" + "onetbb/2021.12.0" ) generators = "CMakeDeps" From 9ed9d6cfcdb45597f28f2ab94d51333a54c76be6 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 21 Oct 2024 21:18:22 +0200 Subject: [PATCH 52/73] wip --- .github/workflows/osrm-backend.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index e03568262..8d93d9d26 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -44,9 +44,14 @@ jobs: echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV - run: npm install --ignore-scripts - run: npm link --ignore-scripts - - name: Install zlib + - name: Install Zlib Using Scoop run: | - choco install zlib + echo "C:/Users/runneradmin/scoop/shims" >> $env:GITHUB_PATH + Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" + refreshenv + scoop bucket add extras + scoop install zlib + regedit /s "C:\\Users\\runneradmin\\scoop\\apps\\zlib\\current\\register.reg" - name: Build shell: bash run: | From cc0eeb2cc793a4b73959e3d2dffaf9d6bdeca574 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Mon, 21 Oct 2024 21:23:09 +0200 Subject: [PATCH 53/73] wip --- .github/workflows/osrm-backend.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 8d93d9d26..526f83def 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -46,6 +46,7 @@ jobs: - run: npm link --ignore-scripts - name: Install Zlib Using Scoop run: | + iex "& {$(irm get.scoop.sh)} -RunAsAdmin" echo "C:/Users/runneradmin/scoop/shims" >> $env:GITHUB_PATH Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" refreshenv From 5d6468f8e735a25a249bbc1e3c0d2951bfb2720a Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 22 Oct 2024 19:17:22 +0200 Subject: [PATCH 54/73] wip --- conanfile.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/conanfile.py b/conanfile.py index 1fb98a2e9..678107472 100644 --- a/conanfile.py +++ b/conanfile.py @@ -3,16 +3,17 @@ from conan.tools.cmake import CMake, CMakeToolchain, CMakeDeps class OsrmConan(ConanFile): settings = "os", "compiler", "build_type", "arch" - requires = ( - "boost/1.85.0", - "bzip2/1.0.8", - "expat/2.6.2", - "lua/5.4.6", - "onetbb/2021.12.0" - ) generators = "CMakeDeps" - + def requirements(self): + self.requires("boost/1.85.0") + self.requires("bzip2/1.0.8") + self.requires("expat/2.6.2") + self.requires("lua/5.4.6") + self.requires("onetbb/2021.12.0") + if self.settings.os == "Windows": + self.requires("zlib/1.3.1") + def configure(self): self.options["boost"].without_python = True self.options["boost"].without_coroutine = True From c39dc2ee0dfeaacbb21b984251a16ac8859b5000 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 22 Oct 2024 19:52:25 +0200 Subject: [PATCH 55/73] wip --- .github/workflows/osrm-backend.yml | 1045 ++++++++++++++-------------- 1 file changed, 518 insertions(+), 527 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 526f83def..502bccadf 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -44,15 +44,6 @@ jobs: echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV - run: npm install --ignore-scripts - run: npm link --ignore-scripts - - name: Install Zlib Using Scoop - run: | - iex "& {$(irm get.scoop.sh)} -RunAsAdmin" - echo "C:/Users/runneradmin/scoop/shims" >> $env:GITHUB_PATH - Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1" - refreshenv - scoop bucket add extras - scoop install zlib - regedit /s "C:\\Users\\runneradmin\\scoop\\apps\\zlib\\current\\register.reg" - name: Build shell: bash run: | @@ -105,566 +96,566 @@ jobs: replacesArtifacts: true token: ${{ secrets.GITHUB_TOKEN }} - # format-taginfo-docs: - # runs-on: ubuntu-22.04 - # steps: - # - uses: actions/checkout@v4 - # - name: Use Node.js - # uses: actions/setup-node@v4 - # with: - # node-version: 18 - # - name: Enable Node.js cache - # uses: actions/cache@v4 - # with: - # path: ~/.npm - # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-node- - # - name: Prepare environment - # run: | - # npm ci --ignore-scripts - # clang-format-15 --version - # - name: Run checks - # run: | - # ./scripts/check_taginfo.py taginfo.json profiles/car.lua - # ./scripts/format.sh && ./scripts/error_on_dirty.sh - # node ./scripts/validate_changelog.js - # npm run docs && ./scripts/error_on_dirty.sh - # npm audit --production + format-taginfo-docs: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Enable Node.js cache + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Prepare environment + run: | + npm ci --ignore-scripts + clang-format-15 --version + - name: Run checks + run: | + ./scripts/check_taginfo.py taginfo.json profiles/car.lua + ./scripts/format.sh && ./scripts/error_on_dirty.sh + node ./scripts/validate_changelog.js + npm run docs && ./scripts/error_on_dirty.sh + npm audit --production - # docker-image-matrix: - # strategy: - # matrix: - # docker-base-image: ["debian", "alpine"] - # needs: format-taginfo-docs - # runs-on: ubuntu-22.04 - # continue-on-error: false - # steps: - # - name: Check out the repo - # uses: actions/checkout@v4 - # - name: Enable osm.pbf cache - # uses: actions/cache@v4 - # with: - # path: berlin-latest.osm.pbf - # key: v1-berlin-osm-pbf - # restore-keys: | - # v1-berlin-osm-pbf - # - name: Docker build - # run: | - # docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . - # - name: Test Docker image - # run: | - # if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then - # wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf - # fi - # TAG=osrm-backend-local - # # when `--memory-swap` value equals `--memory` it means container won't use swap - # # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details - # MEMORY_ARGS="--memory=1g --memory-swap=1g" - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson - # if [ ! -s "${PWD}/berlin-latest.geojson" ] - # then - # >&2 echo "No berlin-latest.geojson found" - # exit 1 - # fi - # # removing `.osrm.nbg` to check that whole pipeline works without it - # rm -rf "${PWD}/berlin-latest.osrm.nbg" + docker-image-matrix: + strategy: + matrix: + docker-base-image: ["debian", "alpine"] + needs: format-taginfo-docs + runs-on: ubuntu-22.04 + continue-on-error: false + steps: + - name: Check out the repo + uses: actions/checkout@v4 + - name: Enable osm.pbf cache + uses: actions/cache@v4 + with: + path: berlin-latest.osm.pbf + key: v1-berlin-osm-pbf + restore-keys: | + v1-berlin-osm-pbf + - name: Docker build + run: | + docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . + - name: Test Docker image + run: | + if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then + wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf + fi + TAG=osrm-backend-local + # when `--memory-swap` value equals `--memory` it means container won't use swap + # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details + MEMORY_ARGS="--memory=1g --memory-swap=1g" + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson + if [ ! -s "${PWD}/berlin-latest.geojson" ] + then + >&2 echo "No berlin-latest.geojson found" + exit 1 + fi + # removing `.osrm.nbg` to check that whole pipeline works without it + rm -rf "${PWD}/berlin-latest.osrm.nbg" - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm - # docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & - # curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" - # docker stop osrm-container + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm + docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & + curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" + docker stop osrm-container - # build-test-publish: - # #needs: format-taginfo-docs - # strategy: - # matrix: - # include: - # - name: gcc-13-debug-cov - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: gcc-13 - # CUCUMBER_TIMEOUT: 20000 - # CXXCOMPILER: g++-13 - # ENABLE_COVERAGE: ON + build-test-publish: + #needs: format-taginfo-docs + strategy: + matrix: + include: + - name: gcc-13-debug-cov + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: gcc-13 + CUCUMBER_TIMEOUT: 20000 + CXXCOMPILER: g++-13 + ENABLE_COVERAGE: ON - # - name: clang-18-debug-asan-ubsan - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CUCUMBER_TIMEOUT: 20000 - # CXXCOMPILER: clang++-18 - # ENABLE_SANITIZER: ON - # TARGET_ARCH: x86_64-asan-ubsan - # OSRM_CONNECTION_RETRIES: 10 - # OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 + - name: clang-18-debug-asan-ubsan + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CUCUMBER_TIMEOUT: 20000 + CXXCOMPILER: clang++-18 + ENABLE_SANITIZER: ON + TARGET_ARCH: x86_64-asan-ubsan + OSRM_CONNECTION_RETRIES: 10 + OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 - # - name: clang-18-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-18-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-18-debug - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-18-debug + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-18-debug-clang-tidy - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_CLANG_TIDY: ON + - name: clang-18-debug-clang-tidy + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_CLANG_TIDY: ON - # - name: clang-17-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-17 - # CXXCOMPILER: clang++-17 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-17-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-17 + CXXCOMPILER: clang++-17 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-16-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-16-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: conan-linux-debug-asan-ubsan - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # ENABLE_CONAN: ON - # ENABLE_SANITIZER: ON - # ENABLE_LTO: OFF + - name: conan-linux-debug-asan-ubsan + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + ENABLE_CONAN: ON + ENABLE_SANITIZER: ON + ENABLE_LTO: OFF - # - name: conan-linux-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # ENABLE_CONAN: ON - # ENABLE_LTO: OFF + - name: conan-linux-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + ENABLE_CONAN: ON + ENABLE_LTO: OFF - # - name: gcc-14-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-14 - # CXXCOMPILER: g++-14 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-14-release + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-14 + CXXCOMPILER: g++-14 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: gcc-13-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-13 - # CXXCOMPILER: g++-13 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-13-release + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-13 + CXXCOMPILER: g++-13 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: gcc-12-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-22.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-12 - # CXXCOMPILER: g++-12 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-12-release + continue-on-error: false + node: 20 + runs-on: ubuntu-22.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-12 + CXXCOMPILER: g++-12 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: conan-linux-release-node - # build_node_package: true - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TYPE: Release - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # ENABLE_CONAN: ON - # NODE_PACKAGE_TESTS_ONLY: ON + - name: conan-linux-release-node + build_node_package: true + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TYPE: Release + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + ENABLE_CONAN: ON + NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-linux-debug-node - # build_node_package: true - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TYPE: Debug - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # ENABLE_CONAN: ON - # NODE_PACKAGE_TESTS_ONLY: ON + - name: conan-linux-debug-node + build_node_package: true + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TYPE: Debug + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + ENABLE_CONAN: ON + NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-macos-x64-release-node - # build_node_package: true - # continue-on-error: true - # node: 20 - # runs-on: macos-13 # x86_64 - # BUILD_TYPE: Release - # CCOMPILER: clang - # CXXCOMPILER: clang++ - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_ASSERTIONS: ON - # ENABLE_CONAN: ON + - name: conan-macos-x64-release-node + build_node_package: true + continue-on-error: true + node: 20 + runs-on: macos-13 # x86_64 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_CONAN: ON - # - name: conan-macos-arm64-release-node - # build_node_package: true - # continue-on-error: true - # node: 20 - # runs-on: macos-14 # arm64 - # BUILD_TYPE: Release - # CCOMPILER: clang - # CXXCOMPILER: clang++ - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_ASSERTIONS: ON - # ENABLE_CONAN: ON + - name: conan-macos-arm64-release-node + build_node_package: true + continue-on-error: true + node: 20 + runs-on: macos-14 # arm64 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_CONAN: ON - # name: ${{ matrix.name}} - # continue-on-error: ${{ matrix.continue-on-error }} - # runs-on: ${{ matrix.runs-on }} - # env: - # BUILD_TOOLS: ${{ matrix.BUILD_TOOLS }} - # BUILD_TYPE: ${{ matrix.BUILD_TYPE }} - # BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS }} - # CCOMPILER: ${{ matrix.CCOMPILER }} - # CFLAGS: ${{ matrix.CFLAGS }} - # CUCUMBER_TIMEOUT: ${{ matrix.CUCUMBER_TIMEOUT }} - # CXXCOMPILER: ${{ matrix.CXXCOMPILER }} - # CXXFLAGS: ${{ matrix.CXXFLAGS }} - # ENABLE_ASSERTIONS: ${{ matrix.ENABLE_ASSERTIONS }} - # ENABLE_CLANG_TIDY: ${{ matrix.ENABLE_CLANG_TIDY }} - # ENABLE_COVERAGE: ${{ matrix.ENABLE_COVERAGE }} - # ENABLE_CONAN: ${{ matrix.ENABLE_CONAN }} - # ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }} - # NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }} - # TARGET_ARCH: ${{ matrix.TARGET_ARCH }} - # OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }} - # OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }} - # ENABLE_LTO: ${{ matrix.ENABLE_LTO }} - # steps: - # - uses: actions/checkout@v4 - # - name: Build machine architecture - # run: uname -m - # - name: Use Node.js - # uses: actions/setup-node@v4 - # with: - # node-version: ${{ matrix.node }} - # - name: Enable Node.js cache - # uses: actions/cache@v4 - # with: - # path: ~/.npm - # key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} - # restore-keys: | - # ${{ runner.os }}-node- - # - name: Enable compiler cache - # uses: actions/cache@v4 - # with: - # path: ~/.ccache - # key: ccache-${{ matrix.name }}-${{ github.sha }} - # restore-keys: | - # ccache-${{ matrix.name }}- - # - name: Enable Conan cache - # uses: actions/cache@v4 - # with: - # path: ~/.conan2 - # key: v10-conan-${{ matrix.name }}-${{ github.sha }} - # restore-keys: | - # v10-conan-${{ matrix.name }}- - # - name: Enable test cache - # uses: actions/cache@v4 - # with: - # path: ${{github.workspace}}/test/cache - # key: v4-test-${{ matrix.name }}-${{ github.sha }} - # restore-keys: | - # v4-test-${{ matrix.name }}- - # - name: Prepare environment - # run: | - # echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV - # mkdir -p $HOME/.ccache + name: ${{ matrix.name}} + continue-on-error: ${{ matrix.continue-on-error }} + runs-on: ${{ matrix.runs-on }} + env: + BUILD_TOOLS: ${{ matrix.BUILD_TOOLS }} + BUILD_TYPE: ${{ matrix.BUILD_TYPE }} + BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS }} + CCOMPILER: ${{ matrix.CCOMPILER }} + CFLAGS: ${{ matrix.CFLAGS }} + CUCUMBER_TIMEOUT: ${{ matrix.CUCUMBER_TIMEOUT }} + CXXCOMPILER: ${{ matrix.CXXCOMPILER }} + CXXFLAGS: ${{ matrix.CXXFLAGS }} + ENABLE_ASSERTIONS: ${{ matrix.ENABLE_ASSERTIONS }} + ENABLE_CLANG_TIDY: ${{ matrix.ENABLE_CLANG_TIDY }} + ENABLE_COVERAGE: ${{ matrix.ENABLE_COVERAGE }} + ENABLE_CONAN: ${{ matrix.ENABLE_CONAN }} + ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }} + NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }} + TARGET_ARCH: ${{ matrix.TARGET_ARCH }} + OSRM_CONNECTION_RETRIES: ${{ matrix.OSRM_CONNECTION_RETRIES }} + OSRM_CONNECTION_EXP_BACKOFF_COEF: ${{ matrix.OSRM_CONNECTION_EXP_BACKOFF_COEF }} + ENABLE_LTO: ${{ matrix.ENABLE_LTO }} + steps: + - uses: actions/checkout@v4 + - name: Build machine architecture + run: uname -m + - name: Use Node.js + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node }} + - name: Enable Node.js cache + uses: actions/cache@v4 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Enable compiler cache + uses: actions/cache@v4 + with: + path: ~/.ccache + key: ccache-${{ matrix.name }}-${{ github.sha }} + restore-keys: | + ccache-${{ matrix.name }}- + - name: Enable Conan cache + uses: actions/cache@v4 + with: + path: ~/.conan2 + key: v10-conan-${{ matrix.name }}-${{ github.sha }} + restore-keys: | + v10-conan-${{ matrix.name }}- + - name: Enable test cache + uses: actions/cache@v4 + with: + path: ${{github.workspace}}/test/cache + key: v4-test-${{ matrix.name }}-${{ github.sha }} + restore-keys: | + v4-test-${{ matrix.name }}- + - name: Prepare environment + run: | + echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV + mkdir -p $HOME/.ccache - # PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") - # echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV - # echo "OSRM_INSTALL_DIR=${GITHUB_WORKSPACE}/install-osrm" >> $GITHUB_ENV - # echo "OSRM_BUILD_DIR=${GITHUB_WORKSPACE}/build-osrm" >> $GITHUB_ENV - # if [[ "$ENABLE_SANITIZER" == 'ON' ]]; then - # # We can only set this after checkout once we know the workspace directory - # echo "LSAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/leaksanitizer.conf" >> $GITHUB_ENV - # echo "UBSAN_OPTIONS=symbolize=1:halt_on_error=1:print_stacktrace=1:suppressions=${GITHUB_WORKSPACE}/scripts/ci/undefinedsanitizer.conf" >> $GITHUB_ENV - # echo "ASAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/addresssanitizer.conf" >> $GITHUB_ENV - # fi + PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") + echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV + echo "OSRM_INSTALL_DIR=${GITHUB_WORKSPACE}/install-osrm" >> $GITHUB_ENV + echo "OSRM_BUILD_DIR=${GITHUB_WORKSPACE}/build-osrm" >> $GITHUB_ENV + if [[ "$ENABLE_SANITIZER" == 'ON' ]]; then + # We can only set this after checkout once we know the workspace directory + echo "LSAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/leaksanitizer.conf" >> $GITHUB_ENV + echo "UBSAN_OPTIONS=symbolize=1:halt_on_error=1:print_stacktrace=1:suppressions=${GITHUB_WORKSPACE}/scripts/ci/undefinedsanitizer.conf" >> $GITHUB_ENV + echo "ASAN_OPTIONS=print_suppressions=0:suppressions=${GITHUB_WORKSPACE}/scripts/ci/addresssanitizer.conf" >> $GITHUB_ENV + fi - # if [[ "${RUNNER_OS}" == "Linux" ]]; then - # echo "JOBS=$((`nproc` + 1))" >> $GITHUB_ENV - # elif [[ "${RUNNER_OS}" == "macOS" ]]; then - # echo "JOBS=$((`sysctl -n hw.ncpu` + 1))" >> $GITHUB_ENV - # fi - # # See: https://github.com/actions/toolkit/issues/946#issuecomment-1590016041 - # # We need it to be able to access system folders while restoring cached Boost below - # - name: Give tar root ownership - # if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' - # run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar - # - name: Cache Boost - # if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' - # id: cache-boost - # uses: actions/cache@v4 - # with: - # path: | - # /usr/local/include/boost - # /usr/local/lib/libboost* - # key: v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }} - # restore-keys: | - # v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }} + if [[ "${RUNNER_OS}" == "Linux" ]]; then + echo "JOBS=$((`nproc` + 1))" >> $GITHUB_ENV + elif [[ "${RUNNER_OS}" == "macOS" ]]; then + echo "JOBS=$((`sysctl -n hw.ncpu` + 1))" >> $GITHUB_ENV + fi + # See: https://github.com/actions/toolkit/issues/946#issuecomment-1590016041 + # We need it to be able to access system folders while restoring cached Boost below + - name: Give tar root ownership + if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' + run: sudo chown root /bin/tar && sudo chmod u+s /bin/tar + - name: Cache Boost + if: runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' + id: cache-boost + uses: actions/cache@v4 + with: + path: | + /usr/local/include/boost + /usr/local/lib/libboost* + key: v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }} + restore-keys: | + v1-boost-${{ runner.os }}-${{ runner.arch }}-${{ matrix.runs-on }} - # - name: Install Boost - # if: steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' - # run: | - # BOOST_VERSION="1.85.0" - # BOOST_VERSION_UNDERSCORE="${BOOST_VERSION//./_}" - # wget -q https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORE}.tar.gz - # tar xzf boost_${BOOST_VERSION_UNDERSCORE}.tar.gz - # cd boost_${BOOST_VERSION_UNDERSCORE} - # sudo ./bootstrap.sh - # sudo ./b2 install - # cd .. - # sudo rm -rf boost_${BOOST_VERSION_UNDERSCORE}* + - name: Install Boost + if: steps.cache-boost.outputs.cache-hit != 'true' && runner.os == 'Linux' && matrix.ENABLE_CONAN != 'ON' + run: | + BOOST_VERSION="1.85.0" + BOOST_VERSION_UNDERSCORE="${BOOST_VERSION//./_}" + wget -q https://boostorg.jfrog.io/artifactory/main/release/${BOOST_VERSION}/source/boost_${BOOST_VERSION_UNDERSCORE}.tar.gz + tar xzf boost_${BOOST_VERSION_UNDERSCORE}.tar.gz + cd boost_${BOOST_VERSION_UNDERSCORE} + sudo ./bootstrap.sh + sudo ./b2 install + cd .. + sudo rm -rf boost_${BOOST_VERSION_UNDERSCORE}* - # - name: Install dev dependencies - # run: | - # # workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499 - # # and that's why CI cannot find conan executable installed above - # if [[ "${RUNNER_OS}" == "macOS" ]]; then - # echo "/Library/Frameworks/Python.framework/Versions/Current/bin" >> $GITHUB_PATH - # fi + - name: Install dev dependencies + run: | + # workaround for issue that GitHub Actions seems to not adding it to PATH after https://github.com/actions/runner-images/pull/6499 + # and that's why CI cannot find conan executable installed above + if [[ "${RUNNER_OS}" == "macOS" ]]; then + echo "/Library/Frameworks/Python.framework/Versions/Current/bin" >> $GITHUB_PATH + fi - # # ccache - # if [[ "${RUNNER_OS}" == "Linux" ]]; then - # sudo apt-get update -y && sudo apt-get install ccache - # elif [[ "${RUNNER_OS}" == "macOS" ]]; then - # brew install ccache - # fi + # ccache + if [[ "${RUNNER_OS}" == "Linux" ]]; then + sudo apt-get update -y && sudo apt-get install ccache + elif [[ "${RUNNER_OS}" == "macOS" ]]; then + brew install ccache + fi - # # Linux dev packages - # if [ "${ENABLE_CONAN}" != "ON" ]; then - # sudo apt-get update -y - # sudo apt-get install -y libbz2-dev libxml2-dev libzip-dev liblua5.2-dev - # if [[ "${CCOMPILER}" != clang-* ]]; then - # sudo apt-get install -y ${CXXCOMPILER} - # fi - # if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then - # sudo apt-get install -y lcov - # fi - # fi + # Linux dev packages + if [ "${ENABLE_CONAN}" != "ON" ]; then + sudo apt-get update -y + sudo apt-get install -y libbz2-dev libxml2-dev libzip-dev liblua5.2-dev + if [[ "${CCOMPILER}" != clang-* ]]; then + sudo apt-get install -y ${CXXCOMPILER} + fi + if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then + sudo apt-get install -y lcov + fi + fi - # # TBB - # TBB_VERSION=2021.12.0 - # if [[ "${RUNNER_OS}" == "Linux" ]]; then - # TBB_URL="https://github.com/oneapi-src/oneTBB/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-lin.tgz" - # elif [[ "${RUNNER_OS}" == "macOS" ]]; then - # TBB_URL="https://github.com/oneapi-src/oneTBB/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-mac.tgz" - # fi - # wget --tries 5 ${TBB_URL} -O onetbb.tgz - # tar zxvf onetbb.tgz - # sudo cp -a oneapi-tbb-${TBB_VERSION}/lib/. /usr/local/lib/ - # sudo cp -a oneapi-tbb-${TBB_VERSION}/include/. /usr/local/include/ - # - name: Prepare build - # run: | - # mkdir ${OSRM_BUILD_DIR} - # ccache --max-size=256M - # npm ci --ignore-scripts - # if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then - # lcov --directory . --zerocounters # clean cached files - # fi - # echo "CC=${CCOMPILER}" >> $GITHUB_ENV - # echo "CXX=${CXXCOMPILER}" >> $GITHUB_ENV - # if [[ "${RUNNER_OS}" == "macOS" ]]; then - # # missing from GCC path, needed for conan builds of libiconv, for example. - # sudo xcode-select --switch /Library/Developer/CommandLineTools - # echo "LIBRARY_PATH=${LIBRARY_PATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" >> $GITHUB_ENV - # echo "CPATH=${CPATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" >> $GITHUB_ENV - # fi + # TBB + TBB_VERSION=2021.12.0 + if [[ "${RUNNER_OS}" == "Linux" ]]; then + TBB_URL="https://github.com/oneapi-src/oneTBB/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-lin.tgz" + elif [[ "${RUNNER_OS}" == "macOS" ]]; then + TBB_URL="https://github.com/oneapi-src/oneTBB/releases/download/v${TBB_VERSION}/oneapi-tbb-${TBB_VERSION}-mac.tgz" + fi + wget --tries 5 ${TBB_URL} -O onetbb.tgz + tar zxvf onetbb.tgz + sudo cp -a oneapi-tbb-${TBB_VERSION}/lib/. /usr/local/lib/ + sudo cp -a oneapi-tbb-${TBB_VERSION}/include/. /usr/local/include/ + - name: Prepare build + run: | + mkdir ${OSRM_BUILD_DIR} + ccache --max-size=256M + npm ci --ignore-scripts + if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then + lcov --directory . --zerocounters # clean cached files + fi + echo "CC=${CCOMPILER}" >> $GITHUB_ENV + echo "CXX=${CXXCOMPILER}" >> $GITHUB_ENV + if [[ "${RUNNER_OS}" == "macOS" ]]; then + # missing from GCC path, needed for conan builds of libiconv, for example. + sudo xcode-select --switch /Library/Developer/CommandLineTools + echo "LIBRARY_PATH=${LIBRARY_PATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib" >> $GITHUB_ENV + echo "CPATH=${CPATH}:/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include" >> $GITHUB_ENV + fi - # - name: Build and install OSRM - # run: | - # echo "Using ${JOBS} jobs" - # pushd ${OSRM_BUILD_DIR} + - name: Build and install OSRM + run: | + echo "Using ${JOBS} jobs" + pushd ${OSRM_BUILD_DIR} - # python3 -m venv .venv + python3 -m venv .venv - # source .venv/bin/activate + source .venv/bin/activate - # python3 -m pip install conan==2.7.1 + python3 -m pip install conan==2.7.1 - # conan profile detect --force + conan profile detect --force - # ccache --zero-stats - # cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - # -DENABLE_CONAN=${ENABLE_CONAN:-OFF} \ - # -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ - # -DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-OFF} \ - # -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ - # -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ - # -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - # -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ - # -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ - # -DENABLE_CCACHE=ON \ - # -DENABLE_LTO=${ENABLE_LTO:-ON} \ - # -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} + ccache --zero-stats + cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ + -DENABLE_CONAN=${ENABLE_CONAN:-OFF} \ + -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ + -DENABLE_CLANG_TIDY=${ENABLE_CLANG_TIDY:-OFF} \ + -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ + -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ + -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ + -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ + -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ + -DENABLE_CCACHE=ON \ + -DENABLE_LTO=${ENABLE_LTO:-ON} \ + -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} - # make --jobs=${JOBS} + make --jobs=${JOBS} - # if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then - # make tests --jobs=${JOBS} - # make benchmarks --jobs=${JOBS} + if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then + make tests --jobs=${JOBS} + make benchmarks --jobs=${JOBS} - # sudo make install - # if [[ "${RUNNER_OS}" == "Linux" ]]; then - # echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV - # fi - # echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV - # fi - # popd - # - name: Build example - # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_CONAN != 'ON' }} - # run: | - # mkdir example/build && pushd example/build - # cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - # make --jobs=${JOBS} - # popd - # - name: Run all tests - # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} - # run: | - # make -C test/data benchmark + sudo make install + if [[ "${RUNNER_OS}" == "Linux" ]]; then + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV + fi + echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV + fi + popd + - name: Build example + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' && matrix.ENABLE_CONAN != 'ON' }} + run: | + mkdir example/build && pushd example/build + cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + make --jobs=${JOBS} + popd + - name: Run all tests + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} + run: | + make -C test/data benchmark - # # # macOS SIP strips the linker path. Reset this inside the running shell - # # export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }} - # # ./example/build/osrm-example test/data/mld/monaco.osrm + # # macOS SIP strips the linker path. Reset this inside the running shell + # export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }} + # ./example/build/osrm-example test/data/mld/monaco.osrm - # # All tests assume to be run from the build directory - # pushd ${OSRM_BUILD_DIR} - # for i in ./unit_tests/*-tests ; do echo Running $i ; $i ; done - # if [ -z "${ENABLE_SANITIZER}" ]; then - # npm run nodejs-tests - # fi - # popd - # npm test + # All tests assume to be run from the build directory + pushd ${OSRM_BUILD_DIR} + for i in ./unit_tests/*-tests ; do echo Running $i ; $i ; done + if [ -z "${ENABLE_SANITIZER}" ]; then + npm run nodejs-tests + fi + popd + npm test - # - name: Use Node 18 - # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - # uses: actions/setup-node@v4 - # with: - # node-version: 18 - # - name: Run Node package tests on Node 18 - # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - # run: | - # node --version - # npm run nodejs-tests - # - name: Use Node 20 - # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - # uses: actions/setup-node@v4 - # with: - # node-version: 20 - # - name: Run Node package tests on Node 20 - # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - # run: | - # node --version - # npm run nodejs-tests - # - name: Use Node latest - # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - # uses: actions/setup-node@v4 - # with: - # node-version: latest - # - name: Run Node package tests on Node-latest - # if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} - # run: | - # node --version - # npm run nodejs-tests + - name: Use Node 18 + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + uses: actions/setup-node@v4 + with: + node-version: 18 + - name: Run Node package tests on Node 18 + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + run: | + node --version + npm run nodejs-tests + - name: Use Node 20 + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + uses: actions/setup-node@v4 + with: + node-version: 20 + - name: Run Node package tests on Node 20 + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + run: | + node --version + npm run nodejs-tests + - name: Use Node latest + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + uses: actions/setup-node@v4 + with: + node-version: latest + - name: Run Node package tests on Node-latest + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + run: | + node --version + npm run nodejs-tests - # - name: Upload test logs - # uses: actions/upload-artifact@v4 - # if: failure() - # with: - # name: logs - # path: test/logs/ + - name: Upload test logs + uses: actions/upload-artifact@v4 + if: failure() + with: + name: logs + path: test/logs/ - # # - name: Generate code coverage - # # if: ${{ matrix.ENABLE_COVERAGE == 'ON' }} - # # run: | - # # lcov --directory . --capture --output-file coverage.info # capture coverage info - # # lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system - # # lcov --list coverage.info #debug info + # - name: Generate code coverage + # if: ${{ matrix.ENABLE_COVERAGE == 'ON' }} + # run: | + # lcov --directory . --capture --output-file coverage.info # capture coverage info + # lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system + # lcov --list coverage.info #debug info - # # # Uploading report to CodeCov - # # - name: Upload code coverage - # # if: ${{ matrix.ENABLE_COVERAGE == 'ON' }} - # # uses: codecov/codecov-action@v4 - # # with: - # # files: coverage.info - # # name: codecov-osrm-backend - # # fail_ci_if_error: true - # # verbose: true - # - name: Build Node package - # if: ${{ matrix.build_node_package }} - # run: ./scripts/ci/node_package.sh - # - name: Publish Node package - # if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }} - # uses: ncipollo/release-action@v1 - # with: - # allowUpdates: true - # artifactErrorsFailBuild: true - # artifacts: build/stage/**/*.tar.gz - # omitBody: true - # omitBodyDuringUpdate: true - # omitName: true - # omitNameDuringUpdate: true - # replacesArtifacts: true - # token: ${{ secrets.GITHUB_TOKEN }} - # - name: Show CCache statistics - # run: | - # ccache -p - # ccache -s + # # Uploading report to CodeCov + # - name: Upload code coverage + # if: ${{ matrix.ENABLE_COVERAGE == 'ON' }} + # uses: codecov/codecov-action@v4 + # with: + # files: coverage.info + # name: codecov-osrm-backend + # fail_ci_if_error: true + # verbose: true + - name: Build Node package + if: ${{ matrix.build_node_package }} + run: ./scripts/ci/node_package.sh + - name: Publish Node package + if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }} + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifactErrorsFailBuild: true + artifacts: build/stage/**/*.tar.gz + omitBody: true + omitBodyDuringUpdate: true + omitName: true + omitNameDuringUpdate: true + replacesArtifacts: true + token: ${{ secrets.GITHUB_TOKEN }} + - name: Show CCache statistics + run: | + ccache -p + ccache -s # benchmarks: # if: github.event_name == 'pull_request' From fe0d56085efd9482e994a06a60a60b81584f2a23 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 22 Oct 2024 20:20:09 +0200 Subject: [PATCH 56/73] wip --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ec1cd8137..cdd7f70f4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -160,7 +160,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/generated/include/) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/include) -set(BOOST_COMPONENTS system date_time iostreams program_options thread unit_test_framework zlib) +set(BOOST_COMPONENTS system date_time iostreams program_options thread unit_test_framework) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in From ad08b15fbb7a7ded04480dd6804f02b956bf0e4c Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 22 Oct 2024 20:26:39 +0200 Subject: [PATCH 57/73] wip --- .github/workflows/osrm-backend.yml | 304 ++++++++++++++--------------- 1 file changed, 152 insertions(+), 152 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 502bccadf..bd213dfcc 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -173,173 +173,173 @@ jobs: strategy: matrix: include: - - name: gcc-13-debug-cov - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: gcc-13 - CUCUMBER_TIMEOUT: 20000 - CXXCOMPILER: g++-13 - ENABLE_COVERAGE: ON + # - name: gcc-13-debug-cov + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: gcc-13 + # CUCUMBER_TIMEOUT: 20000 + # CXXCOMPILER: g++-13 + # ENABLE_COVERAGE: ON - - name: clang-18-debug-asan-ubsan - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CUCUMBER_TIMEOUT: 20000 - CXXCOMPILER: clang++-18 - ENABLE_SANITIZER: ON - TARGET_ARCH: x86_64-asan-ubsan - OSRM_CONNECTION_RETRIES: 10 - OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 + # - name: clang-18-debug-asan-ubsan + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CUCUMBER_TIMEOUT: 20000 + # CXXCOMPILER: clang++-18 + # ENABLE_SANITIZER: ON + # TARGET_ARCH: x86_64-asan-ubsan + # OSRM_CONNECTION_RETRIES: 10 + # OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 - - name: clang-18-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-18-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-18-debug - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-18-debug + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-18-debug-clang-tidy - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Debug - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - CUCUMBER_TIMEOUT: 60000 - ENABLE_CLANG_TIDY: ON + # - name: clang-18-debug-clang-tidy + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Debug + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_CLANG_TIDY: ON - - name: clang-17-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-17 - CXXCOMPILER: clang++-17 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-17-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-17 + # CXXCOMPILER: clang++-17 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: clang-16-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - CUCUMBER_TIMEOUT: 60000 - ENABLE_LTO: OFF + # - name: clang-16-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_LTO: OFF - - name: conan-linux-debug-asan-ubsan - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - ENABLE_CONAN: ON - ENABLE_SANITIZER: ON - ENABLE_LTO: OFF + # - name: conan-linux-debug-asan-ubsan + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # ENABLE_CONAN: ON + # ENABLE_SANITIZER: ON + # ENABLE_LTO: OFF - - name: conan-linux-release - continue-on-error: false - node: 18 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: clang-18 - CXXCOMPILER: clang++-18 - ENABLE_CONAN: ON - ENABLE_LTO: OFF + # - name: conan-linux-release + # continue-on-error: false + # node: 18 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: clang-18 + # CXXCOMPILER: clang++-18 + # ENABLE_CONAN: ON + # ENABLE_LTO: OFF - - name: gcc-14-release - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-14 - CXXCOMPILER: g++-14 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-14-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-14 + # CXXCOMPILER: g++-14 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: gcc-13-release - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-13 - CXXCOMPILER: g++-13 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-13-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-13 + # CXXCOMPILER: g++-13 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: gcc-12-release - continue-on-error: false - node: 20 - runs-on: ubuntu-22.04 - BUILD_TOOLS: ON - BUILD_TYPE: Release - CCOMPILER: gcc-12 - CXXCOMPILER: g++-12 - CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + # - name: gcc-12-release + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-22.04 + # BUILD_TOOLS: ON + # BUILD_TYPE: Release + # CCOMPILER: gcc-12 + # CXXCOMPILER: g++-12 + # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - - name: conan-linux-release-node - build_node_package: true - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TYPE: Release - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - ENABLE_CONAN: ON - NODE_PACKAGE_TESTS_ONLY: ON + # - name: conan-linux-release-node + # build_node_package: true + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TYPE: Release + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # ENABLE_CONAN: ON + # NODE_PACKAGE_TESTS_ONLY: ON - - name: conan-linux-debug-node - build_node_package: true - continue-on-error: false - node: 20 - runs-on: ubuntu-24.04 - BUILD_TYPE: Debug - CCOMPILER: clang-16 - CXXCOMPILER: clang++-16 - ENABLE_CONAN: ON - NODE_PACKAGE_TESTS_ONLY: ON + # - name: conan-linux-debug-node + # build_node_package: true + # continue-on-error: false + # node: 20 + # runs-on: ubuntu-24.04 + # BUILD_TYPE: Debug + # CCOMPILER: clang-16 + # CXXCOMPILER: clang++-16 + # ENABLE_CONAN: ON + # NODE_PACKAGE_TESTS_ONLY: ON - - name: conan-macos-x64-release-node - build_node_package: true - continue-on-error: true - node: 20 - runs-on: macos-13 # x86_64 - BUILD_TYPE: Release - CCOMPILER: clang - CXXCOMPILER: clang++ - CUCUMBER_TIMEOUT: 60000 - ENABLE_ASSERTIONS: ON - ENABLE_CONAN: ON + # - name: conan-macos-x64-release-node + # build_node_package: true + # continue-on-error: true + # node: 20 + # runs-on: macos-13 # x86_64 + # BUILD_TYPE: Release + # CCOMPILER: clang + # CXXCOMPILER: clang++ + # CUCUMBER_TIMEOUT: 60000 + # ENABLE_ASSERTIONS: ON + # ENABLE_CONAN: ON - name: conan-macos-arm64-release-node build_node_package: true From aea0d88f879d813f39128d5df12cb6e6b28a2837 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Wed, 23 Oct 2024 18:31:43 +0200 Subject: [PATCH 58/73] wip --- .github/workflows/osrm-backend.yml | 128 ++++++++++++++--------------- 1 file changed, 64 insertions(+), 64 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index bd213dfcc..cd1380e1c 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -123,50 +123,50 @@ jobs: npm run docs && ./scripts/error_on_dirty.sh npm audit --production - docker-image-matrix: - strategy: - matrix: - docker-base-image: ["debian", "alpine"] - needs: format-taginfo-docs - runs-on: ubuntu-22.04 - continue-on-error: false - steps: - - name: Check out the repo - uses: actions/checkout@v4 - - name: Enable osm.pbf cache - uses: actions/cache@v4 - with: - path: berlin-latest.osm.pbf - key: v1-berlin-osm-pbf - restore-keys: | - v1-berlin-osm-pbf - - name: Docker build - run: | - docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . - - name: Test Docker image - run: | - if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then - wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf - fi - TAG=osrm-backend-local - # when `--memory-swap` value equals `--memory` it means container won't use swap - # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details - MEMORY_ARGS="--memory=1g --memory-swap=1g" - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson - if [ ! -s "${PWD}/berlin-latest.geojson" ] - then - >&2 echo "No berlin-latest.geojson found" - exit 1 - fi - # removing `.osrm.nbg` to check that whole pipeline works without it - rm -rf "${PWD}/berlin-latest.osrm.nbg" + # docker-image-matrix: + # strategy: + # matrix: + # docker-base-image: ["debian", "alpine"] + # needs: format-taginfo-docs + # runs-on: ubuntu-22.04 + # continue-on-error: false + # steps: + # - name: Check out the repo + # uses: actions/checkout@v4 + # - name: Enable osm.pbf cache + # uses: actions/cache@v4 + # with: + # path: berlin-latest.osm.pbf + # key: v1-berlin-osm-pbf + # restore-keys: | + # v1-berlin-osm-pbf + # - name: Docker build + # run: | + # docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . + # - name: Test Docker image + # run: | + # if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then + # wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf + # fi + # TAG=osrm-backend-local + # # when `--memory-swap` value equals `--memory` it means container won't use swap + # # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details + # MEMORY_ARGS="--memory=1g --memory-swap=1g" + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson + # if [ ! -s "${PWD}/berlin-latest.geojson" ] + # then + # >&2 echo "No berlin-latest.geojson found" + # exit 1 + # fi + # # removing `.osrm.nbg` to check that whole pipeline works without it + # rm -rf "${PWD}/berlin-latest.osrm.nbg" - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm - docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm - docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & - curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" - docker stop osrm-container + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm + # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm + # docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & + # curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" + # docker stop osrm-container build-test-publish: #needs: format-taginfo-docs @@ -318,28 +318,28 @@ jobs: # ENABLE_CONAN: ON # NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-linux-debug-node - # build_node_package: true - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TYPE: Debug - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # ENABLE_CONAN: ON - # NODE_PACKAGE_TESTS_ONLY: ON + - name: conan-linux-debug-node + build_node_package: true + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TYPE: Debug + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + ENABLE_CONAN: ON + NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-macos-x64-release-node - # build_node_package: true - # continue-on-error: true - # node: 20 - # runs-on: macos-13 # x86_64 - # BUILD_TYPE: Release - # CCOMPILER: clang - # CXXCOMPILER: clang++ - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_ASSERTIONS: ON - # ENABLE_CONAN: ON + - name: conan-macos-x64-release-node + build_node_package: true + continue-on-error: true + node: 20 + runs-on: macos-13 # x86_64 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_CONAN: ON - name: conan-macos-arm64-release-node build_node_package: true From 044080d96a3ee707f3a4dee2a8af704503525ad3 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Wed, 23 Oct 2024 19:19:26 +0200 Subject: [PATCH 59/73] wip --- .github/workflows/osrm-backend.yml | 38 +++++++++++++++--------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index cd1380e1c..9572a5cef 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -297,26 +297,26 @@ jobs: # CXXCOMPILER: g++-13 # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: gcc-12-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-22.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-12 - # CXXCOMPILER: g++-12 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-12-release + continue-on-error: false + node: 20 + runs-on: ubuntu-22.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-12 + CXXCOMPILER: g++-12 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: conan-linux-release-node - # build_node_package: true - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TYPE: Release - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # ENABLE_CONAN: ON - # NODE_PACKAGE_TESTS_ONLY: ON + - name: conan-linux-release-node + build_node_package: true + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TYPE: Release + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + ENABLE_CONAN: ON + NODE_PACKAGE_TESTS_ONLY: ON - name: conan-linux-debug-node build_node_package: true From c34043069728a52b4b7352cce1d16842beb0ca5a Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Wed, 23 Oct 2024 21:42:06 +0200 Subject: [PATCH 60/73] wip --- CMakeLists.txt | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cdd7f70f4..a69c95057 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,6 +13,8 @@ option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF) option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF) option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + if (ENABLE_CONAN) message(STATUS "Installing Conan packages. It may take a while...") find_program(CONAN_EXECUTABLE NAMES conan) @@ -393,6 +395,17 @@ else() ${Boost_REGEX_LIBRARY} ) +# set(BOOST_LIBRARIES +# ${Boost_DATE_TIME_LIBRARY} +# ${Boost_IOSTREAMS_LIBRARY} +# ${Boost_THREAD_LIBRARY}) + +# set(BOOST_LIBRARIES +# ${Boost_ZLIB_LIBRARY} +# ${Boost_REGEX_LIBRARY} +# ${BOOST_LIBRARIES}) + + # add a target to generate API documentation with Doxygen find_package(Doxygen) if(DOXYGEN_FOUND) @@ -443,15 +456,6 @@ add_dependency_defines(-DBOOST_PHOENIX_STL_TUPLE_H_) add_definitions(${OSRM_DEFINES}) include_directories(SYSTEM ${DEPENDENCIES_INCLUDE_DIRS}) -# set(BOOST_LIBRARIES -# ${Boost_DATE_TIME_LIBRARY} -# ${Boost_IOSTREAMS_LIBRARY} -# ${Boost_THREAD_LIBRARY}) - -# set(BOOST_LIBRARIES -# ${Boost_ZLIB_LIBRARY} -# ${Boost_REGEX_LIBRARY} -# ${BOOST_LIBRARIES}) # Binaries target_link_libraries(osrm-datastore osrm_store ${Boost_PROGRAM_OPTIONS_LIBRARY}) From bac4f12c77acbe7bf75edf9dddbdf0fd4865811e Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Wed, 23 Oct 2024 21:54:58 +0200 Subject: [PATCH 61/73] wip --- CMakeLists.txt | 54 +++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 31 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a69c95057..eeb5f4021 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -13,7 +13,6 @@ option(ENABLE_FUZZING "Fuzz testing using LLVM's libFuzzer" OFF) option(ENABLE_NODE_BINDINGS "Build NodeJs bindings" OFF) option(ENABLE_CLANG_TIDY "Enables clang-tidy checks" OFF) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) if (ENABLE_CONAN) message(STATUS "Installing Conan packages. It may take a while...") @@ -162,7 +161,7 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/generated/include/) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/sol2/include) -set(BOOST_COMPONENTS system date_time iostreams program_options thread unit_test_framework) +set(BOOST_COMPONENTS date_time iostreams program_options thread unit_test_framework) configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/include/util/version.hpp.in @@ -356,7 +355,9 @@ find_package(Lua 5.2 REQUIRED) if (ENABLE_CONAN) add_dependency_includes(${Boost_INCLUDE_DIRS}) - set(BOOST_LIBRARIES ${Boost_LIBRARIES}) + + set(BOOST_BASE_LIBRARIES ${Boost_LIBRARIES}) + set(BOOST_ENGINE_LIBRARIES ${Boost_LIBRARIES}) add_dependency_includes(${TBB_INCLUDE_DIR}) set(TBB_LIBRARIES ${TBB_LIBRARIES}) @@ -387,24 +388,15 @@ else() set(TBB_LIBRARIES TBB::tbb) - set(BOOST_LIBRARIES - ${Boost_DATE_TIME_LIBRARY} - ${Boost_IOSTREAMS_LIBRARY} - ${Boost_THREAD_LIBRARY} - ${Boost_ZLIB_LIBRARY} - ${Boost_REGEX_LIBRARY} - ) - -# set(BOOST_LIBRARIES -# ${Boost_DATE_TIME_LIBRARY} -# ${Boost_IOSTREAMS_LIBRARY} -# ${Boost_THREAD_LIBRARY}) - -# set(BOOST_LIBRARIES -# ${Boost_ZLIB_LIBRARY} -# ${Boost_REGEX_LIBRARY} -# ${BOOST_LIBRARIES}) + set(BOOST_BASE_LIBRARIES + ${Boost_DATE_TIME_LIBRARY} + ${Boost_IOSTREAMS_LIBRARY} + ${Boost_THREAD_LIBRARY}) + set(BOOST_ENGINE_LIBRARIES + ${Boost_ZLIB_LIBRARY} + ${Boost_REGEX_LIBRARY} + ${BOOST_BASE_LIBRARIES}) # add a target to generate API documentation with Doxygen find_package(Doxygen) @@ -470,7 +462,7 @@ endif() set(EXTRACTOR_LIBRARIES ${BZIP2_LIBRARIES} - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${EXPAT_LIBRARIES} ${LUA_LIBRARIES} @@ -479,35 +471,35 @@ set(EXTRACTOR_LIBRARIES ${ZLIB_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(GUIDANCE_LIBRARIES - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${LUA_LIBRARIES} ${TBB_LIBRARIES} ${ZLIB_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(PARTITIONER_LIBRARIES - ${BOOST_LIBRARIES} + ${BOOST_ENGINE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES} ${ZLIB_LIBRARY}) set(CUSTOMIZER_LIBRARIES - ${BOOST_LIBRARIES} + ${BOOST_ENGINE_LIBRARIES} ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(UPDATER_LIBRARIES - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES} ${ZLIB_LIBRARY}) set(CONTRACTOR_LIBRARIES - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${LUA_LIBRARIES} @@ -515,21 +507,21 @@ set(CONTRACTOR_LIBRARIES ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(ENGINE_LIBRARIES - ${BOOST_LIBRARIES} + ${BOOST_ENGINE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES} ${ZLIB_LIBRARY}) set(STORAGE_LIBRARIES - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(UTIL_LIBRARIES - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_COVERAGE_LIBRARIES} @@ -546,13 +538,13 @@ target_link_libraries(osrm_store ${STORAGE_LIBRARIES}) # BUILD_COMPONENTS add_executable(osrm-components src/tools/components.cpp $ $) -target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_LIBRARIES} ${UTIL_LIBRARIES}) +target_link_libraries(osrm-components ${TBB_LIBRARIES} ${BOOST_BASE_LIBRARIES} ${UTIL_LIBRARIES}) install(TARGETS osrm-components DESTINATION bin) if(BUILD_TOOLS) message(STATUS "Activating OSRM internal tools") add_executable(osrm-io-benchmark src/tools/io-benchmark.cpp $) - target_link_libraries(osrm-io-benchmark ${BOOST_LIBRARIES} ${TBB_LIBRARIES}) + target_link_libraries(osrm-io-benchmark ${BOOST_BASE_LIBRARIES} ${TBB_LIBRARIES}) install(TARGETS osrm-io-benchmark DESTINATION bin) endif() From 99b3e8fc870c8c68663d61333f7d5aff9bad0256 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Wed, 23 Oct 2024 22:04:39 +0200 Subject: [PATCH 62/73] wip --- benchmark.js | 42 +++++++++++++++++++++++++++++++++++ src/benchmarks/CMakeLists.txt | 14 ++++++------ 2 files changed, 49 insertions(+), 7 deletions(-) create mode 100644 benchmark.js diff --git a/benchmark.js b/benchmark.js new file mode 100644 index 000000000..606d7f0bf --- /dev/null +++ b/benchmark.js @@ -0,0 +1,42 @@ +var OSRM = require('.'); +var monaco_mld_path = require('./test/nodejs/constants').mld_data_path; +var two_test_coordinates = require('./test/nodejs/constants').two_test_coordinates; +const { performance } = require('perf_hooks'); + +const osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'}); + +const numberOfRoutes = 10; +let completedRoutes = 0; +let totalTime = 0; + +function benchmarkRoutes() { + const startTime = performance.now(); + + for (let i = 0; i < numberOfRoutes; i++) { + + const options = { + coordinates: [two_test_coordinates[0], two_test_coordinates[1]], + annotations: ['distance'] + }; + + for (let i = 0; i < 1000; ++i) { + options.coordinates.push(two_test_coordinates[i % 2], two_test_coordinates[(i + 1) % 2]); + } + + osrm.table(options, function(err, route) { + if (err) { + console.error(err); + return; + } + completedRoutes++; + if (completedRoutes === numberOfRoutes) { + const endTime = performance.now(); + totalTime = endTime - startTime; + console.log(`Total time for ${numberOfRoutes} routes: ${totalTime}ms`); + console.log(`Average time per route: ${totalTime / numberOfRoutes}ms`); + } + }); + } +} + +benchmarkRoutes(); diff --git a/src/benchmarks/CMakeLists.txt b/src/benchmarks/CMakeLists.txt index 6aec8b6e8..d2478ab4a 100644 --- a/src/benchmarks/CMakeLists.txt +++ b/src/benchmarks/CMakeLists.txt @@ -13,7 +13,7 @@ target_include_directories(rtree-bench ${PROJECT_SOURCE_DIR}/unit_tests) target_link_libraries(rtree-bench - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -26,7 +26,7 @@ add_executable(match-bench target_link_libraries(match-bench osrm - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -39,7 +39,7 @@ add_executable(route-bench target_link_libraries(route-bench osrm - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -51,7 +51,7 @@ add_executable(bench target_link_libraries(bench osrm - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -63,7 +63,7 @@ add_executable(json-render-bench target_link_libraries(json-render-bench osrm - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -74,7 +74,7 @@ add_executable(alias-bench $) target_link_libraries(alias-bench - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) @@ -87,7 +87,7 @@ add_executable(packedvector-bench $) target_link_libraries(packedvector-bench - ${BOOST_LIBRARIES} + ${BOOST_BASE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_SHAPEFILE}) From 67fca9fb8046c75f7a87929ac1e3788b0376f8b0 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Fri, 25 Oct 2024 21:00:44 +0200 Subject: [PATCH 63/73] wip --- CMakeLists.txt | 50 ++++++++++++++++++++++---------------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index eeb5f4021..234b511ad 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,27 @@ cmake_minimum_required(VERSION 3.18) +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +set(CMAKE_CXX_EXTENSIONS OFF) + +if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE) + message(FATAL_ERROR "In-source builds are not allowed. +Please create a directory and run cmake from there, passing the path to this source directory as the last argument. +This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.") +endif() + +# detect if this is included as subproject and if so expose +# some variables to its parent scope +get_directory_property(BUILD_AS_SUBPROJECT PARENT_DIRECTORY) +if(BUILD_AS_SUBPROJECT) + message(STATUS "Building libosrm as subproject.") +endif() + +# set OSRM_BUILD_DIR location (might be used in various scripts) +if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR}) + set(ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR}) +endif() + option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON) option(BUILD_TOOLS "Build OSRM tools" OFF) option(BUILD_PACKAGE "Build OSRM package" OFF) @@ -40,28 +62,6 @@ if (ENABLE_CONAN) endif() endif() -set(CMAKE_CXX_STANDARD 20) -set(CMAKE_CXX_STANDARD_REQUIRED ON) -set(CMAKE_CXX_EXTENSIONS OFF) - -if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR AND NOT MSVC_IDE) - message(FATAL_ERROR "In-source builds are not allowed. -Please create a directory and run cmake from there, passing the path to this source directory as the last argument. -This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.") -endif() - -# detect if this is included as subproject and if so expose -# some variables to its parent scope -get_directory_property(BUILD_AS_SUBPROJECT PARENT_DIRECTORY) -if(BUILD_AS_SUBPROJECT) - message(STATUS "Building libosrm as subproject.") -endif() - -# set OSRM_BUILD_DIR location (might be used in various scripts) -if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR}) - set(ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR}) -endif() - if (ENABLE_CLANG_TIDY) find_program(CLANG_TIDY_COMMAND NAMES clang-tidy) if(NOT CLANG_TIDY_COMMAND) @@ -433,10 +433,6 @@ endif() # to ensure that osrm binaries play well with other binaries like nodejs find_package(ZLIB REQUIRED) add_dependency_includes(${ZLIB_INCLUDE_DIRS}) -message(STATUS "Zlib found: ${ZLIB_FOUND}") -message(STATUS "Zlib include dirs: ${ZLIB_INCLUDE_DIRS}") -message(STATUS "Zlib libraries: ${ZLIB_LIBRARIES}") -message(STATUS "Using zlib include dirs ${ZLIB_INCLUDE_DIRS}") set(ZLIB_LIBRARY ${ZLIB_LIBRARIES}) add_dependency_defines(-DBOOST_SPIRIT_USE_PHOENIX_V3) @@ -500,7 +496,6 @@ set(UPDATER_LIBRARIES ${ZLIB_LIBRARY}) set(CONTRACTOR_LIBRARIES ${BOOST_BASE_LIBRARIES} - ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${LUA_LIBRARIES} ${TBB_LIBRARIES} @@ -515,7 +510,6 @@ set(ENGINE_LIBRARIES ${ZLIB_LIBRARY}) set(STORAGE_LIBRARIES ${BOOST_BASE_LIBRARIES} - ${ZLIB_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} From 1e7e4ff78633eaac11d552d40758164f2cbcf616 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Fri, 25 Oct 2024 21:05:56 +0200 Subject: [PATCH 64/73] wip --- CMakeLists.txt | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 234b511ad..4b36fa4bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -346,14 +346,15 @@ if (MSVC) add_definitions(-DBOOST_ALL_NO_LIB) endif() -set(Boost_USE_STATIC_LIBS ON) -find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) -find_package(TBB REQUIRED) -find_package(EXPAT REQUIRED) -find_package(BZip2 REQUIRED) -find_package(Lua 5.2 REQUIRED) if (ENABLE_CONAN) + set(Boost_USE_STATIC_LIBS ON) + find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) + find_package(TBB REQUIRED) + find_package(EXPAT REQUIRED) + find_package(BZip2 REQUIRED) + find_package(Lua 5.2 REQUIRED) + add_dependency_includes(${Boost_INCLUDE_DIRS}) set(BOOST_BASE_LIBRARIES ${Boost_LIBRARIES}) @@ -380,6 +381,12 @@ if (ENABLE_CONAN) include_directories(SYSTEM ${CMAKE_CURRENT_SOURCE_DIR}/third_party/libosmium/include) else() + find_package(Boost REQUIRED COMPONENTS ${BOOST_COMPONENTS}) + find_package(TBB REQUIRED) + find_package(EXPAT REQUIRED) + find_package(BZip2 REQUIRED) + find_package(Lua 5.2 REQUIRED) + add_dependency_includes(${Boost_INCLUDE_DIRS}) add_dependency_includes(${TBB_INCLUDE_DIR}) add_dependency_includes(${EXPAT_INCLUDE_DIRS}) @@ -452,7 +459,6 @@ target_link_libraries(osrm-partition osrm_partition ${Boost_PROGRAM_OPTIONS_LIBR target_link_libraries(osrm-customize osrm_customize ${Boost_PROGRAM_OPTIONS_LIBRARY}) target_link_libraries(osrm-contract osrm_contract ${Boost_PROGRAM_OPTIONS_LIBRARY}) if (BUILD_ROUTED) - message(STATUS "Building osrm-routed ${ZLIB_LIBRARY}") target_link_libraries(osrm-routed osrm ${Boost_PROGRAM_OPTIONS_LIBRARY} ${OPTIONAL_SOCKET_LIBS} ${ZLIB_LIBRARY}) endif() @@ -471,15 +477,13 @@ set(GUIDANCE_LIBRARIES ${CMAKE_THREAD_LIBS_INIT} ${LUA_LIBRARIES} ${TBB_LIBRARIES} - ${ZLIB_LIBRARY} ${MAYBE_COVERAGE_LIBRARIES}) set(PARTITIONER_LIBRARIES ${BOOST_ENGINE_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} ${TBB_LIBRARIES} ${MAYBE_RT_LIBRARY} - ${MAYBE_COVERAGE_LIBRARIES} - ${ZLIB_LIBRARY}) + ${MAYBE_COVERAGE_LIBRARIES}) set(CUSTOMIZER_LIBRARIES ${BOOST_ENGINE_LIBRARIES} ${ZLIB_LIBRARY} From 182ad13a60a89011b81c62254b1254a58d8b2015 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sat, 26 Oct 2024 18:43:46 +0200 Subject: [PATCH 65/73] wip --- .github/workflows/osrm-backend.yml | 224 ++++++++++++++--------------- 1 file changed, 112 insertions(+), 112 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 9572a5cef..c7858ec3e 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -173,129 +173,129 @@ jobs: strategy: matrix: include: - # - name: gcc-13-debug-cov - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: gcc-13 - # CUCUMBER_TIMEOUT: 20000 - # CXXCOMPILER: g++-13 - # ENABLE_COVERAGE: ON + - name: gcc-13-debug-cov + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: gcc-13 + CUCUMBER_TIMEOUT: 20000 + CXXCOMPILER: g++-13 + ENABLE_COVERAGE: ON - # - name: clang-18-debug-asan-ubsan - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CUCUMBER_TIMEOUT: 20000 - # CXXCOMPILER: clang++-18 - # ENABLE_SANITIZER: ON - # TARGET_ARCH: x86_64-asan-ubsan - # OSRM_CONNECTION_RETRIES: 10 - # OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 + - name: clang-18-debug-asan-ubsan + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CUCUMBER_TIMEOUT: 20000 + CXXCOMPILER: clang++-18 + ENABLE_SANITIZER: ON + TARGET_ARCH: x86_64-asan-ubsan + OSRM_CONNECTION_RETRIES: 10 + OSRM_CONNECTION_EXP_BACKOFF_COEF: 1.5 - # - name: clang-18-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-18-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-18-debug - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-18-debug + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-18-debug-clang-tidy - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Debug - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_CLANG_TIDY: ON + - name: clang-18-debug-clang-tidy + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + CUCUMBER_TIMEOUT: 60000 + ENABLE_CLANG_TIDY: ON - # - name: clang-17-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-17 - # CXXCOMPILER: clang++-17 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-17-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-17 + CXXCOMPILER: clang++-17 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: clang-16-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # CUCUMBER_TIMEOUT: 60000 - # ENABLE_LTO: OFF + - name: clang-16-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + CUCUMBER_TIMEOUT: 60000 + ENABLE_LTO: OFF - # - name: conan-linux-debug-asan-ubsan - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # ENABLE_CONAN: ON - # ENABLE_SANITIZER: ON - # ENABLE_LTO: OFF + - name: conan-linux-debug-asan-ubsan + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + ENABLE_CONAN: ON + ENABLE_SANITIZER: ON + ENABLE_LTO: OFF - # - name: conan-linux-release - # continue-on-error: false - # node: 18 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: clang-18 - # CXXCOMPILER: clang++-18 - # ENABLE_CONAN: ON - # ENABLE_LTO: OFF + - name: conan-linux-release + continue-on-error: false + node: 18 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang-18 + CXXCOMPILER: clang++-18 + ENABLE_CONAN: ON + ENABLE_LTO: OFF - # - name: gcc-14-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-14 - # CXXCOMPILER: g++-14 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-14-release + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-14 + CXXCOMPILER: g++-14 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - # - name: gcc-13-release - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TOOLS: ON - # BUILD_TYPE: Release - # CCOMPILER: gcc-13 - # CXXCOMPILER: g++-13 - # CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' + - name: gcc-13-release + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-13 + CXXCOMPILER: g++-13 + CXXFLAGS: '-Wno-array-bounds -Wno-uninitialized' - name: gcc-12-release continue-on-error: false From 7c1f0bf62f72ca4f45fccdace6f7d9d0e44cfb82 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 27 Oct 2024 15:10:00 +0100 Subject: [PATCH 66/73] wip --- .github/workflows/osrm-backend.yml | 86 +++++++++++++++--------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index c7858ec3e..502bccadf 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -123,50 +123,50 @@ jobs: npm run docs && ./scripts/error_on_dirty.sh npm audit --production - # docker-image-matrix: - # strategy: - # matrix: - # docker-base-image: ["debian", "alpine"] - # needs: format-taginfo-docs - # runs-on: ubuntu-22.04 - # continue-on-error: false - # steps: - # - name: Check out the repo - # uses: actions/checkout@v4 - # - name: Enable osm.pbf cache - # uses: actions/cache@v4 - # with: - # path: berlin-latest.osm.pbf - # key: v1-berlin-osm-pbf - # restore-keys: | - # v1-berlin-osm-pbf - # - name: Docker build - # run: | - # docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . - # - name: Test Docker image - # run: | - # if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then - # wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf - # fi - # TAG=osrm-backend-local - # # when `--memory-swap` value equals `--memory` it means container won't use swap - # # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details - # MEMORY_ARGS="--memory=1g --memory-swap=1g" - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson - # if [ ! -s "${PWD}/berlin-latest.geojson" ] - # then - # >&2 echo "No berlin-latest.geojson found" - # exit 1 - # fi - # # removing `.osrm.nbg` to check that whole pipeline works without it - # rm -rf "${PWD}/berlin-latest.osrm.nbg" + docker-image-matrix: + strategy: + matrix: + docker-base-image: ["debian", "alpine"] + needs: format-taginfo-docs + runs-on: ubuntu-22.04 + continue-on-error: false + steps: + - name: Check out the repo + uses: actions/checkout@v4 + - name: Enable osm.pbf cache + uses: actions/cache@v4 + with: + path: berlin-latest.osm.pbf + key: v1-berlin-osm-pbf + restore-keys: | + v1-berlin-osm-pbf + - name: Docker build + run: | + docker build -t osrm-backend-local -f docker/Dockerfile-${{ matrix.docker-base-image }} . + - name: Test Docker image + run: | + if [ ! -f "${PWD}/berlin-latest.osm.pbf" ]; then + wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf + fi + TAG=osrm-backend-local + # when `--memory-swap` value equals `--memory` it means container won't use swap + # see https://docs.docker.com/config/containers/resource_constraints/#--memory-swap-details + MEMORY_ARGS="--memory=1g --memory-swap=1g" + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-extract --dump-nbg-graph -p /opt/car.lua /data/berlin-latest.osm.pbf + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-components /data/berlin-latest.osrm.nbg /data/berlin-latest.geojson + if [ ! -s "${PWD}/berlin-latest.geojson" ] + then + >&2 echo "No berlin-latest.geojson found" + exit 1 + fi + # removing `.osrm.nbg` to check that whole pipeline works without it + rm -rf "${PWD}/berlin-latest.osrm.nbg" - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm - # docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm - # docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & - # curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" - # docker stop osrm-container + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-partition /data/berlin-latest.osrm + docker run $MEMORY_ARGS -t -v "${PWD}:/data" "${TAG}" osrm-customize /data/berlin-latest.osrm + docker run $MEMORY_ARGS --name=osrm-container -t -p 5000:5000 -v "${PWD}:/data" "${TAG}" osrm-routed --algorithm mld /data/berlin-latest.osrm & + curl --retry-delay 3 --retry 10 --retry-all-errors "http://127.0.0.1:5000/route/v1/driving/13.388860,52.517037;13.385983,52.496891?steps=true" + docker stop osrm-container build-test-publish: #needs: format-taginfo-docs From 12163b0be934a6793091b1c9c06dda7bf1a5475b Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 29 Oct 2024 18:06:43 +0100 Subject: [PATCH 67/73] wip --- .github/workflows/osrm-backend.yml | 251 ++++++++++++++--------------- CMakeLists.txt | 6 +- benchmark.js | 42 ----- unit_tests/CMakeLists.txt | 2 +- 4 files changed, 127 insertions(+), 174 deletions(-) delete mode 100644 benchmark.js diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 502bccadf..9c1f78dd3 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -24,7 +24,7 @@ concurrency: jobs: windows-release-node: - #needs: format-taginfo-docs + needs: format-taginfo-docs runs-on: windows-2022 continue-on-error: false env: @@ -51,11 +51,8 @@ jobs: cd build python3 -m venv .venv - source .venv/Scripts/Activate - python3 -m pip install conan==2.7.1 - conan profile detect --force cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON .. @@ -657,130 +654,130 @@ jobs: ccache -p ccache -s - # benchmarks: - # if: github.event_name == 'pull_request' - # needs: [format-taginfo-docs] - # runs-on: self-hosted - # env: - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # CC: clang-16 - # CXX: clang++-16 - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # PR_NUMBER: ${{ github.event.pull_request.number }} - # GITHUB_REPOSITORY: ${{ github.repository }} - # RUN_BIG_BENCHMARK: ${{ contains(github.event.pull_request.labels.*.name, 'Performance') }} - # steps: - # - name: Checkout PR Branch - # uses: actions/checkout@v4 - # with: - # ref: ${{ github.head_ref }} - # path: pr - # - name: Activate virtualenv - # run: | - # python3 -m venv .venv - # source .venv/bin/activate - # echo PATH=$PATH >> $GITHUB_ENV - # pip install "conan==2.7.1" "requests==2.31.0" "numpy==1.26.4" - # - name: Prepare data - # run: | - # if [ "$RUN_BIG_BENCHMARK" = "true" ]; then - # rm -rf ~/data.osm.pbf - # wget http://download.geofabrik.de/europe/poland-latest.osm.pbf -O ~/data.osm.pbf --quiet - # gunzip -c ./pr/test/data/poland_gps_traces.csv.gz > ~/gps_traces.csv - # else - # if [ ! -f "~/data.osm.pbf" ]; then - # wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf -O ~/data.osm.pbf - # else - # echo "Using cached data.osm.pbf" - # fi - # gunzip -c ./pr/test/data/berlin_gps_traces.csv.gz > ~/gps_traces.csv - # fi - # - name: Prepare environment - # run: | - # echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV - # mkdir -p $HOME/.ccache - # ccache --zero-stats - # ccache --max-size=256M - # - name: Checkout Base Branch - # uses: actions/checkout@v4 - # with: - # ref: ${{ github.event.pull_request.base.ref }} - # path: base - # - name: Build Base Branch - # run: | - # cd base - # npm ci --ignore-scripts - # cd .. - # mkdir base/build - # cd base/build - # cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON .. - # make -j$(nproc) - # make -j$(nproc) benchmarks - # cd .. - # make -C test/data - # - name: Build PR Branch - # run: | - # cd pr - # npm ci --ignore-scripts - # cd .. - # mkdir -p pr/build - # cd pr/build - # cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON .. - # make -j$(nproc) - # make -j$(nproc) benchmarks - # cd .. - # make -C test/data - # # we run benchmarks in tmpfs to avoid impact of disk IO - # - name: Create folder for tmpfs - # run: | - # # if by any chance it was mounted before(e.g. due to previous job failed), unmount it - # sudo umount ~/benchmarks | true - # rm -rf ~/benchmarks - # mkdir -p ~/benchmarks - # # see https://llvm.org/docs/Benchmarking.html - # - name: Run PR Benchmarks - # run: | - # sudo cset shield -c 2-3 -k on - # sudo mount -t tmpfs -o size=4g none ~/benchmarks - # cp -rf pr/build ~/benchmarks/build - # cp -rf pr/lib ~/benchmarks/lib - # mkdir -p ~/benchmarks/test - # cp -rf pr/test/data ~/benchmarks/test/data - # cp -rf pr/profiles ~/benchmarks/profiles + benchmarks: + if: github.event_name == 'pull_request' + needs: [format-taginfo-docs] + runs-on: self-hosted + env: + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + CC: clang-16 + CXX: clang++-16 + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + GITHUB_REPOSITORY: ${{ github.repository }} + RUN_BIG_BENCHMARK: ${{ contains(github.event.pull_request.labels.*.name, 'Performance') }} + steps: + - name: Checkout PR Branch + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + path: pr + - name: Activate virtualenv + run: | + python3 -m venv .venv + source .venv/bin/activate + echo PATH=$PATH >> $GITHUB_ENV + pip install "conan==2.7.1" "requests==2.31.0" "numpy==1.26.4" + - name: Prepare data + run: | + if [ "$RUN_BIG_BENCHMARK" = "true" ]; then + rm -rf ~/data.osm.pbf + wget http://download.geofabrik.de/europe/poland-latest.osm.pbf -O ~/data.osm.pbf --quiet + gunzip -c ./pr/test/data/poland_gps_traces.csv.gz > ~/gps_traces.csv + else + if [ ! -f "~/data.osm.pbf" ]; then + wget http://download.geofabrik.de/europe/germany/berlin-latest.osm.pbf -O ~/data.osm.pbf + else + echo "Using cached data.osm.pbf" + fi + gunzip -c ./pr/test/data/berlin_gps_traces.csv.gz > ~/gps_traces.csv + fi + - name: Prepare environment + run: | + echo "CCACHE_DIR=$HOME/.ccache" >> $GITHUB_ENV + mkdir -p $HOME/.ccache + ccache --zero-stats + ccache --max-size=256M + - name: Checkout Base Branch + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.base.ref }} + path: base + - name: Build Base Branch + run: | + cd base + npm ci --ignore-scripts + cd .. + mkdir base/build + cd base/build + cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON .. + make -j$(nproc) + make -j$(nproc) benchmarks + cd .. + make -C test/data + - name: Build PR Branch + run: | + cd pr + npm ci --ignore-scripts + cd .. + mkdir -p pr/build + cd pr/build + cmake -DENABLE_CONAN=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_NODE_BINDINGS=ON .. + make -j$(nproc) + make -j$(nproc) benchmarks + cd .. + make -C test/data + # we run benchmarks in tmpfs to avoid impact of disk IO + - name: Create folder for tmpfs + run: | + # if by any chance it was mounted before(e.g. due to previous job failed), unmount it + sudo umount ~/benchmarks | true + rm -rf ~/benchmarks + mkdir -p ~/benchmarks + # see https://llvm.org/docs/Benchmarking.html + - name: Run PR Benchmarks + run: | + sudo cset shield -c 2-3 -k on + sudo mount -t tmpfs -o size=4g none ~/benchmarks + cp -rf pr/build ~/benchmarks/build + cp -rf pr/lib ~/benchmarks/lib + mkdir -p ~/benchmarks/test + cp -rf pr/test/data ~/benchmarks/test/data + cp -rf pr/profiles ~/benchmarks/profiles - # sudo cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/pr_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv - # sudo umount ~/benchmarks - # sudo cset shield --reset - # - name: Run Base Benchmarks - # run: | - # sudo cset shield -c 2-3 -k on - # sudo mount -t tmpfs -o size=4g none ~/benchmarks - # cp -rf base/build ~/benchmarks/build - # cp -rf base/lib ~/benchmarks/lib - # mkdir -p ~/benchmarks/test - # cp -rf base/test/data ~/benchmarks/test/data - # cp -rf base/profiles ~/benchmarks/profiles + sudo cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/pr_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv + sudo umount ~/benchmarks + sudo cset shield --reset + - name: Run Base Benchmarks + run: | + sudo cset shield -c 2-3 -k on + sudo mount -t tmpfs -o size=4g none ~/benchmarks + cp -rf base/build ~/benchmarks/build + cp -rf base/lib ~/benchmarks/lib + mkdir -p ~/benchmarks/test + cp -rf base/test/data ~/benchmarks/test/data + cp -rf base/profiles ~/benchmarks/profiles - # # TODO: remove it when base branch will have this file at needed location - # if [ ! -f ~/benchmarks/test/data/portugal_to_korea.json ]; then - # cp base/src/benchmarks/portugal_to_korea.json ~/benchmarks/test/data/portugal_to_korea.json - # fi - # # we intentionally use scripts from PR branch to be able to update them and see results in the same PR - # sudo cset shield --exec -- cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/base_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv - # sudo umount ~/benchmarks - # sudo cset shield --reset - # - name: Post Benchmark Results - # run: | - # python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results - # - name: Show CCache statistics - # run: | - # ccache -p - # ccache -s + # TODO: remove it when base branch will have this file at needed location + if [ ! -f ~/benchmarks/test/data/portugal_to_korea.json ]; then + cp base/src/benchmarks/portugal_to_korea.json ~/benchmarks/test/data/portugal_to_korea.json + fi + # we intentionally use scripts from PR branch to be able to update them and see results in the same PR + sudo cset shield --exec -- cset shield --exec -- ./pr/scripts/ci/run_benchmarks.sh -f ~/benchmarks -r $(pwd)/base_results -s $(pwd)/pr -b ~/benchmarks/build -o ~/data.osm.pbf -g ~/gps_traces.csv + sudo umount ~/benchmarks + sudo cset shield --reset + - name: Post Benchmark Results + run: | + python3 pr/scripts/ci/post_benchmark_results.py base_results pr_results + - name: Show CCache statistics + run: | + ccache -p + ccache -s - # ci-complete: - # runs-on: ubuntu-22.04 - # needs: [build-test-publish, docker-image-matrix, windows-release-node, benchmarks] - # steps: - # - run: echo "CI complete" + ci-complete: + runs-on: ubuntu-22.04 + needs: [build-test-publish, docker-image-matrix, windows-release-node, benchmarks] + steps: + - run: echo "CI complete" diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b36fa4bd..816867080 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,6 +22,7 @@ if (NOT WIN32 AND NOT DEFINED ENV{OSRM_BUILD_DIR}) set(ENV{OSRM_BUILD_DIR} ${CMAKE_CURRENT_BINARY_DIR}) endif() +option(ENABLE_CONAN "Use conan for dependencies" OFF) option(ENABLE_CCACHE "Speed up incremental rebuilds via ccache" ON) option(BUILD_TOOLS "Build OSRM tools" OFF) option(BUILD_PACKAGE "Build OSRM package" OFF) @@ -45,7 +46,6 @@ if (ENABLE_CONAN) else() set(CMAKE_TOOLCHAIN_FILE "./conan_toolchain.cmake") - # message(STATUS "Conan install stdout: ${CONAN_EXECUTABLE} install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=${CMAKE_BUILD_TYPE}") execute_process( COMMAND ${CONAN_EXECUTABLE} install .. --output-folder=. --build=missing --settings compiler.cppstd=20 --settings build_type=${CMAKE_BUILD_TYPE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} @@ -53,11 +53,9 @@ if (ENABLE_CONAN) ERROR_VARIABLE conan_stderr RESULT_VARIABLE conan_install_result ) - message(STATUS "Conan install stdout: ${conan_stdout} ${CMAKE_BUILD_TYPE}") - message(STATUS "Conan install stderr: ${conan_stderr}") if (NOT conan_install_result EQUAL 0) - message(FATAL_ERROR "Conan install failed.") + message(FATAL_ERROR "Conan install failed: ${conan_install_result}. Stderr: ${conan_stderr}. Stdout: ${conan_stdout}") endif() endif() endif() diff --git a/benchmark.js b/benchmark.js deleted file mode 100644 index 606d7f0bf..000000000 --- a/benchmark.js +++ /dev/null @@ -1,42 +0,0 @@ -var OSRM = require('.'); -var monaco_mld_path = require('./test/nodejs/constants').mld_data_path; -var two_test_coordinates = require('./test/nodejs/constants').two_test_coordinates; -const { performance } = require('perf_hooks'); - -const osrm = new OSRM({path: monaco_mld_path, algorithm: 'MLD'}); - -const numberOfRoutes = 10; -let completedRoutes = 0; -let totalTime = 0; - -function benchmarkRoutes() { - const startTime = performance.now(); - - for (let i = 0; i < numberOfRoutes; i++) { - - const options = { - coordinates: [two_test_coordinates[0], two_test_coordinates[1]], - annotations: ['distance'] - }; - - for (let i = 0; i < 1000; ++i) { - options.coordinates.push(two_test_coordinates[i % 2], two_test_coordinates[(i + 1) % 2]); - } - - osrm.table(options, function(err, route) { - if (err) { - console.error(err); - return; - } - completedRoutes++; - if (completedRoutes === numberOfRoutes) { - const endTime = performance.now(); - totalTime = endTime - startTime; - console.log(`Total time for ${numberOfRoutes} routes: ${totalTime}ms`); - console.log(`Average time per route: ${totalTime / numberOfRoutes}ms`); - } - }); - } -} - -benchmarkRoutes(); diff --git a/unit_tests/CMakeLists.txt b/unit_tests/CMakeLists.txt index b9cd5f922..c0794b4e0 100644 --- a/unit_tests/CMakeLists.txt +++ b/unit_tests/CMakeLists.txt @@ -126,7 +126,7 @@ add_executable(util-tests ${UtilTestsSources} $ $) -if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS AND NOT ENABLE_CONAN) +if(NOT WIN32 AND NOT Boost_USE_STATIC_LIBS) add_definitions(-DBOOST_TEST_DYN_LINK) endif() From 0c9b23f4ff1d7f81db8fcd7ef00e551137116dcd Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 29 Oct 2024 18:41:42 +0100 Subject: [PATCH 68/73] wip From f48bfdf1594651f1fbcdca7f4fac4cc70dc3378b Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 29 Oct 2024 20:41:07 +0100 Subject: [PATCH 69/73] wip --- .github/workflows/osrm-backend.yml | 23 ++++++++++++----------- CMakeLists.txt | 18 +++++------------- 2 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index 9c1f78dd3..5777d50f9 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -166,7 +166,7 @@ jobs: docker stop osrm-container build-test-publish: - #needs: format-taginfo-docs + needs: format-taginfo-docs strategy: matrix: include: @@ -519,13 +519,12 @@ jobs: echo "Using ${JOBS} jobs" pushd ${OSRM_BUILD_DIR} - python3 -m venv .venv - - source .venv/bin/activate - - python3 -m pip install conan==2.7.1 - - conan profile detect --force + if [[ "${ENABLE_CONAN}" == "ON" ]]; then + python3 -m venv .venv + source .venv/bin/activate + python3 -m pip install conan==2.7.1 + conan profile detect --force + fi ccache --zero-stats cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ @@ -566,9 +565,11 @@ jobs: run: | make -C test/data benchmark - # # macOS SIP strips the linker path. Reset this inside the running shell - # export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }} - # ./example/build/osrm-example test/data/mld/monaco.osrm + # macOS SIP strips the linker path. Reset this inside the running shell + if [[ "${ENABLE_CONAN}" == "OFF" ]]; then + export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }} + ./example/build/osrm-example test/data/mld/monaco.osrm + fi # All tests assume to be run from the build directory pushd ${OSRM_BUILD_DIR} diff --git a/CMakeLists.txt b/CMakeLists.txt index 816867080..6ac627c44 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -652,19 +652,11 @@ list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}") list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}/osrm") JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS) -# # Boost uses imported targets, we need to use a generator expression to extract -# # the link libraries to be written to the pkg-config file. -# # Conan & TBB define dependencies as CMake targets too, that's why we do the same for them. -if (NOT ENABLE_CONAN) - foreach(engine_lib ${ENGINE_LIBRARIES}) - message(STATUS "Adding ${engine_lib} to pkg-config dependencies") - if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^CONAN_LIB.*" OR "${engine_lib}" MATCHES "^TBB.*") - list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") - else() - list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") - endif() - endforeach(engine_lib) -endif() + +foreach(engine_lib ${ENGINE_LIBRARIES}) + list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") +endforeach(engine_lib) + JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/cmake/pkgconfig.in pkgconfig.configured @ONLY) From 7848f9950ae10f265cc93feb26d1fa85a6d999e4 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 29 Oct 2024 20:42:35 +0100 Subject: [PATCH 70/73] wip --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 954dcc627..4a299c768 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - NodeJS: - CHANGED: Use node-api instead of NAN. [#6452](https://github.com/Project-OSRM/osrm-backend/pull/6452) - Misc: + - CHANGED: Migrate to Conan 2.x. [#7042](https://github.com/Project-OSRM/osrm-backend/pull/7042) - CHANGED: Use thread_local instead of boost::thread_specific_ptr. [#6991](https://github.com/Project-OSRM/osrm-backend/pull/6991) - CHANGED: Bump flatbuffers to v24.3.25 version. [#6988](https://github.com/Project-OSRM/osrm-backend/pull/6988) - CHANGED: Add .reserve(...) to assembleGeometry function. [#6983](https://github.com/Project-OSRM/osrm-backend/pull/6983) From 8cb8e642ba28dbef1dd6a6990706825aa0aa8e5f Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 29 Oct 2024 20:48:34 +0100 Subject: [PATCH 71/73] wip --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6ac627c44..4fea8751b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -654,7 +654,11 @@ JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS) foreach(engine_lib ${ENGINE_LIBRARIES}) + if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^TBB.*") + list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") + else() list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") + endif() endforeach(engine_lib) JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) From 3be0c1195841e8189b3765f2c9b770d1edc63271 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Tue, 29 Oct 2024 20:52:49 +0100 Subject: [PATCH 72/73] wip --- CMakeLists.txt | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4fea8751b..13ea09ebf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -653,13 +653,15 @@ list(APPEND DEPENDENCIES_INCLUDE_DIRS "${PKGCONFIG_INCLUDE_DIR}/osrm") JOIN("-I${DEPENDENCIES_INCLUDE_DIRS}" " -I" PKGCONFIG_OSRM_INCLUDE_FLAGS) -foreach(engine_lib ${ENGINE_LIBRARIES}) - if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^TBB.*") - list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") - else() - list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") - endif() -endforeach(engine_lib) +if (NOT ENABLE_CONAN) + foreach(engine_lib ${ENGINE_LIBRARIES}) + if("${engine_lib}" MATCHES "^boost.*" OR "${engine_lib}" MATCHES "^TBB.*") + list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "$") + else() + list(APPEND PKGCONFIG_DEPENDENT_LIBRARIES "${engine_lib}") + endif() + endforeach(engine_lib) +endif() JOIN("${PKGCONFIG_DEPENDENT_LIBRARIES}" " " PKGCONFIG_OSRM_DEPENDENT_LIBRARIES) From 46f0aa405138518a18a566f92441f43fc47559e0 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Fri, 1 Nov 2024 16:12:30 +0100 Subject: [PATCH 73/73] wip