Add Windows (win-64) build support for ORB-SLAM2#2
Open
margauxmedwards wants to merge 6 commits into
Open
Conversation
… pangolin submodule
## Summary Adds Windows (win-64) build support for the Pangolin conda package by introducing a `recipe/recipe.yaml` in rattler-build format alongside the existing conda-build `meta.yaml`. ## Changes ### `recipe/recipe.yaml` (new) - rattler-build recipe with platform-split build scripts: - **Windows**: uses `cmd.exe` with `cl.exe` (MSVC/VS2022), installs to `%PREFIX%\Library`, disables OpenEXR, video, and examples - **Linux/macOS**: uses the existing shell build approach - Windows-only host deps (wayland, Python, setuptools excluded on Windows) - `CMAKE_PREFIX_PATH` set correctly for Windows (`%PREFIX%\Library`) ### `recipe/build.sh` - Removed Python executable flags (`-DPython_EXECUTABLE`, etc.) - Added `BUILD_PANGOLIN_PYTHON=OFF` and `CMAKE_DISABLE_FIND_PACKAGE_Python(3)=ON` to avoid picking up system Python on non-Windows ### `recipe/meta.yaml` - Removed `python`, `pybind11`, and `python` run dep (Python bindings disabled) ### `recipe/conda_build_config.yaml` - Removed (sysroot path-replacement config no longer needed) ## Testing Successfully built and packaged on Windows with `pixi run build-pangolin`: - Compiler: MSVC 19.44 (VS2022) - Output: `pangolin-2024.07.03-haab3175_0.conda` (32.68 MiB, 244 files) - All rattler-build tests passed
There was a problem hiding this comment.
Pull request overview
Adds Windows (win-64) build support for the ORB-SLAM2-VSLAM-LAB conda recipe, plus supporting developer/CI infrastructure (pixi + GitHub Actions) and a pangolin feedstock submodule to provide a Windows-capable pangolin package.
Changes:
- Add a Windows-specific build script path for ORB-SLAM2 (including third-party builds) and adjust dependencies to use conda-forge
pangolin+libopencv. - Introduce a set of Windows/MSVC compatibility patches for ORB-SLAM2, DBoW2, and g2o.
- Add pixi environment/lockfile and a CI workflow to build pangolin + ORB-SLAM2 on Linux and Windows.
Reviewed changes
Copilot reviewed 16 out of 18 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
pixi.toml |
Adds a Windows pixi workspace and tasks to build pangolin and ORB-SLAM2 via rattler-build. |
pixi.lock |
Pins pixi environment dependencies for reproducible Windows builds. |
ORB-SLAM2-VSLAM-LAB/recipe.yaml |
Enables Windows builds, adds patches, updates deps (pangolin/libopencv), and adjusts license file path. |
ORB-SLAM2-VSLAM-LAB/fix-win-thirdparty-static-libs.patch |
Forces static builds for DBoW2/g2o on Windows to avoid DLL export issues. |
ORB-SLAM2-VSLAM-LAB/fix-win-stdint-gcc.patch |
Replaces GCC-specific <stdint-gcc.h> include with <cstdint> in DBoW2. |
ORB-SLAM2-VSLAM-LAB/fix-win-orbslam2-stdint-gcc.patch |
Replaces GCC-specific <stdint-gcc.h> include with <cstdint> in ORB-SLAM2. |
ORB-SLAM2-VSLAM-LAB/fix-win-orbslam2-posix.patch |
Adds a small Windows compatibility header and removes Linux-only sysinfo includes. |
ORB-SLAM2-VSLAM-LAB/fix-win-orbslam2-link-thirdparty.patch |
Adjusts Windows linking for third-party libs. |
ORB-SLAM2-VSLAM-LAB/fix-win-mappoint-vla.patch |
Removes a GCC VLA usage in MapPoint.cc by switching to nested vectors. |
ORB-SLAM2-VSLAM-LAB/fix-win-g2o-vasprintf.patch |
Adds an MSVC-friendly vasprintf replacement in g2o utilities. |
ORB-SLAM2-VSLAM-LAB/fix-win-g2o-tr1-unordered-map.patch |
Replaces TR1 types with C++11 equivalents in g2o. |
ORB-SLAM2-VSLAM-LAB/fix-win-g2o-posix-compat.patch |
Tweaks platform detection and POSIX-related includes/behavior for MSVC. |
ORB-SLAM2-VSLAM-LAB/fix-win-find-threads.patch |
Adds find_package(Threads REQUIRED) to improve CMake thread discovery. |
conda_build_config.yaml |
Switches Windows x86_64 compiler selection to vs2022. |
.gitmodules |
Adds pangolin-feedstock submodule pointing at a Windows-build branch. |
.gitignore |
Ignores build output/ directories. |
.github/workflows/rattler-build.yml |
Adds CI jobs to build pangolin and ORB-SLAM2 on Linux and Windows via rattler-build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
9
to
+13
| source: | ||
| - git: https://github.com/VSLAM-LAB/ORB-SLAM2-VSLAM-LAB | ||
| rev: 053f26faded2f824ff5297a09fa5a03e19c1a4ae | ||
| target_directory: src | ||
| patches: |
| @@ -0,0 +1,12 @@ | |||
| diff --git a/Thirdparty/DBoW2/DBoW2/FORB.cpp b/Thirdparty/DBoW2/DBoW2/FORB.cpp | |||
| @@ -0,0 +1,11 @@ | |||
| diff --git a/src/ORBmatcher.cc b/src/ORBmatcher.cc | |||
| @@ -0,0 +1,28 @@ | |||
| diff --git a/src/MapPoint.cc b/src/MapPoint.cc | |||
Comment on lines
+30
to
+38
| env: | ||
| GH_PAT: ${{ secrets.GH_PAT }} | ||
| run: | | ||
| if [ -n "$GH_PAT" ]; then | ||
| git config --global url."https://${GH_PAT}@github.com/".insteadOf "https://github.com/" | ||
| git submodule update --init --depth=1 pangolin-feedstock | ||
| else | ||
| echo "::warning::GH_PAT not set — skipping pangolin submodule checkout" | ||
| fi |
| - name: Install rattler-build | ||
| uses: prefix-dev/rattler-build-action@v0.2.19 | ||
| with: | ||
| rattler-build-version: "0.36.0" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds Windows (win-64) build support for ORB-SLAM2-VSLAM-LAB, along with supporting infrastructure (pixi environment, GitHub Actions workflow, and updated pangolin submodule).
Changes
ORB-SLAM2-VSLAM-LAB/recipe.yamlskip: win; added Windows-specificcmd.exebuild script-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=ONand/bigobj /Zm200flagsif: linuxfontan::pangolin+opencvwithpangolin+libopencvfrom conda-forgeWindows patches (new)
fix-win-stdint-gcc.patch<stdint-gcc.h>in DBoW2fix-win-orbslam2-stdint-gcc.patchORBmatcher.ccfix-win-mappoint-vla.patchvector<vector<float>>fix-win-g2o-tr1-unordered-map.patchstd::tr1types with C++11 equivalentsfix-win-g2o-posix-compat.patchfix-win-g2o-vasprintf.patchvasprintfshim for MSVCfix-win-find-threads.patchfix-win-orbslam2-posix.patchfix-win-orbslam2-link-thirdparty.patchfix-win-thirdparty-static-libs.patchInfrastructure
pixi.toml+pixi.lock: pixi environment withrattler-build, cmake, ninja.github/workflows/rattler-build.yml: CI workflow for Windows buildspangolin-feedstocksubmodule: updated to include Windows recipe (recipe.yaml)conda_build_config.yaml: minor updatesTesting
Successfully built and packaged on Windows with
pixi run build-orbslam2:orbslam2-vslamlab-1.0-hf29b281_0.conda