Skip to content

Commit 018b804

Browse files
authored
Adding OpenGV as submodule (optional) and use Github actions for windows CI (#1656)
* Adding OpenGV as submodule (optional) * Remove submodule to migrate to FetchContent * using FetchContent * remove empty .gitmodules * Fixing OpenGV not able to find eigen on windows * patching opengv to adjust -march=native based on PCL * fixing patching on windows * eigen fix * PR cancel on-going CI builds if new commit is added to PR * try another approach * updating patch with some logs * more debug mesage * fixing EIGEN_INCLUDE_DIR * enable rolling_builds on appveyor * removed rolling_builds appveyor * fixing eigen cache * test * more debug logs * another try * cleanup * updated appveyor to work with fetchcontent * removed mkdir build (appveyor) * appveyor: trying ninja to increase CI speed * removed mkdr * appveyor: spitting opengv and rtabmap builds to be under 60 min per job * appveyor: caching dependencies * using global configuration * using baked image * fixing wget in ps * fixing not support for * pip error * reverted pip install * fixed realsense cache * fixing multi step build * removing baked image * typo * Windows: Converted appveyor to github actions * updated boost version * fixing boost * udpated boost config * boost... * platform_version * install boost directly * silent boost install * very silent boost * fixing ls * added boost install dir * showing boost install dir * moved windows dependencies in external action file * explicitly save boost cache to same time on iterations * pip install gdown * update * caching more deps * caching all depts * removed explicit boost cache save * mscv 14.0 * forcing building visual studio 14 2015 * installing v12 in 2022 instead * setup cmd prompt * init right toolset * fixing system version for opengv compilation error * fixing package and artifact * CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION * removing cmd * find manually psapi.lib * resolve * refactor psapi env * forcing 10.0.19041.0 * using windows=2022 runner instead * added vcpkg * commenting windows-latest for now * trying vcpkg instead * search path * updated path * moved json * removed deleted file for git * adding a real version * using version-string * cleanup vcpkg * building artifacts with vcpkg * removed old windows build approach, added custom dependencies (gtsam, libpointmatcher) to vcpkg build * udpated vcpkg version for issue microsoft/vcpkg#49103 * try with minimal dep first * disable opengv for now * try vcpkg single compilation * space * updated link * fixed qupote * fixing cache name * adding debug folder * adjust path * adjust path * providing vcpkg binaries instead * ident * added triplet * added BOOST_ROOT * boost root * boost root * fixed path * adding eigen headers * try path * cmake prefix path * boost timer def * libnabo fixes * pointmatcher prefix * disabling pointmathcer tests * updated cmake parameters * changed how file is downloaded * trying curl instead * puttoing backe InvokeWeb because it is a dropbox issue * skipping optional deps for now * ficing env variable * triplet * installing triplets * not overriding default vcpkg env variables * missing path * manifet install off * that was working locally * missing protobuf path * fixing tiff not found * fixing vtk not found * more vtk fixes * another thy * changing download url * updated url * try * shoudl work now * protobuf exe * readding tiff * explicit vcpkg installed folder * missing commands * try without tiff * ficing vtk comple path * -DPSAPI_LIBRARIES=Psapi.lib * quoting * fixing psapi required * Set up MSVC Developer Command Prompt * disabling pckaging for now * openni.ini * renabling packing * Added stripped deps * fix name * updated binaries * format * updated opengv eigen path * added tbb dep * updatd archive name with vs version * updated archive in action * fixing patch error * corrupted * updated gtsam version / vcpkg * removed appveyor. Set internal opengv build disabled by defaut (because build can be very long on some machines), will enable it inside the ros release branches instead. * updated opengv patch * gtsam mkl dep * updated vcpkg binaries * updated patches * removed mkl dep * missing eigen in gtsam dep * disabling gtsam till we find a compatible version locally * all working locally! * removed ninja * working python calls * fixed hard symlink for python3.dll * fixed qt missing png, fixed opengv not finding eigen with config, fixed python3.dll missing * fixed flaoting dockwidget on start, removed cmd line window when launching bundled app * use sub-packages cudnn * Added cuda dev workflow * fixed archive name * Updated deps with pytorch cuda * updating ci PATH * fixing ci build without torch * rename cuda artifacts * cache cuda, add job to test internal opengv build * Updated output artifacts zip name * windows package: only zip on pull request * Change USE_INTERNAL_OPENGV to BUILD_OPENGV * use use-github-cache * updated artifacts path
1 parent 8051be4 commit 018b804

29 files changed

+2693
-757
lines changed

.appveyor.yml

Lines changed: 0 additions & 152 deletions
This file was deleted.
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: 'Install Windows Dependencies with CUDA'
2+
description: 'Installs PCL, Qt, VTK, g2o and others'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Set up MSVC Developer Command Prompt
7+
uses: ilammy/msvc-dev-cmd@v1
8+
with:
9+
arch: x64
10+
11+
- name: Install CUDA
12+
uses: Jimver/cuda-toolkit@v0.2.30
13+
id: cuda-toolkit
14+
with:
15+
cuda: '13.0.0'
16+
use-github-cache: True
17+
18+
- name: Verify CUDA
19+
shell: bash
20+
run: |
21+
nvcc --version
22+
echo "CUDA Path: $CUDA_PATH"
23+
24+
- name: Cache vcpkg
25+
id: cache-vcpkg
26+
uses: actions/cache@v4
27+
with:
28+
path: ${{ runner.workspace }}/vcpkg_installed
29+
key: ${{ runner.os }}-vcpkg-export-66c0373d-x64-vs2022-cuda130_v1
30+
31+
- name: Download and Install vcpkg
32+
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
33+
shell: pwsh
34+
run: |
35+
$install_dir = "${{ runner.workspace }}\vcpkg_installed"
36+
$archivePath = "${{ runner.workspace }}\vcpkg-export.7z"
37+
38+
# The file has been built locally with bundle-windows-deps.bat
39+
$url = "https://github.com/introlab/rtabmap/releases/download/0.23.1/vcpkg-export-66c0373d-x64-vs2022-cuda130.7z"
40+
41+
Invoke-WebRequest -Uri $url -OutFile $archivePath
42+
& 7z x $archivePath "-o$install_dir" -y
43+
44+
- name: Add vcpkg to PATH and env variable
45+
shell: pwsh
46+
run: |
47+
$vcpkg_path = "${{ runner.workspace }}\vcpkg_installed"
48+
echo "VCPKG_EXPORT_PATH=$vcpkg_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
49+
echo "$vcpkg_path\installed\x64-windows-release\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
50+
echo "${{env.CUDA_PATH}}\bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
51+
echo "${{env.CUDA_PATH}}\extras\CUPTI\lib64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
52+
echo "$vcpkg_path\installed\x64-windows-release\tools\python3\Lib\site-packages\torch\lib" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
53+
echo "$vcpkg_path\installed\x64-windows-release\tools\python3\Lib\site-packages\numpy.libs" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: 'Install Windows Dependencies'
2+
description: 'Installs PCL, Qt, VTK, g2o and others'
3+
runs:
4+
using: "composite"
5+
steps:
6+
- name: Set up MSVC Developer Command Prompt
7+
uses: ilammy/msvc-dev-cmd@v1
8+
with:
9+
arch: x64
10+
11+
- name: Cache vcpkg
12+
id: cache-vcpkg
13+
uses: actions/cache@v4
14+
with:
15+
path: ${{ runner.workspace }}/vcpkg_installed
16+
key: ${{ runner.os }}-vcpkg-export-66c0373d-x64-vs2022-v4
17+
18+
- name: Download and Install vcpkg
19+
if: steps.cache-vcpkg.outputs.cache-hit != 'true'
20+
shell: pwsh
21+
run: |
22+
$install_dir = "${{ runner.workspace }}\vcpkg_installed"
23+
$archivePath = "${{ runner.workspace }}\vcpkg-export.7z"
24+
25+
# The file has been built locally with bundle-windows-deps.bat
26+
$url = "https://github.com/introlab/rtabmap/releases/download/0.23.1/vcpkg-export-66c0373d-x64-vs2022.7z"
27+
28+
Invoke-WebRequest -Uri $url -OutFile $archivePath
29+
& 7z x $archivePath "-o$install_dir" -y
30+
31+
- name: Add vcpkg to PATH and env variable
32+
shell: pwsh
33+
run: |
34+
$vcpkg_path = "${{ runner.workspace }}\vcpkg_installed"
35+
echo "VCPKG_EXPORT_PATH=$vcpkg_path" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
36+
echo "$vcpkg_path\installed\x64-windows-release\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
37+
echo "$vcpkg_path\installed\x64-windows-release\tools\python3\Lib\site-packages\numpy.libs" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Cleanup PR Artifacts
2+
on:
3+
pull_request:
4+
types: [closed]
5+
6+
jobs:
7+
delete-artifacts:
8+
runs-on: ubuntu-latest
9+
permissions:
10+
actions: write
11+
steps:
12+
- name: Delete PR Artifacts
13+
uses: geekyeggo/delete-artifact@v5
14+
with:
15+
name: build-output-*

.github/workflows/cmake-ros.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ env:
1212
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
1313
BUILD_TYPE: Release
1414

15+
concurrency:
16+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
17+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
18+
1519
jobs:
1620
build:
1721
# The CMake configure and build commands are platform agnostic and should work equally

.github/workflows/cmake.yml

Lines changed: 77 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,111 @@ on:
1111
env:
1212
BUILD_TYPE: Release
1313

14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
16+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
17+
1418
jobs:
1519
build:
16-
name: ${{ matrix.os }}
20+
name: ${{ matrix.build_name }}
1721
runs-on: ${{ matrix.os }}
1822
strategy:
19-
fail-fast: false
23+
fail-fast: true
2024
matrix:
21-
os: [ubuntu-24.04, ubuntu-22.04]
25+
build_name: [ubuntu-22.04, ubuntu-24.04, ubuntu-24.04-with-opengv, windows-2022, windows-2022-cuda]
2226
include:
23-
- os: ubuntu-22.04
27+
- build_name: ubuntu-22.04
28+
os: ubuntu-22.04
2429
extra_deps: "libunwind-dev libceres-dev"
25-
extra_cmake_def: ""
26-
- os: ubuntu-24.04
30+
extra_cmake_def: "-DWITH_CERES=ON"
31+
- build_name: ubuntu-24.04
32+
os: ubuntu-24.04
2733
extra_deps: "libg2o-dev libceres-dev"
2834
extra_cmake_def: "-DWITH_CERES=ON"
35+
- build_name: ubuntu-24.04-with-opengv
36+
os: ubuntu-24.04
37+
extra_deps: "libg2o-dev libceres-dev"
38+
extra_cmake_def: "-DWITH_CERES=ON -DBUILD_OPENGV=ON"
39+
- build_name: windows-2022
40+
os: windows-2022
41+
extra_deps: ""
42+
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON -DWITH_PYTHON=ON -DWITH_TORCH=OFF'
43+
- build_name: windows-2022-cuda
44+
os: windows-2022
45+
extra_deps: ""
46+
extra_cmake_def: '-DBUILD_AS_BUNDLE=ON -DWITH_PYTHON=ON -DWITH_TORCH=ON'
2947

30-
steps:
31-
- name: Install dependencies
48+
steps:
49+
- uses: actions/checkout@v4
50+
51+
- name: Install Windows Dependencies
52+
if: matrix.build_name == 'windows-2022'
53+
uses: ./.github/actions/install-windows-deps
54+
55+
- name: Install Windows Dependencies with CUDA
56+
if: matrix.build_name == 'windows-2022-cuda'
57+
uses: ./.github/actions/install-windows-cuda-deps
58+
59+
- name: Install Linux Dependencies
60+
if: matrix.os != 'windows-2022'
3261
run: |
3362
DEBIAN_FRONTEND=noninteractive
3463
sudo apt-get update
3564
sudo apt-get -y install libopencv-dev libpcl-dev git cmake software-properties-common libyaml-cpp-dev ${{ matrix.extra_deps }}
3665
37-
- uses: actions/checkout@v4
66+
- name: Configure CMake
67+
if: matrix.os == 'windows-2022'
68+
run: |
69+
cmake `
70+
-B ${{github.workspace}}/build `
71+
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} `
72+
${{ matrix.extra_cmake_def }} `
73+
-DVCPKG_MANIFEST_INSTALL=OFF `
74+
-DVCPKG_TARGET_TRIPLET=x64-windows-release `
75+
-DVCPKG_INSTALLED_DIR="${{env.VCPKG_EXPORT_PATH}}/installed" `
76+
-DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_EXPORT_PATH}}/scripts/buildsystems/vcpkg.cmake `
77+
-DTorch_DIR=${{env.VCPKG_EXPORT_PATH}}/installed/x64-windows-release/tools/python3/Lib/site-packages/torch/share/cmake/Torch
3878
3979
- name: Configure CMake
80+
if: matrix.os != 'windows-2022'
4081
run: |
4182
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{ matrix.extra_cmake_def }}
4283
4384
- name: Build
4485
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
4586

