Skip to content

Commit e423969

Browse files
Merge branch 'develop' into dev/fix-misc-memory-issues
2 parents 40375f0 + a9d7da7 commit e423969

313 files changed

Lines changed: 22526 additions & 1850 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/build-linux.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,17 @@ jobs:
1818
steps:
1919
- uses: actions/checkout@v1
2020

21+
- name: Setup ccache
22+
uses: hendrikmuhs/ccache-action@v1.2
23+
with:
24+
# Isolate writes per ref (branch/PR) to reduce cross-PR cache contamination.
25+
key: ccache-${{ runner.os }}-rocky9-cuda12.1.1-${{ github.ref_name }}-${{ hashFiles('CMakeLists.txt', 'src/CMakeLists.txt', 'vcpkg.json', 'vcpkg-configuration.json', '.github/workflows/build-linux.yml') }}
26+
restore-keys: |
27+
ccache-${{ runner.os }}-rocky9-cuda12.1.1-${{ github.ref_name }}-
28+
ccache-${{ runner.os }}-rocky9-cuda12.1.1-develop-
29+
ccache-${{ runner.os }}-
30+
max-size: "1000M"
31+
2132
- name: Prepare File Tree
2233
run: |
2334
mkdir ./build
@@ -29,6 +40,9 @@ jobs:
2940
working-directory: ./build
3041
run: |
3142
cmake .. \
43+
-G Ninja \
44+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
45+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
3246
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
3347
-DBUILD_SHARED_LIBS=ON \
3448
-DCMAKE_PREFIX_PATH="${DEPS_INSTALL_DIR}" \
@@ -52,26 +66,26 @@ jobs:
5266
- name: Build
5367
working-directory: ./build
5468
run: |
55-
make -j$(nproc)
69+
cmake --build . -j$(nproc)
5670
5771
- name: Install
5872
working-directory: ./build
5973
run: |
60-
make install
74+
cmake --install .
6175
6276
- name: Unit Tests
6377
working-directory: ./build
6478
run: |
6579
export LD_LIBRARY_PATH=${ALICEVISION_ROOT}/lib:${ALICEVISION_ROOT}/lib64:${DEPS_INSTALL_DIR}/lib64:${DEPS_INSTALL_DIR}/lib:${LD_LIBRARY_PATH}
66-
make test
80+
cmake --build . --target test
6781
6882
- name: Build As Third Party
6983
working-directory: ./build_as_3rdparty
7084
run: |
7185
cmake ../src/software/utils/aliceVisionAs3rdParty \
7286
-DBUILD_SHARED_LIBS:BOOL=ON \
7387
-DCMAKE_PREFIX_PATH:PATH="$PWD/../../AV_install;${DEPS_INSTALL_DIR}"
74-
make -j$(nproc)
88+
cmake --build . -j$(nproc)
7589
7690
- name: Functional Tests - PanoramaFisheyeHdr Pipeline
7791
working-directory: ./functional_tests
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Build Linux
2+
3+
on:
4+
workflow_call:
5+
6+
jobs:
7+
build-linux:
8+
runs-on: ubuntu-latest
9+
container:
10+
image: "alicevision/alicevision-deps:2026.03.30-rocky9-cuda12.1.1"
11+
env:
12+
DEPS_INSTALL_DIR: /opt/AliceVision_install
13+
BUILD_TYPE: Release
14+
CTEST_OUTPUT_ON_FAILURE: 1
15+
ALICEVISION_ROOT: ${{ github.workspace }}/../AV_install
16+
ALICEVISION_SENSOR_DB: ${{ github.workspace }}/../AV_install/share/aliceVision/cameraSensors.db
17+
ALICEVISION_LENS_PROFILE_INFO: ""
18+
steps:
19+
- uses: actions/checkout@v1
20+
21+
- name: Setup ccache
22+
uses: hendrikmuhs/ccache-action@v1.2
23+
with:
24+
# Isolate writes per ref (branch/PR) to reduce cross-PR cache contamination.
25+
key: ccache-${{ runner.os }}-sonarqube-${{ github.ref_name }}-${{ hashFiles('CMakeLists.txt', 'src/CMakeLists.txt', 'vcpkg.json', 'vcpkg-configuration.json', '.github/workflows/build-linux.yml') }}
26+
restore-keys: |
27+
ccache-${{ runner.os }}-sonarqube-${{ github.ref_name }}-
28+
ccache-${{ runner.os }}-sonarqube-develop-
29+
ccache-${{ runner.os }}-
30+
max-size: "1000M"
31+
32+
- name: Install Build Wrapper
33+
uses: SonarSource/sonarqube-scan-action/install-build-wrapper@v7.1
34+
35+
- name: Prepare File Tree
36+
run: |
37+
mkdir ./build
38+
mkdir ../AV_install
39+
mkdir -p ${{ github.workspace }}/bw-output
40+
mkdir -p ${{ github.workspace }}/analysisCache
41+
42+
- name: Cache SonarCloud CFamily (incremental analysis)
43+
uses: actions/cache@v4
44+
with:
45+
path: /root/.sonar/cache
46+
key: ${{ runner.os }}-cfamily-${{ hashFiles('src/**/*.cpp', 'src/**/*.hpp', '**/CMakeLists.txt') }}
47+
restore-keys: ${{ runner.os }}-cfamily-
48+
49+
- name: Configure CMake
50+
working-directory: ./build
51+
run: |
52+
cmake .. \
53+
-G Ninja \
54+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
55+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
56+
-DCMAKE_BUILD_TYPE=${BUILD_TYPE} \
57+
-DBUILD_SHARED_LIBS=ON \
58+
-DCMAKE_PREFIX_PATH="${DEPS_INSTALL_DIR}" \
59+
-DCMAKE_INSTALL_PREFIX="${ALICEVISION_ROOT}" \
60+
-DTARGET_ARCHITECTURE=core \
61+
-DALICEVISION_BUILD_TESTS=OFF \
62+
-DALICEVISION_BUILD_SWIG_BINDING=OFF \
63+
-DALICEVISION_USE_OPENCV=ON \
64+
-DALICEVISION_USE_CUDA=OFF \
65+
-DALICEVISION_USE_CCTAG=OFF \
66+
-DALICEVISION_USE_POPSIFT=OFF \
67+
-DALICEVISION_USE_ALEMBIC=ON \
68+
-DALICEVISION_USE_USD=ON \
69+
-DOpenCV_DIR="${DEPS_INSTALL_DIR}/share/OpenCV" \
70+
-DCeres_DIR="${DEPS_INSTALL_DIR}/share/Ceres" \
71+
-DAlembic_DIR="${DEPS_INSTALL_DIR}/lib/cmake/Alembic"
72+
73+
- name: Build
74+
working-directory: ./build
75+
run: |
76+
build-wrapper-linux-x86-64 --out-dir ${{ github.workspace }}/bw-output cmake --build . -j$(nproc)
77+
78+
- name: SonarQube Scan
79+
uses: SonarSource/sonarqube-scan-action@v7.1
80+
env:
81+
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
82+
with:
83+
args: >
84+
--define sonar.cfamily.compile-commands=${{ github.workspace }}/bw-output/compile_commands.json

