Skip to content

Commit 55e40b1

Browse files
authored
Use colmap thread pool to simplify mac installation (#107)
* Use colmap thread pool to simplify mac installation * d * d * d * d
1 parent 11387c7 commit 55e40b1

File tree

10 files changed

+198
-296
lines changed

10 files changed

+198
-296
lines changed

.github/workflows/mac.yml

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Mac
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
types: [ assigned, opened, synchronize, reopened ]
9+
release:
10+
types: [ published, edited ]
11+
12+
jobs:
13+
build:
14+
name: ${{ matrix.config.os }} ${{ matrix.config.arch }} ${{ matrix.config.cmakeBuildType }}
15+
runs-on: ${{ matrix.config.os }}
16+
strategy:
17+
matrix:
18+
config: [
19+
{
20+
os: macos-14,
21+
arch: arm64,
22+
cmakeBuildType: Release,
23+
},
24+
]
25+
26+
env:
27+
COMPILER_CACHE_VERSION: 1
28+
COMPILER_CACHE_DIR: ${{ github.workspace }}/compiler-cache
29+
CCACHE_DIR: ${{ github.workspace }}/compiler-cache/ccache
30+
CCACHE_BASEDIR: ${{ github.workspace }}
31+
32+
steps:
33+
- uses: actions/checkout@v4
34+
- uses: actions/cache@v4
35+
id: cache-builds
36+
with:
37+
key: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.cmakeBuildType }}-${{ github.run_id }}-${{ github.run_number }}
38+
restore-keys: v${{ env.COMPILER_CACHE_VERSION }}-${{ matrix.config.os }}-${{ matrix.config.arch }}-${{ matrix.config.cmakeBuildType }}
39+
path: ${{ env.COMPILER_CACHE_DIR }}
40+
41+
- name: Setup Mac
42+
run: |
43+
brew install \
44+
cmake \
45+
ninja \
46+
boost \
47+
eigen \
48+
flann \
49+
freeimage \
50+
metis \
51+
glog \
52+
googletest \
53+
ceres-solver \
54+
qt5 \
55+
glew \
56+
cgal \
57+
sqlite3 \
58+
ccache
59+
60+
- name: Configure and build
61+
run: |
62+
cmake --version
63+
mkdir build
64+
cd build
65+
cmake .. \
66+
-GNinja \
67+
-DCMAKE_BUILD_TYPE=${{ matrix.config.cmakeBuildType }} \
68+
-DTESTS_ENABLED=ON \
69+
-DCMAKE_PREFIX_PATH="$(brew --prefix qt@5)"
70+
ninja
71+
72+
- name: Run tests
73+
run: |
74+
cd build
75+
set +e
76+
ctest --output-on-failure -E .+colmap_.*
77+
78+
- name: Cleanup compiler cache
79+
run: |
80+
set -x
81+
ccache --show-stats --verbose
82+
ccache --evict-older-than 1d
83+
ccache --show-stats --verbose

.github/workflows/ubuntu.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,4 +185,4 @@ jobs:
185185
# Delete cache older than 10 days.
186186
find "$CTCACHE_DIR"/*/ -mtime +10 -print0 | xargs -0 rm -rf
187187
echo "Size of ctcache after: $(du -sh $CTCACHE_DIR)"
188-
echo "Number of ctcache files after: $(find $CTCACHE_DIR | wc -l)"
188+
echo "Number of ctcache files after: $(find $CTCACHE_DIR | wc -l)"''

.gitignore

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1-
build
2-
data
1+
/build
2+
/data
3+
/.vscode

CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
77

88
set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES ON)
99

10-
option(OPENMP_ENABLED "Whether to enable OpenMP parallelization" ON)
1110
option(TESTS_ENABLED "Whether to build test binaries" OFF)
1211
option(ASAN_ENABLED "Whether to enable AddressSanitizer flags" OFF)
1312
option(CCACHE_ENABLED "Whether to enable compiler caching, if available" ON)

cmake/FindDependencies.cmake

-5
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,6 @@ if(TESTS_ENABLED)
1919
find_package(GTest REQUIRED)
2020
endif()
2121

22-
if (OPENMP_ENABLED)
23-
message(STATUS "Enabling OpenMP")
24-
find_package(OpenMP REQUIRED)
25-
endif()
26-
2722
include(FetchContent)
2823
FetchContent_Declare(PoseLib
2924
GIT_REPOSITORY https://github.com/PoseLib/PoseLib.git

docs/INSTALL_MAC.md

-193
This file was deleted.

glomap/CMakeLists.txt

-4
Original file line numberDiff line numberDiff line change
@@ -84,10 +84,6 @@ target_link_libraries(
8484
)
8585
target_include_directories(glomap PUBLIC ..)
8686

87-
if(OPENMP_FOUND)
88-
target_link_libraries(glomap PUBLIC OpenMP::OpenMP_CXX)
89-
endif()
90-
9187
if(MSVC)
9288
target_compile_options(glomap PRIVATE /bigobj)
9389
else()

0 commit comments

Comments
 (0)