87+
- name: Build Windows Package
88+
if: matrix.os == 'windows-2022'
89+
shell: pwsh
90+
run: |
91+
if ("${{ github.event_name }}" -eq "pull_request") {
92+
cpack --config build/CPackConfig.cmake -G ZIP -B build
93+
} else {
94+
cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --target package
95+
}
96+
97+
- name: Rename CUDA artifacts
98+
if: matrix.build_name == 'windows-2022-cuda'
99+
shell: pwsh
100+
run: Get-ChildItem -Path "build" -Filter "RTABMap-*" | Rename-Item -NewName { $_.BaseName + "_cuda" + $_.Extension }
101+
46102
- name: Info
47103
working-directory: ${{github.workspace}}/build/bin
48104
run: |
49105
./rtabmap-console --version
50106
107+
- name: Upload RTABMap Artifacts
108+
if: matrix.os == 'windows-2022'
109+
uses: actions/upload-artifact@v4
110+
with:
111+
name: RTABMap-Binaries-${{ matrix.build_name }}
112+
path: |
113+
build/RTABMap-*.zip
114+
build/RTABMap-*.exe
115+
compression-level: 0
116+
if-no-files-found: warn
117+
retention-days: ${{ github.event_name == 'pull_request' && 1 || 90 }}
118+
51119
# - name: Test
52120
# working-directory: ${{github.workspace}}/build
53121
# # Execute tests defined by the CMake configuration.

0 commit comments

Comments
 (0)