From d50d17f012ce5ce5364d8f542c3a8e25cbc46452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 16 Feb 2024 16:27:43 +0000 Subject: [PATCH 01/25] Define vcpkg manifest --- .github/workflows/build-windows-vcpkg.txt | 23 --------- .github/workflows/build-windows.yml | 4 +- CMakeLists.txt | 48 +++++++++++-------- vcpkg.json | 57 +++++++++++++++++++++++ 4 files changed, 87 insertions(+), 45 deletions(-) delete mode 100644 .github/workflows/build-windows-vcpkg.txt create mode 100644 vcpkg.json diff --git a/.github/workflows/build-windows-vcpkg.txt b/.github/workflows/build-windows-vcpkg.txt deleted file mode 100644 index 0169ece992..0000000000 --- a/.github/workflows/build-windows-vcpkg.txt +++ /dev/null @@ -1,23 +0,0 @@ ---triplet -x64-windows -boost-algorithm -boost-filesystem -boost-graph -boost-heap -boost-program-options -boost-property-map -boost-property-tree -boost-regex -boost-system -ceres[lapack,suitesparse] -cgal -eigen3 -flann -freeimage -metis -gflags -glew -glog -gtest -qt5-base -sqlite3 diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 413a20e494..fb4b4b8bf0 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -78,7 +78,6 @@ jobs: cd vcpkg git reset --hard ${{ env.VCPKG_COMMIT_ID }} ./bootstrap-vcpkg.bat - ./vcpkg.exe install --recurse @${{ github.workspace }}/.github/workflows/build-windows-vcpkg.txt --clean-after-build - name: Configure and build shell: pwsh @@ -93,8 +92,9 @@ jobs: -DCMAKE_MAKE_PROGRAM=ninja ` -DCMAKE_BUILD_TYPE=Release ` -DTESTS_ENABLED=ON ` + -DGUI_ENABLED=ON ` -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ` - -DVCPKG_TARGET_TRIPLET=x64-windows + -DVCPKG_TARGET_TRIPLET=x64-windows-release ninja - name: Run tests diff --git a/CMakeLists.txt b/CMakeLists.txt index 70f42a1c9a..ffe0d7a890 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -30,6 +30,34 @@ cmake_minimum_required(VERSION 3.10) +################################################################################ +# Options +################################################################################ + +option(SIMD_ENABLED "Whether to enable SIMD optimizations" ON) +option(OPENMP_ENABLED "Whether to enable OpenMP parallelization" ON) +option(IPO_ENABLED "Whether to enable interprocedural optimization" ON) +option(CUDA_ENABLED "Whether to enable CUDA, if available" ON) +option(GUI_ENABLED "Whether to enable the graphical UI" ON) +option(OPENGL_ENABLED "Whether to enable OpenGL, if available" ON) +option(TESTS_ENABLED "Whether to build test binaries" OFF) +option(ASAN_ENABLED "Whether to enable AddressSanitizer flags" OFF) +option(PROFILING_ENABLED "Whether to enable google-perftools linker flags" OFF) +option(CCACHE_ENABLED "Whether to enable compiler caching, if available" ON) +option(CGAL_ENABLED "Whether to enable the CGAL library" ON) + +# Propagate options to vcpkg manifest. +if(TESTS_ENABLED) + enable_testing() + list(APPEND VCPKG_MANIFEST_FEATURES "tests") +endif() +if(CUDA_ENABLED) + list(APPEND VCPKG_MANIFEST_FEATURES "cuda") +endif() +if(GUI_ENABLED) + list(APPEND VCPKG_MANIFEST_FEATURES "gui") +endif() + project(COLMAP LANGUAGES C CXX) set(COLMAP_VERSION "3.10-dev") @@ -57,26 +85,6 @@ include(${CMAKE_CURRENT_SOURCE_DIR}/cmake/CMakeHelper.cmake NO_POLICY_SCOPE) # COLMAP's static libraries. set(CMAKE_POSITION_INDEPENDENT_CODE ON) -################################################################################ -# Options -################################################################################ - -option(SIMD_ENABLED "Whether to enable SIMD optimizations" ON) -option(OPENMP_ENABLED "Whether to enable OpenMP parallelization" ON) -option(IPO_ENABLED "Whether to enable interprocedural optimization" ON) -option(CUDA_ENABLED "Whether to enable CUDA, if available" ON) -option(GUI_ENABLED "Whether to enable the graphical UI" ON) -option(OPENGL_ENABLED "Whether to enable OpenGL, if available" ON) -option(TESTS_ENABLED "Whether to build test binaries" OFF) -option(ASAN_ENABLED "Whether to enable AddressSanitizer flags" OFF) -option(PROFILING_ENABLED "Whether to enable google-perftools linker flags" OFF) -option(CCACHE_ENABLED "Whether to enable compiler caching, if available" ON) -option(CGAL_ENABLED "Whether to enable the CGAL library" ON) - -if(TESTS_ENABLED) - enable_testing() -endif() - ################################################################################ # Dependency configuration ################################################################################ diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000000..3c01fd85c1 --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,57 @@ +{ + "name": "colmap", + "description": "COLMAP is a general-purpose Structure-from-Motion (SfM) and Multi-View Stereo (MVS) pipeline with a graphical and command-line interface. It offers a wide range of features for reconstruction of ordered and unordered image collections. The software is licensed under the new BSD license.", + "homepage": "https://colmap.github.io/", + "license": "BSD-3-Clause", + "supports": "(linux | (windows & !static) | osx) & (x86 | x64 | arm64)", + "dependencies": [ + "boost-filesystem", + "boost-graph", + "boost-program-options", + "boost-system", + "boost-test", + { + "name": "ceres", + "features": [ + "lapack", + "suitesparse" + ] + }, + "cgal", + "eigen3", + "flann", + "freeimage", + "gflags", + "glew", + "glog", + "sqlite3", + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ], + "features": { + "cuda": { + "description": "Build with CUDA support.", + "dependencies": [ + "cuda" + ] + }, + "gui": { + "description": "Build the GUI.", + "dependencies": [ + "qt5-base" + ] + }, + "tests": { + "description": "Build all tests.", + "dependencies": [ + "gtest" + ] + } + } +} \ No newline at end of file From 88157e71ff57f1668deb3cc9831568eda953df6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Fri, 16 Feb 2024 18:36:18 +0000 Subject: [PATCH 02/25] d --- .github/workflows/build-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index fb4b4b8bf0..4b94309c40 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -93,6 +93,7 @@ jobs: -DCMAKE_BUILD_TYPE=Release ` -DTESTS_ENABLED=ON ` -DGUI_ENABLED=ON ` + -DCUDA_ENABLED=OFF ` -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake ` -DVCPKG_TARGET_TRIPLET=x64-windows-release ninja From 14614d693730fbb0db6b88ef0e227ce5af5fbd45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 18 Feb 2024 15:47:34 +0000 Subject: [PATCH 03/25] d --- .github/workflows/build-windows.yml | 2 +- pycolmap/ci/install-colmap-centos.sh | 3 --- pycolmap/ci/install-colmap-macos.sh | 3 --- pycolmap/ci/install-colmap-windows.ps1 | 2 -- pycolmap/ci/vcpkg-dependencies.txt | 19 ------------------- pycolmap/pyproject.toml | 2 +- vcpkg.json | 7 +++++-- 7 files changed, 7 insertions(+), 31 deletions(-) delete mode 100644 pycolmap/ci/vcpkg-dependencies.txt diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 4b94309c40..09ef94b90a 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -31,7 +31,7 @@ jobs: COMPILER_CACHE_DIR: ${{ github.workspace }}/compiler-cache CCACHE_DIR: ${{ github.workspace }}/compiler-cache/ccache CCACHE_BASEDIR: ${{ github.workspace }} - VCPKG_COMMIT_ID: fa6e6a6ec3224f1d3697d544edef6272a59cd834 + VCPKG_COMMIT_ID: 13bde2ff13192e1b2fdd37bd9b475c7665ae6ae5 VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" steps: diff --git a/pycolmap/ci/install-colmap-centos.sh b/pycolmap/ci/install-colmap-centos.sh index 704e3b39a3..bc0c4d1902 100755 --- a/pycolmap/ci/install-colmap-centos.sh +++ b/pycolmap/ci/install-colmap-centos.sh @@ -24,9 +24,6 @@ git clone https://github.com/microsoft/vcpkg ${VCPKG_INSTALLATION_ROOT} cd ${VCPKG_INSTALLATION_ROOT} git checkout ${VCPKG_COMMIT_ID} ./bootstrap-vcpkg.sh -./vcpkg install --recurse --clean-after-build \ - --triplet=${VCPKG_TARGET_TRIPLET} \ - ${DEPENDENCIES} ./vcpkg integrate install # Build COLMAP diff --git a/pycolmap/ci/install-colmap-macos.sh b/pycolmap/ci/install-colmap-macos.sh index 773f7853ef..b2737ac19a 100755 --- a/pycolmap/ci/install-colmap-macos.sh +++ b/pycolmap/ci/install-colmap-macos.sh @@ -14,9 +14,6 @@ git clone https://github.com/microsoft/vcpkg ${VCPKG_INSTALLATION_ROOT} cd ${VCPKG_INSTALLATION_ROOT} git checkout ${VCPKG_COMMIT_ID} ./bootstrap-vcpkg.sh -./vcpkg install --recurse --clean-after-build \ - --triplet=${VCPKG_TARGET_TRIPLET} \ - ${DEPENDENCIES} ./vcpkg integrate install # Build COLMAP diff --git a/pycolmap/ci/install-colmap-windows.ps1 b/pycolmap/ci/install-colmap-windows.ps1 index 0a6a63fad2..a7f591aecb 100755 --- a/pycolmap/ci/install-colmap-windows.ps1 +++ b/pycolmap/ci/install-colmap-windows.ps1 @@ -37,8 +37,6 @@ cd ${CURRDIR} & "./scripts/shell/enter_vs_dev_shell.ps1" [System.Collections.ArrayList]$DEPS = Get-Content -Path "./pycolmap/ci/vcpkg-dependencies.txt" -& "${env:VCPKG_INSTALLATION_ROOT}/vcpkg.exe" install --recurse --clean-after-build ` - --triplet="${env:VCPKG_TARGET_TRIPLET}" @DEPS & "${env:VCPKG_INSTALLATION_ROOT}/vcpkg.exe" integrate install # Build COLMAP diff --git a/pycolmap/ci/vcpkg-dependencies.txt b/pycolmap/ci/vcpkg-dependencies.txt deleted file mode 100644 index 36b843b832..0000000000 --- a/pycolmap/ci/vcpkg-dependencies.txt +++ /dev/null @@ -1,19 +0,0 @@ -boost-algorithm -boost-filesystem -boost-graph -boost-heap -boost-program-options -boost-property-map -boost-property-tree -boost-regex -boost-system -ceres[lapack,suitesparse] -eigen3 -flann -freeimage -metis -gflags -glog -gtest -sqlite3 -jasper[core] diff --git a/pycolmap/pyproject.toml b/pycolmap/pyproject.toml index ea40ad4c75..4f3cb4dce8 100644 --- a/pycolmap/pyproject.toml +++ b/pycolmap/pyproject.toml @@ -33,7 +33,7 @@ archs = ["auto64"] test-command = "python -c \"import pycolmap; print(pycolmap.__version__)\"" [tool.cibuildwheel.environment] -VCPKG_COMMIT_ID = "fa6e6a6ec3224f1d3697d544edef6272a59cd834" +VCPKG_COMMIT_ID = "13bde2ff13192e1b2fdd37bd9b475c7665ae6ae5" [tool.cibuildwheel.linux] before-all = "{package}/ci/install-colmap-centos.sh" diff --git a/vcpkg.json b/vcpkg.json index 3c01fd85c1..bdbdbdae7a 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -5,11 +5,13 @@ "license": "BSD-3-Clause", "supports": "(linux | (windows & !static) | osx) & (x86 | x64 | arm64)", "dependencies": [ + "boost-algorithm", "boost-filesystem", "boost-graph", + "boost-heap", "boost-program-options", - "boost-system", - "boost-test", + "boost-property-map", + "boost-property-tree", { "name": "ceres", "features": [ @@ -24,6 +26,7 @@ "gflags", "glew", "glog", + "metis", "sqlite3", { "name": "vcpkg-cmake", From 2ac1b4acb77d28aa81a9a44151cab53f3e415067 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 18 Feb 2024 15:49:50 +0000 Subject: [PATCH 04/25] d --- pycolmap/ci/install-colmap-centos.sh | 3 +-- pycolmap/ci/install-colmap-macos.sh | 3 +-- pycolmap/ci/install-colmap-windows.ps1 | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/pycolmap/ci/install-colmap-centos.sh b/pycolmap/ci/install-colmap-centos.sh index bc0c4d1902..b940e39ea2 100755 --- a/pycolmap/ci/install-colmap-centos.sh +++ b/pycolmap/ci/install-colmap-centos.sh @@ -18,8 +18,7 @@ export PATH="${COMPILER_TOOLS_DIR}:${PATH}" ccache --version ccache --help -# Build the dependencies -DEPENDENCIES=$(cat ${CURRDIR}/pycolmap/ci/vcpkg-dependencies.txt) +# Setup vcpkg git clone https://github.com/microsoft/vcpkg ${VCPKG_INSTALLATION_ROOT} cd ${VCPKG_INSTALLATION_ROOT} git checkout ${VCPKG_COMMIT_ID} diff --git a/pycolmap/ci/install-colmap-macos.sh b/pycolmap/ci/install-colmap-macos.sh index b2737ac19a..5dbca73e7c 100755 --- a/pycolmap/ci/install-colmap-macos.sh +++ b/pycolmap/ci/install-colmap-macos.sh @@ -8,8 +8,7 @@ brew install git cmake ninja llvm ccache # When building lapack-reference, vcpkg/cmake looks for gfortran. ln -s $(which gfortran-13) "$(dirname $(which gfortran-13))/gfortran" -# Build the dependencies -DEPENDENCIES=$(cat ${CURRDIR}/pycolmap/ci/vcpkg-dependencies.txt) +# Setup vcpkg git clone https://github.com/microsoft/vcpkg ${VCPKG_INSTALLATION_ROOT} cd ${VCPKG_INSTALLATION_ROOT} git checkout ${VCPKG_COMMIT_ID} diff --git a/pycolmap/ci/install-colmap-windows.ps1 b/pycolmap/ci/install-colmap-windows.ps1 index a7f591aecb..b8ca5ff501 100755 --- a/pycolmap/ci/install-colmap-windows.ps1 +++ b/pycolmap/ci/install-colmap-windows.ps1 @@ -26,7 +26,7 @@ If (!(Test-Path -path "${COMPILER_TOOLS_DIR}/ccache.exe" -PathType Leaf)) { Remove-Item -Recurse ${folder_path} } -# Build the dependencies +# Setup vcpkg cd ${CURRDIR} git clone https://github.com/microsoft/vcpkg ${env:VCPKG_INSTALLATION_ROOT} cd ${env:VCPKG_INSTALLATION_ROOT} From 2b8021e9179a189efe96a9630c2440744f24b145 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 18 Feb 2024 15:52:27 +0000 Subject: [PATCH 05/25] d --- pycolmap/ci/install-colmap-centos.sh | 2 -- pycolmap/ci/install-colmap-windows.ps1 | 2 -- 2 files changed, 4 deletions(-) diff --git a/pycolmap/ci/install-colmap-centos.sh b/pycolmap/ci/install-colmap-centos.sh index b940e39ea2..64b2a8ad27 100755 --- a/pycolmap/ci/install-colmap-centos.sh +++ b/pycolmap/ci/install-colmap-centos.sh @@ -15,8 +15,6 @@ if [ ! -f "${COMPILER_TOOLS_DIR}/ccache" ]; then cp ${FILE}/ccache ${COMPILER_TOOLS_DIR} fi export PATH="${COMPILER_TOOLS_DIR}:${PATH}" -ccache --version -ccache --help # Setup vcpkg git clone https://github.com/microsoft/vcpkg ${VCPKG_INSTALLATION_ROOT} diff --git a/pycolmap/ci/install-colmap-windows.ps1 b/pycolmap/ci/install-colmap-windows.ps1 index b8ca5ff501..6577b7cec5 100755 --- a/pycolmap/ci/install-colmap-windows.ps1 +++ b/pycolmap/ci/install-colmap-windows.ps1 @@ -35,8 +35,6 @@ git checkout "${env:VCPKG_COMMIT_ID}" cd ${CURRDIR} & "./scripts/shell/enter_vs_dev_shell.ps1" - -[System.Collections.ArrayList]$DEPS = Get-Content -Path "./pycolmap/ci/vcpkg-dependencies.txt" & "${env:VCPKG_INSTALLATION_ROOT}/vcpkg.exe" integrate install # Build COLMAP From 7e26bd436d9a209ef88fa499e45346e9f284596f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 18 Feb 2024 16:03:43 +0000 Subject: [PATCH 06/25] d --- .github/workflows/build-ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 6c71e43559..49a80c955c 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -123,7 +123,7 @@ jobs: - name: Setup Ubuntu run: | - sudo apt-get install -y \ + sudo apt-get update && sudo apt-get install -y \ build-essential \ ninja-build \ libboost-program-options-dev \ From adfc1fa9f9d5e6d67b0661a7c674ab305d7609e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 18 Feb 2024 16:32:07 +0000 Subject: [PATCH 07/25] d --- pycolmap/ci/install-colmap-centos.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pycolmap/ci/install-colmap-centos.sh b/pycolmap/ci/install-colmap-centos.sh index 64b2a8ad27..8e8ac4fd4f 100755 --- a/pycolmap/ci/install-colmap-centos.sh +++ b/pycolmap/ci/install-colmap-centos.sh @@ -3,7 +3,8 @@ set -e -x uname -a CURRDIR=$(pwd) -yum install -y gcc gcc-c++ ninja-build curl zip unzip tar +yum install -y gcc gcc-c++ ninja-build curl zip unzip tar \ + opengl glu libx11 xrandr xi xxf86vm # needed for freeglut # ccache shipped by CentOS is too old so we download and cache it. COMPILER_TOOLS_DIR="${CONTAINER_COMPILER_CACHE_DIR}/bin" From 1547c0bbccf52389981501085fde8ebf2abe73f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Sun, 18 Feb 2024 19:33:41 +0000 Subject: [PATCH 08/25] d --- pycolmap/ci/install-colmap-centos.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pycolmap/ci/install-colmap-centos.sh b/pycolmap/ci/install-colmap-centos.sh index 8e8ac4fd4f..2a3b4d84d1 100755 --- a/pycolmap/ci/install-colmap-centos.sh +++ b/pycolmap/ci/install-colmap-centos.sh @@ -3,8 +3,7 @@ set -e -x uname -a CURRDIR=$(pwd) -yum install -y gcc gcc-c++ ninja-build curl zip unzip tar \ - opengl glu libx11 xrandr xi xxf86vm # needed for freeglut +yum install -y gcc gcc-c++ ninja-build curl zip unzip tar # ccache shipped by CentOS is too old so we download and cache it. COMPILER_TOOLS_DIR="${CONTAINER_COMPILER_CACHE_DIR}/bin" @@ -27,7 +26,7 @@ git checkout ${VCPKG_COMMIT_ID} # Build COLMAP cd ${CURRDIR} mkdir build && cd build -CXXFLAGS="-fPIC" CFLAGS="-fPIC" cmake .. -GNinja \ +cmake .. -GNinja \ -DCUDA_ENABLED=OFF \ -DCGAL_ENABLED=OFF \ -DGUI_ENABLED=OFF \ From a31e3f6970e01265dd76ad7c08f9bf4a905b609e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger=20=28from=20Dev=20Box=29?= Date: Mon, 19 Feb 2024 08:53:29 +0100 Subject: [PATCH 09/25] d --- CMakeLists.txt | 3 +++ vcpkg.json | 17 +++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ffe0d7a890..663f5479f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,9 @@ endif() if(GUI_ENABLED) list(APPEND VCPKG_MANIFEST_FEATURES "gui") endif() +if(CGAL_ENABLED) + list(APPEND VCPKG_MANIFEST_FEATURES "cgal") +endif() project(COLMAP LANGUAGES C CXX) diff --git a/vcpkg.json b/vcpkg.json index bdbdbdae7a..ac7bfca8ef 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -19,12 +19,10 @@ "suitesparse" ] }, - "cgal", "eigen3", "flann", "freeimage", "gflags", - "glew", "glog", "metis", "sqlite3", @@ -38,8 +36,14 @@ } ], "features": { + "tests": { + "description": "Build all tests.", + "dependencies": [ + "gtest" + ] + }, "cuda": { - "description": "Build with CUDA support.", + "description": "Build with CUDA.", "dependencies": [ "cuda" ] @@ -47,13 +51,14 @@ "gui": { "description": "Build the GUI.", "dependencies": [ + "glew", "qt5-base" ] }, - "tests": { - "description": "Build all tests.", + "cgal": { + "description": "Build with CGAL.", "dependencies": [ - "gtest" + "cgal" ] } } From c4817d1bf40a22f3b2e740bc95957b3e163a3263 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger=20=28from=20Dev=20Box=29?= Date: Mon, 19 Feb 2024 09:18:36 +0100 Subject: [PATCH 10/25] d --- vcpkg.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vcpkg.json b/vcpkg.json index ac7bfca8ef..a28b0b3df7 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -24,6 +24,11 @@ "freeimage", "gflags", "glog", + // Transitive dependency through freeimage -> libraw -> jasper. + // By default, jasper depends on opengl/freeglut, which we + // explicitly disable by only selecting "core" features. + // This is to reduce the resulting binary size of colmap. + "jasper[core]", "metis", "sqlite3", { From 10c92dc3c58f71306d855fd0fe6d1e10c42a14a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger=20=28from=20Dev=20Box=29?= Date: Mon, 19 Feb 2024 09:20:26 +0100 Subject: [PATCH 11/25] json doesn't like comments... --- vcpkg.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index a28b0b3df7..0246f31d45 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -24,10 +24,6 @@ "freeimage", "gflags", "glog", - // Transitive dependency through freeimage -> libraw -> jasper. - // By default, jasper depends on opengl/freeglut, which we - // explicitly disable by only selecting "core" features. - // This is to reduce the resulting binary size of colmap. "jasper[core]", "metis", "sqlite3", From 74bfc5526aabb28130461c2505bfce2e1fbf1fb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger=20=28from=20Dev=20Box=29?= Date: Mon, 19 Feb 2024 09:32:32 +0100 Subject: [PATCH 12/25] d --- vcpkg.json | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vcpkg.json b/vcpkg.json index 0246f31d45..ec9b74564b 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -24,7 +24,12 @@ "freeimage", "gflags", "glog", - "jasper[core]", + { + "name": "jasper", + "features": [ + "core" + ] + }, "metis", "sqlite3", { From 4a8736afad65263440a915831862648af7f8f628 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger=20=28from=20Dev=20Box=29?= Date: Mon, 19 Feb 2024 09:41:11 +0100 Subject: [PATCH 13/25] d --- vcpkg.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index ec9b74564b..b7b74587e5 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -26,9 +26,7 @@ "glog", { "name": "jasper", - "features": [ - "core" - ] + "default-features": false }, "metis", "sqlite3", From 4ebbfeee4d096276c5fce87c28fc3e05a4cdb8de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 19 Feb 2024 14:45:04 +0000 Subject: [PATCH 14/25] d --- .github/workflows/build-ubuntu.yml | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 49a80c955c..59d1aca4d1 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -24,6 +24,7 @@ jobs: cudaEnabled: false, e2eTests: true, checkCodeFormat: true, + buildPythonPackage: true, }, { os: ubuntu-22.04, @@ -33,6 +34,7 @@ jobs: cudaEnabled: true, e2eTests: false, checkCodeFormat: false, + buildPythonPackage: false, }, { os: ubuntu-22.04, @@ -42,6 +44,7 @@ jobs: cudaEnabled: false, e2eTests: false, checkCodeFormat: false, + buildPythonPackage: false, }, { os: ubuntu-22.04, @@ -51,6 +54,7 @@ jobs: cudaEnabled: false, e2eTests: false, checkCodeFormat: false, + buildPythonPackage: false, }, { os: ubuntu-20.04, @@ -60,6 +64,7 @@ jobs: cudaEnabled: false, e2eTests: false, checkCodeFormat: false, + buildPythonPackage: false, }, { os: ubuntu-20.04, @@ -69,6 +74,7 @@ jobs: cudaEnabled: true, e2eTests: false, checkCodeFormat: false, + buildPythonPackage: false, }, ] @@ -207,11 +213,27 @@ jobs: cd ../doc/sample-project mkdir build cd build - colmap_DIR=${{ github.workspace }}/build/install/share/colmap cmake .. \ + export colmap_DIR=${{ github.workspace }}/build/install/share/colmap + cmake .. \ -GNinja \ -DCMAKE_CUDA_ARCHITECTURES=50 ninja ./hello_world --message "world" + + - name: Build Python package + if: runner.buildPythonPackage == 'true' + run: | + set -x + sudo apt-get update && sudo apt-get install -y \ + python3-pip \ + python3-setuptools \ + python3-wheel + pip install --upgrade pip setuptools wheel twine + export colmap_DIR=${{ github.workspace }}/build/install/share/colmap + cd pycolmap + pip wheel . + # twine check dist/* + # twine upload --repository pycolmap dist/* - name: Run tests run: | From 59d8255c356678d2646912dc18187ef84cbc9009 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 19 Feb 2024 15:54:09 +0000 Subject: [PATCH 15/25] d --- .github/workflows/build-ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 59d1aca4d1..4590a71c35 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -221,7 +221,7 @@ jobs: ./hello_world --message "world" - name: Build Python package - if: runner.buildPythonPackage == 'true' + if: matrix.config.buildPythonPackage == 'true' run: | set -x sudo apt-get update && sudo apt-get install -y \ From 477c17147cf82e3518f73a243f4db318c2da5a71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Mon, 19 Feb 2024 16:08:59 +0000 Subject: [PATCH 16/25] d --- .github/workflows/build-ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 4590a71c35..0bf49a5412 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -221,7 +221,7 @@ jobs: ./hello_world --message "world" - name: Build Python package - if: matrix.config.buildPythonPackage == 'true' + if: matrix.config.buildPythonPackage == true run: | set -x sudo apt-get update && sudo apt-get install -y \ From 6b5a46ce2b9c1045a27216fc3ec97c02d1d4ce30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johannes=20Sch=C3=B6nberger?= Date: Wed, 21 Feb 2024 08:09:09 +0000 Subject: [PATCH 17/25] d --- .github/workflows/build-ubuntu.yml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 0bf49a5412..354c5c454f 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -219,21 +219,6 @@ jobs: -DCMAKE_CUDA_ARCHITECTURES=50 ninja ./hello_world --message "world" - - - name: Build Python package - if: matrix.config.buildPythonPackage == true - run: | - set -x - sudo apt-get update && sudo apt-get install -y \ - python3-pip \ - python3-setuptools \ - python3-wheel - pip install --upgrade pip setuptools wheel twine - export colmap_DIR=${{ github.workspace }}/build/install/share/colmap - cd pycolmap - pip wheel . - # twine check dist/* - # twine upload --repository pycolmap dist/* - name: Run tests run: | From 2af91ac7a63a84a4b54979dde5084099d8810786 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Wed, 21 Feb 2024 12:35:10 +0100 Subject: [PATCH 18/25] glew is a dependency of cuda, not gui --- vcpkg.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/vcpkg.json b/vcpkg.json index b7b74587e5..ae132e8cd3 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -49,13 +49,13 @@ "cuda": { "description": "Build with CUDA.", "dependencies": [ + "glew", "cuda" ] }, "gui": { "description": "Build the GUI.", "dependencies": [ - "glew", "qt5-base" ] }, @@ -66,4 +66,4 @@ ] } } -} \ No newline at end of file +} From 67ee6ca472756f03da60b28fa1ffec5b7190917f Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Wed, 21 Feb 2024 12:35:16 +0100 Subject: [PATCH 19/25] Debug pycolmap build on ubuntu --- .github/workflows/build-pycolmap.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-pycolmap.yml b/.github/workflows/build-pycolmap.yml index 1debbce66d..62c2710f21 100644 --- a/.github/workflows/build-pycolmap.yml +++ b/.github/workflows/build-pycolmap.yml @@ -17,9 +17,9 @@ jobs: matrix: config: [ {os: ubuntu-latest}, - {os: macos-13, arch: x86_64}, - {os: macos-13, arch: arm64}, - {os: windows-latest}, + #{os: macos-13, arch: x86_64}, + #{os: macos-13, arch: arm64}, + #{os: windows-latest}, ] env: COMPILER_CACHE_VERSION: 1 @@ -98,8 +98,9 @@ jobs: echo "CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" >> "$GITHUB_ENV" # Fix: cibuildhweel cannot interpolate env variables. - CONFIG_SETTINGS="cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" - CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" + #CONFIG_SETTINGS="cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" + #CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" + CONFIG_SETTINGS="cmake.define.CMAKE_PREFIX_PATH=${{ github.workspace }}/build/vcpkg_installed/${VCPKG_TARGET_TRIPLET}" echo "CIBW_CONFIG_SETTINGS_LINUX=${CONFIG_SETTINGS}" >> "$GITHUB_ENV" # Remap caching paths to the container From a178cbf34b58bd95bd64dfdc520d7af6117dd413 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Wed, 21 Feb 2024 12:54:44 +0100 Subject: [PATCH 20/25] glew is also required for the GUI --- vcpkg.json | 1 + 1 file changed, 1 insertion(+) diff --git a/vcpkg.json b/vcpkg.json index ae132e8cd3..9420ab7890 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -56,6 +56,7 @@ "gui": { "description": "Build the GUI.", "dependencies": [ + "glew", "qt5-base" ] }, From 5d6d944289ea65a57f8410067ab6964d4e07aec1 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Wed, 21 Feb 2024 14:20:30 +0100 Subject: [PATCH 21/25] Attempted fix for pycolmap CI --- .github/workflows/build-pycolmap.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-pycolmap.yml b/.github/workflows/build-pycolmap.yml index 62c2710f21..039cfaa635 100644 --- a/.github/workflows/build-pycolmap.yml +++ b/.github/workflows/build-pycolmap.yml @@ -98,9 +98,9 @@ jobs: echo "CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" >> "$GITHUB_ENV" # Fix: cibuildhweel cannot interpolate env variables. - #CONFIG_SETTINGS="cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" - #CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" - CONFIG_SETTINGS="cmake.define.CMAKE_PREFIX_PATH=${{ github.workspace }}/build/vcpkg_installed/${VCPKG_TARGET_TRIPLET}" + CONFIG_SETTINGS="cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" + CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" + CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_INSTALLED_DIR=${{ github.workspace }}/build/vcpkg_installed" echo "CIBW_CONFIG_SETTINGS_LINUX=${CONFIG_SETTINGS}" >> "$GITHUB_ENV" # Remap caching paths to the container From e8a51b0f6824f041827f860a47e5be910430d76e Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Wed, 21 Feb 2024 14:49:40 +0100 Subject: [PATCH 22/25] CentOS container has a different path --- .github/workflows/build-pycolmap.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-pycolmap.yml b/.github/workflows/build-pycolmap.yml index 039cfaa635..929c1ad06d 100644 --- a/.github/workflows/build-pycolmap.yml +++ b/.github/workflows/build-pycolmap.yml @@ -100,7 +100,7 @@ jobs: # Fix: cibuildhweel cannot interpolate env variables. CONFIG_SETTINGS="cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" - CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_INSTALLED_DIR=${{ github.workspace }}/build/vcpkg_installed" + CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_INSTALLED_DIR=/project/build/vcpkg_installed" echo "CIBW_CONFIG_SETTINGS_LINUX=${CONFIG_SETTINGS}" >> "$GITHUB_ENV" # Remap caching paths to the container From 2635bbf28039fe223aef44d66aeaecb3504ba264 Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Wed, 21 Feb 2024 15:17:33 +0100 Subject: [PATCH 23/25] Fix other platforms --- .github/workflows/build-pycolmap.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-pycolmap.yml b/.github/workflows/build-pycolmap.yml index 929c1ad06d..4292ed10c3 100644 --- a/.github/workflows/build-pycolmap.yml +++ b/.github/workflows/build-pycolmap.yml @@ -17,9 +17,9 @@ jobs: matrix: config: [ {os: ubuntu-latest}, - #{os: macos-13, arch: x86_64}, - #{os: macos-13, arch: arm64}, - #{os: windows-latest}, + {os: macos-13, arch: x86_64}, + {os: macos-13, arch: arm64}, + {os: windows-latest}, ] env: COMPILER_CACHE_VERSION: 1 @@ -56,6 +56,7 @@ jobs: # Fix: cibuildhweel cannot interpolate env variables. CONFIG_SETTINGS="cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" + CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.VCPKG_INSTALLED_DIR=${{ github.workspace }}/build/vcpkg_installed" CONFIG_SETTINGS="${CONFIG_SETTINGS} cmake.define.CMAKE_OSX_ARCHITECTURES=${CMAKE_OSX_ARCHITECTURES}" echo "CIBW_CONFIG_SETTINGS_MACOS=${CONFIG_SETTINGS}" >> "$GITHUB_ENV" @@ -67,7 +68,7 @@ jobs: if: runner.os == 'Windows' shell: pwsh run: | - $VCPKG_INSTALLATION_ROOT="${{ github.workspace }}/vcpkg" + $VCPKG_INSTALLATION_ROOT = "${{ github.workspace }}/vcpkg" echo "VCPKG_INSTALLATION_ROOT=${VCPKG_INSTALLATION_ROOT}" >> "${env:GITHUB_ENV}" $CMAKE_TOOLCHAIN_FILE = "${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" echo "CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" >> "${env:GITHUB_ENV}" @@ -76,10 +77,12 @@ jobs: # Fix: cibuildhweel cannot interpolate env variables. $CMAKE_TOOLCHAIN_FILE = $CMAKE_TOOLCHAIN_FILE.replace('\', '/') + $VCPKG_INSTALLED_DIR = "${{ github.workspace }}/build/vcpkg_installed" $CONFIG_SETTINGS = "cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" $CONFIG_SETTINGS = "${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" + $CONFIG_SETTINGS = "${CONFIG_SETTINGS} cmake.define.VCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR}" echo "CIBW_CONFIG_SETTINGS_WINDOWS=${CONFIG_SETTINGS}" >> "${env:GITHUB_ENV}" - $CIBW_REPAIR_WHEEL_COMMAND = "delvewheel repair -v --add-path ${VCPKG_INSTALLATION_ROOT}/installed/${VCPKG_TARGET_TRIPLET}/bin -w {dest_dir} {wheel}" + $CIBW_REPAIR_WHEEL_COMMAND = "delvewheel repair -v --add-path ${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin -w {dest_dir} {wheel}" echo "CIBW_REPAIR_WHEEL_COMMAND_WINDOWS=${CIBW_REPAIR_WHEEL_COMMAND}" >> "${env:GITHUB_ENV}" # vcpkg binary caching From 6ec74c4592763c135fbaf1ab5a8444468aa6d9fe Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Wed, 21 Feb 2024 16:36:18 +0100 Subject: [PATCH 24/25] CMake doesn't like \ --- .github/workflows/build-pycolmap.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-pycolmap.yml b/.github/workflows/build-pycolmap.yml index 4292ed10c3..39cf7626fd 100644 --- a/.github/workflows/build-pycolmap.yml +++ b/.github/workflows/build-pycolmap.yml @@ -78,6 +78,7 @@ jobs: # Fix: cibuildhweel cannot interpolate env variables. $CMAKE_TOOLCHAIN_FILE = $CMAKE_TOOLCHAIN_FILE.replace('\', '/') $VCPKG_INSTALLED_DIR = "${{ github.workspace }}/build/vcpkg_installed" + $VCPKG_INSTALLED_DIR = $VCPKG_INSTALLED_DIR.replace('\', '/') $CONFIG_SETTINGS = "cmake.define.CMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}" $CONFIG_SETTINGS = "${CONFIG_SETTINGS} cmake.define.VCPKG_TARGET_TRIPLET=${VCPKG_TARGET_TRIPLET}" $CONFIG_SETTINGS = "${CONFIG_SETTINGS} cmake.define.VCPKG_INSTALLED_DIR=${VCPKG_INSTALLED_DIR}" From 122a2889422c199e19bc6c18bc8208067141ba2d Mon Sep 17 00:00:00 2001 From: Paul-Edouard Sarlin Date: Wed, 21 Feb 2024 17:52:29 +0100 Subject: [PATCH 25/25] Cleanup --- .github/workflows/build-ubuntu.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/build-ubuntu.yml b/.github/workflows/build-ubuntu.yml index 354c5c454f..39d1c90525 100644 --- a/.github/workflows/build-ubuntu.yml +++ b/.github/workflows/build-ubuntu.yml @@ -24,7 +24,6 @@ jobs: cudaEnabled: false, e2eTests: true, checkCodeFormat: true, - buildPythonPackage: true, }, { os: ubuntu-22.04, @@ -34,7 +33,6 @@ jobs: cudaEnabled: true, e2eTests: false, checkCodeFormat: false, - buildPythonPackage: false, }, { os: ubuntu-22.04, @@ -44,7 +42,6 @@ jobs: cudaEnabled: false, e2eTests: false, checkCodeFormat: false, - buildPythonPackage: false, }, { os: ubuntu-22.04, @@ -54,7 +51,6 @@ jobs: cudaEnabled: false, e2eTests: false, checkCodeFormat: false, - buildPythonPackage: false, }, { os: ubuntu-20.04, @@ -64,7 +60,6 @@ jobs: cudaEnabled: false, e2eTests: false, checkCodeFormat: false, - buildPythonPackage: false, }, { os: ubuntu-20.04, @@ -74,7 +69,6 @@ jobs: cudaEnabled: true, e2eTests: false, checkCodeFormat: false, - buildPythonPackage: false, }, ]