.github/workflows/continuous-integration.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ jobs:
2626
build-windows:
2727
uses: ./.github/workflows/build-windows.yml
2828
secrets: inherit
29+
30+
build-sonarqube:
31+
uses: ./.github/workflows/build-sonarqube.yml
32+
secrets: inherit

CMakeLists.txt

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,31 @@
11
cmake_minimum_required(VERSION 3.30)
22
project(aliceVision LANGUAGES C CXX)
33

4+
include(CMakeDependentOption)
5+
6+
# Initialize CMAKE_OSX_ARCHITECTURES, if not specified on the command line.
7+
if(APPLE AND NOT CMAKE_OSX_ARCHITECTURES)
8+
message(STATUS "Host processor: ${CMAKE_HOST_SYSTEM_PROCESSOR}")
9+
if(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
10+
set(CMAKE_OSX_ARCHITECTURES "arm64")
11+
elseif(CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "x86_64")
12+
set(CMAKE_OSX_ARCHITECTURES "x86_64")
13+
else()
14+
message(FATAL_ERROR "CMAKE_HOST_SYSTEM_PROCESSOR was neither arm64 nor x86_64 on an Apple platform and CMAKE_OSX_ARCHITECTURES was not specified!")
15+
endif()
16+
endif()
17+
418
option(ALICEVISION_BUILD_DEPENDENCIES "Build all AliceVision dependencies" OFF)
19+
option(ALICEVISION_USE_RPATH "Add RPATH on software with relative paths to libraries" ON)
520
option(AV_BUILD_ALICEVISION "Enable building of AliceVision" ON)
621
option(AV_EIGEN_MEMORY_ALIGNMENT "Enable Eigen memory alignment" ON)
722
option(ALICEVISION_BUILD_TESTS "Build AliceVision tests" OFF)
8-
option(AV_USE_CUDA "Enable CUDA" ON)
9-
option(AV_USE_OPENMP "Enable OpenMP" $<$<CXX_COMPILER_ID:"AppleClang">,OFF,ON>) # disable by default for AppleClang
23+
option(AV_USE_OPENMP "Enable OpenMP" ON) # AppleClang now supports OpenMP, if installed as an external dependency (Homebrew, MacPorts, ...)
24+
cmake_dependent_option(AV_USE_CUDA "Enable CUDA support" ON "NOT APPLE" OFF)
1025
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
26+
if(APPLE AND BUILD_SHARED_LIBS)
27+
option(BUILD_APPLE_FRAMEWORKS "Create Frameworks instead of plain dynamic libraries on macOS" ON)
28+
endif()
1129
option(ALICEVISION_INSTALL_MESHROOM_PLUGIN "Install AliceVision's plugin for Meshroom" ON)
1230

1331
# Global policy section
@@ -17,6 +35,12 @@ if (NOT CMAKE_BUILD_TYPE)
1735
set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type for AliceVision" FORCE)
1836
endif()
1937

38+
# Currently no universal binaries are supported. Fail early.
39+
# FIXME: Enable universal builds by adapting dependency building accordingly.
40+
if(APPLE AND CMAKE_OSX_ARCHITECTURES MATCHES "arm64" AND CMAKE_OSX_ARCHITECTURES MATCHES "x86_64")
41+
message(FATAL_ERROR "Building universal binaries is currently not supported. Please set 'CMAKE_OSX_ARCHITECTURES' to either arm64 (Apple Silicon) or x86_64 (Intel)!")
42+
endif()
43+
2044
# set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type for AliceVision")
2145
set(DEPS_CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type for all external libraries (only used if ALICEVISION_BUILD_DEPENDENCIES=ON)")
2246
string(TOLOWER ${DEPS_CMAKE_BUILD_TYPE} DEPS_CMAKE_BUILD_TYPE_LOWERCASE)
@@ -78,10 +102,10 @@ else()
78102
add_subdirectory(src)
79103

80104
install(
81-
FILES
82-
LICENSE-MPL2.md
83-
LICENSE-MIT-libmv.md
84-
COPYING.md
105+
FILES
106+
LICENSE-MPL2.md
107+
LICENSE-MIT-libmv.md
108+
COPYING.md
85109
CONTRIBUTORS.md
86110
DESTINATION ${CMAKE_INSTALL_DATADIR}/aliceVision
87111
)

INSTALL.md

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# AliceVision
22

3+
For specific build instructions for macOS see [INSTALL_macOS.md](./INSTALL_macOS.md).
4+
35
## Build instructions
46

57
Required tools:
6-
* CMake >= 3.11
8+
* CMake >= 3.30
79
* Git
810
* C/C++ compiler (gcc or Visual Studio or clang) with C++17 support (i.e. gcc >= 7, clang >= 5, msvc >= 19.15, cuda >= 11.0).
911

@@ -357,25 +359,6 @@ make test
357359
* Change the target to Release.
358360
* Compile the libraries and binaries samples.
359361
360-
361-
### Mac OSX compilation
362-
363-
```bash
364-
git clone --recursive https://github.com/alicevision/AliceVision.git
365-
mkdir build && cd build
366-
cmake -DCMAKE_BUILD_TYPE=Release -G "Xcode" ../AliceVision
367-
```
368-
369-
If you want to enable the build of the unit tests:
370-
```bash
371-
cmake -DCMAKE_BUILD_TYPE=Release \
372-
-DALICEVISION_BUILD_TESTS=ON \
373-
-G "Xcode" \
374-
../AliceVision
375-
xcodebuild -configuration Release
376-
```
377-
378-
379362
## Using AliceVision as a third party library dependency in CMake
380363
381364
AliceVision can be used as a third party library once it has been installed.

0 commit comments

Comments
 (0)