-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Update README.md * update CI pipelines * add install-ccache.ps1 * d * d * directly find suitesparse (before assume Ceres achieve this) * try removing the direct linking of CHOLMOD library * add vcpkg.json * remove unnecessary features * d * remove requirement for cuda * d * d * d * d * D * d * d * d * d * d * d * d * d * d * d * d * d * d * d * d * d * d * d --------- Co-authored-by: Linfei Pan <[email protected]> Co-authored-by: lpanaf <[email protected]>
- Loading branch information
1 parent
1dc20d7
commit c0579ef
Showing
11 changed files
with
1,045 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
[CmdletBinding()] | ||
param ( | ||
[Parameter(Mandatory = $true)] | ||
[string] $Destination | ||
) | ||
|
||
$version = "4.8" | ||
$folder = "ccache-$version-windows-x86_64" | ||
$url = "https://github.com/ccache/ccache/releases/download/v$version/$folder.zip" | ||
$expectedSha256 = "A2B3BAB4BB8318FFC5B3E4074DC25636258BC7E4B51261F7D9BEF8127FDA8309" | ||
|
||
$ErrorActionPreference = "Stop" | ||
|
||
try { | ||
New-Item -Path "$Destination" -ItemType Container -ErrorAction SilentlyContinue | ||
|
||
Write-Host "Download CCache" | ||
$zipFilePath = Join-Path "$env:TEMP" "$folder.zip" | ||
Invoke-WebRequest -Uri $url -UseBasicParsing -OutFile "$zipFilePath" -MaximumRetryCount 3 | ||
|
||
$hash = Get-FileHash $zipFilePath -Algorithm "sha256" | ||
if ($hash.Hash -ne $expectedSha256) { | ||
throw "File $Path hash $hash.Hash did not match expected hash $expectedHash" | ||
} | ||
|
||
Write-Host "Unzip CCache" | ||
Expand-Archive -Path "$zipFilePath" -DestinationPath "$env:TEMP" | ||
|
||
Write-Host "Move CCache" | ||
Move-Item -Force "$env:TEMP/$folder/ccache.exe" "$Destination" | ||
Remove-Item "$zipFilePath" | ||
Remove-Item -Recurse "$env:TEMP/$folder" | ||
} | ||
catch { | ||
Write-Host "Installation failed with an error" | ||
$_.Exception | Format-List | ||
exit -1 | ||
} |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
name: Windows | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
types: [ assigned, opened, synchronize, reopened ] | ||
release: | ||
types: [ published, edited ] | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.config.os }} ${{ matrix.config.cmakeBuildType }} ${{ matrix.config.cudaEnabled && 'CUDA' || '' }} | ||
runs-on: ${{ matrix.config.os }} | ||
strategy: | ||
matrix: | ||
config: [ | ||
{ | ||
os: windows-2019, | ||
cmakeBuildType: Release, | ||
cudaEnabled: false, | ||
testsEnabled: true, | ||
exportPackage: false, | ||
}, | ||
{ | ||
os: windows-2022, | ||
cmakeBuildType: Release, | ||
cudaEnabled: false, | ||
testsEnabled: true, | ||
exportPackage: true, | ||
}, | ||
] | ||
|
||
env: | ||
COMPILER_CACHE_VERSION: 1 | ||
COMPILER_CACHE_DIR: ${{ github.workspace }}/compiler-cache | ||
CCACHE_DIR: ${{ github.workspace }}/compiler-cache/ccache | ||
CCACHE_BASEDIR: ${{ github.workspace }} | ||
VCPKG_COMMIT_ID: e01906b2ba7e645a76ee021a19de616edc98d29f | ||
VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Export GitHub Actions cache env | ||
uses: actions/github-script@v7 | ||
with: | ||
script: | | ||
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); | ||
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); | ||
- name: Compiler cache | ||
uses: actions/cache@v4 | ||
id: cache-builds | ||
with: | ||
key: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.cmakeBuildType }}-${{ matrix.config.asanEnabled }}--${{ matrix.config.cudaEnabled }}-${{ github.run_id }}-${{ github.run_number }} | ||
restore-keys: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.cmakeBuildType }}-${{ matrix.config.asanEnabled }}--${{ matrix.config.cudaEnabled }} | ||
path: ${{ env.COMPILER_CACHE_DIR }} | ||
|
||
- name: Install ccache | ||
shell: pwsh | ||
run: | | ||
New-Item -ItemType Directory -Force -Path "${{ env.CCACHE_DIR }}" | ||
echo "${{ env.COMPILER_CACHE_DIR }}/bin" | Out-File -Encoding utf8 -Append -FilePath $env:GITHUB_PATH | ||
if (Test-Path -PathType Leaf "${{ env.COMPILER_CACHE_DIR }}/bin/ccache.exe") { | ||
exit | ||
} | ||
.github/workflows/install-ccache.ps1 -Destination "${{ env.COMPILER_CACHE_DIR }}/bin" | ||
- name: Install CMake and Ninja | ||
uses: lukka/get-cmake@latest | ||
|
||
- name: Setup vcpkg | ||
shell: pwsh | ||
run: | | ||
./scripts/shell/enter_vs_dev_shell.ps1 | ||
cd ${{ github.workspace }} | ||
git clone https://github.com/microsoft/vcpkg | ||
cd vcpkg | ||
git reset --hard ${{ env.VCPKG_COMMIT_ID }} | ||
./bootstrap-vcpkg.bat | ||
- name: Configure and build | ||
shell: pwsh | ||
run: | | ||
./scripts/shell/enter_vs_dev_shell.ps1 | ||
cd ${{ github.workspace }} | ||
./vcpkg/vcpkg.exe integrate install | ||
mkdir build | ||
cd build | ||
cmake .. ` | ||
-GNinja ` | ||
-DCMAKE_MAKE_PROGRAM=ninja ` | ||
-DCMAKE_BUILD_TYPE=Release ` | ||
-DTESTS_ENABLED=ON ` | ||
-DCUDA_ENABLED=OFF ` | ||
-DGUI_ENABLED=OFF ` | ||
-DCGAL_ENABLED=OFF ` | ||
-DCMAKE_CUDA_ARCHITECTURES=all-major ` | ||
-DCMAKE_TOOLCHAIN_FILE="${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake" ` | ||
-DVCPKG_TARGET_TRIPLET=x64-windows-release ` | ||
-DCMAKE_INSTALL_PREFIX=install | ||
ninja | ||
- name: Run tests | ||
shell: pwsh | ||
run: | | ||
./vcpkg/vcpkg.exe integrate install | ||
cd build | ||
ctest -E .+colmap_.* --output-on-failure | ||
- name: Export package | ||
if: matrix.config.exportPackage | ||
shell: pwsh | ||
run: | | ||
./vcpkg/vcpkg.exe integrate install | ||
cd build | ||
ninja install | ||
../vcpkg/vcpkg.exe install ` | ||
--triplet=x64-windows-release | ||
../vcpkg/vcpkg.exe export --raw --output-dir vcpkg_export --output glomap | ||
cp vcpkg_export/glomap/installed/x64-windows/bin/*.dll install/bin | ||
cp vcpkg_export/glomap/installed/x64-windows-release/bin/*.dll install/bin | ||
- name: Upload package | ||
uses: actions/upload-artifact@v4 | ||
if: ${{ matrix.config.exportPackage }} | ||
with: | ||
name: glomap-x64-windows | ||
path: build/install | ||
|
||
- name: Cleanup compiler cache | ||
shell: pwsh | ||
run: | | ||
ccache --show-stats --verbose | ||
ccache --evict-older-than 1d | ||
ccache --show-stats --verbose |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
# Copyright (c) 2023, ETH Zurich and UNC Chapel Hill. | ||
# All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions are met: | ||
# | ||
# * Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# | ||
# * Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in the | ||
# documentation and/or other materials provided with the distribution. | ||
# | ||
# * Neither the name of ETH Zurich and UNC Chapel Hill nor the names of | ||
# its contributors may be used to endorse or promote products derived | ||
# from this software without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE | ||
# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
# POSSIBILITY OF SUCH DAMAGE. | ||
|
||
|
||
# Find package module for Glog library. | ||
# | ||
# The following variables are set by this module: | ||
# | ||
# GLOG_FOUND: TRUE if Glog is found. | ||
# glog::glog: Imported target to link against. | ||
# | ||
# The following variables control the behavior of this module: | ||
# | ||
# GLOG_INCLUDE_DIR_HINTS: List of additional directories in which to | ||
# search for Glog includes. | ||
# GLOG_LIBRARY_DIR_HINTS: List of additional directories in which to | ||
# search for Glog libraries. | ||
|
||
set(GLOG_INCLUDE_DIR_HINTS "" CACHE PATH "Glog include directory") | ||
set(GLOG_LIBRARY_DIR_HINTS "" CACHE PATH "Glog library directory") | ||
|
||
unset(GLOG_FOUND) | ||
|
||
find_package(glog CONFIG QUIET) | ||
if(TARGET glog::glog) | ||
set(GLOG_FOUND TRUE) | ||
message(STATUS "Found Glog") | ||
message(STATUS " Target : glog::glog") | ||
else() | ||
# Older versions of glog don't come with a find_package config. | ||
# Fall back to custom logic to find the library and remap to imported target. | ||
|
||
include(FindPackageHandleStandardArgs) | ||
|
||
list(APPEND GLOG_CHECK_INCLUDE_DIRS | ||
/usr/local/include | ||
/usr/local/homebrew/include | ||
/opt/local/var/macports/software | ||
/opt/local/include | ||
/usr/include) | ||
list(APPEND GLOG_CHECK_PATH_SUFFIXES | ||
glog/include | ||
glog/Include | ||
Glog/include | ||
Glog/Include | ||
src/windows) | ||
|
||
list(APPEND GLOG_CHECK_LIBRARY_DIRS | ||
/usr/local/lib | ||
/usr/local/homebrew/lib | ||
/opt/local/lib | ||
/usr/lib) | ||
list(APPEND GLOG_CHECK_LIBRARY_SUFFIXES | ||
glog/lib | ||
glog/Lib | ||
Glog/lib | ||
Glog/Lib | ||
x64/Release) | ||
|
||
find_path(GLOG_INCLUDE_DIRS | ||
NAMES | ||
glog/logging.h | ||
PATHS | ||
${GLOG_INCLUDE_DIR_HINTS} | ||
${GLOG_CHECK_INCLUDE_DIRS} | ||
PATH_SUFFIXES | ||
${GLOG_CHECK_PATH_SUFFIXES}) | ||
find_library(GLOG_LIBRARIES | ||
NAMES | ||
glog | ||
libglog | ||
PATHS | ||
${GLOG_LIBRARY_DIR_HINTS} | ||
${GLOG_CHECK_LIBRARY_DIRS} | ||
PATH_SUFFIXES | ||
${GLOG_CHECK_LIBRARY_SUFFIXES}) | ||
|
||
if(GLOG_INCLUDE_DIRS AND GLOG_LIBRARIES) | ||
set(GLOG_FOUND TRUE) | ||
message(STATUS "Found Glog") | ||
message(STATUS " Includes : ${GLOG_INCLUDE_DIRS}") | ||
message(STATUS " Libraries : ${GLOG_LIBRARIES}") | ||
endif() | ||
|
||
add_library(glog::glog INTERFACE IMPORTED) | ||
target_include_directories(glog::glog INTERFACE ${GLOG_INCLUDE_DIRS}) | ||
target_link_libraries(glog::glog INTERFACE ${GLOG_LIBRARIES}) | ||
endif() | ||
|
||
if(NOT GLOG_FOUND AND GLOG_FIND_REQUIRED) | ||
message(FATAL_ERROR "Could not find Glog") | ||
endif() |
Oops, something went wrong.