![]() |
AliceVision
Photogrammetric Computer Vision Framework
|
For specific build instructions for macOS see INSTALL_macOS.md.
Required tools:
Getting the sources:
AliceVision depends on external libraries:
Other optional libraries can enable specific features (check "CMake Options" for enabling them):
AliceVision also depends on some embedded libraries:
vcpkg is a package manager that helps in acquiring, building, and managing C/C++ libraries. AliceVision's required dependencies can be built with it. vcpkg evolved from being a Windows-only project to becoming cross-platform. In the scope of AliceVision, vcpkg has only been tested on Windows.
Install vcpkg
See the reference installation guide to setup vcpkg. We recommend to use our vcpkg fork, where dependencies have been validated by the AliceVision development team and where some ports may have custom changes. ```bash git clone https://github.com/alicevision/vcpkg –branch alicevision_master cd vcpkg .\bootstrap-vcpkg.bat set VCPKG_ROOT=cd% ```
Build/install the required dependencies
There are two options for the dependencies:
Install them from a ready-to-use precompiled archive.
This will save all the compilation time as well as some disk space as there will not be any build artifact, but this requires to use the same CUDA version as the one that was used to generate the archive to be able to build AliceVision later on.
The archive can be downloaded from our vcpkg fork's release page, with the latest released archive built with CUDA 12.5.0.
It should be unzipped in <VCPKG_INSTALL_DIRECTORY>.
Build AliceVision ```bash cd <ALICEVISION_DIRECTORY> mkdir build && cd build
cmake -B . -S .. -DCMAKE_TOOLCHAIN_FILE=\path\to\dependencies\x64-windows-release\scripts\buildsystems\vcpkg.cmake ^ -DVCPKG_TARGET_TRIPLET=x64-windows-release ^ -DCMAKE_BUILD_TYPE=Release -A x64 -T host=x64 ^ -DBUILD_SHARED_LIBS=ON ^ -DTARGET_ARCHITECTURE=core ^ -DCMAKE_INSTALL_PREFIX=\path\to\install ^ -DALICEVISION_BUILD_SWIG_BINDING=ON ^ -DVCPKG_MANIFEST_MODE=OFF ^ -DPython3_EXECUTABLE=\path\to\python\python.exe ```
This generates an "aliceVision.sln" solution inside the build folder that you can open in Visual Studio to launch the build. Do not forget to switch the build type to "Release". If you want to continue without an IDE, then use:
```bash cmake –build build –config Release -t INSTALL cmake –build build –config Release -t BUNDLE ```
autoreconf, libtool and nasm to compile libturbo-jpeg. Else if you have jpeg already install on your OS, you can disable the JPEG build with -DAV_BUILD_JPEG=OFF.automake to compile libpng. Else if you have png already install on your OS, you can disable the PNG build with -DAV_BUILD_PNG=OFF.In order to build the library with existing versions of the dependencies (e.g. system-installed libraries or user-built libraries), and thus reduce the compilation time and favour the modularization, the paths where to find such libraries can be given at cmake command line. In particular:
Ceres_DIR can be passed pointing to where CeresConfig.cmake can be found. e.g. -DCeres_DIR:PATH=/path/to/ceres/install/share/Ceres/FLANN_INCLUDE_DIR_HINTS can be passed pointing to the include directory, e.g. -DFLANN_INCLUDE_DIR_HINTS:PATH=/path/to/flann/1.8.4/include/For Eigen library, CMAKE_MODULE_PATH should be passed pointing at the <EigenInstallDir>/share/cmake/Modules/ directory of the Eigen installation, in which Eigen-config.cmake or FindEigen3.cmake can be found. In case only FindEigen3.cmake is available (e.g. Homebrew installations), an environment variable EIGEN_ROOT_DIR must be set pointing at Eigen install directory. For example,
-DCMAKE_MODULE_PATH:PATH=/usr/local/Cellar/eigen/3.3.4/share/cmake/Modules/
may require to set the environment variable if only FindEigen3.cmake, i.e.
export EIGEN_ROOT_DIR=/usr/local/Cellar/eigen/3.3.4/
OPENEXR_HOME can be passed pointing to the install directory, e.g. -DOPENEXR_HOME:PATH=/path/to/openexr/install-DOPENIMAGEIO_LIBRARY_DIR_HINTS:PATH=/path/to/oiio/install/lib/ and -DOPENIMAGEIO_INCLUDE_DIR:PATH=/path/to/oiio/install/include/At the end of the cmake process, a report shows for each library which version (internal/external) will be used in the building process, e.g.:
-DGEOGRAM_INSTALL_PREFIX:PATH=path/to/geogram/install-DOPENIMAGEIO_LIBRARY_DIR_HINTS:PATH=/path/to/oiio/install/lib/ -DOPENIMAGEIO_INCLUDE_DIR:PATH=/path/to/oiio/install/include/BOOST_NO_CXX11 (default OFF) ALICEVISION_USE_OPENMP (default ON) -DALICEVISION_USE_OPENMP:BOOL=OFF.ALICEVISION_USE_CCTAG (default: AUTO) -DCCTag_DIR:PATH=/path/to/cctag/install/lib/cmake/CCTag (where CCTagConfig.cmake can be found)ALICEVISION_USE_APRILTAG (default: AUTO) -Dapriltag_DIR:PATH=/path/to/apriltag/install/share/apriltag/cmake (where apriltagConfig.cmake can be found)ALICEVISION_USE_ALEMBIC (default AUTO) -DAlembic_DIR:PATH=/path/to/alembic/install/lib/cmake/Alembic/ (where AlembicConfig.cmake can be found) ALEMBIC_ROOT, ALEMBIC_HDF5_ROOT, ALEMBIC_ILMBASE_ROOT, ALEMBIC_OPENEXR_ROOT.ALICEVISION_USE_CUDA (default: ON) -DCUDA_TOOLKIT_ROOT_DIR:PATH=/usr/local/cuda-9.1 (adjust the path to your CUDA installation)ALICEVISION_USE_POPSIFT (default: AUTO) -DPopSift_DIR:PATH=/path/to/popsift/install/lib/cmake/PopSift (where PopSiftConfig.cmake can be found)ALICEVISION_USE_UNCERTAINTYTE (default: AUTO) -DUNCERTAINTYTE_DIR:PATH=/path/to/uncertaintyTE/install/ (where the include and lib folders can be found) -DMAGMA_ROOT:PATH=/path/to/magma/install/ (where the include and lib folders can be found)ALICEVISION_USE_OPENCV (default: OFF) -DOpenCV_DIR:PATH=/path/to/opencv/install/share/OpenCV/ (where OpenCVConfig.cmake can be found)ALICEVISION_USE_ONNX_GPU (default: ON) OFF.ALICEVISION_REQUIRE_CERES_WITH_SUITESPARSE (default: ON) BUILD_SHARED_LIBS (default ON) ALICEVISION_BUILD_SOFTWARE (default ON) ALICEVISION_BUILD_TESTS (default OFF) ALICEVISION_BUILD_DOC (default AUTO) ALICEVISION_BUILD_COVERAGE (default OFF) ALICEVISION_BUILD_SWIG_BINDING (default OFF) ALICEVISION_INSTALL_MESHROOM_PLUGIN (default ON) ALICEVISION_BUILD_SFM (default ON) OFF, all the following options will be disabled: ALICEVISION_BUILD_MVS, ALICEVISION_BUILD_HDR, ALICEVISION_BUILD_SEGMENTATION, ALICEVISION_BUILD_PHOTOMETRICSTEREO, ALICEVISION_BUILD_PANORAMA, ALICEVISION_BUILD_LIDAR.ALICEVISION_BUILD_MVS (default ON) ALICEVISION_BUILD_HDR (default ON) ALICEVISION_BUILD_SEGMENTATION (default ON) ALICEVISION_BUILD_PHOTOMETRICSTEREO (default ON) ALICEVISION_BUILD_PANORAMA (default ON) ALICEVISION_BUILD_LIDAR (default AUTO) sudo apt-get install libpng-dev libjpeg-dev libtiff-dev libxxf86vm1 libxxf86vm-dev libxi-dev libxrandr-devsudo apt-get install graphvizIf you want to enable the build of the unit tests:
In order to use the MOSEK 6 back-end for the linear programming aliceVision module:
If you want to have an IDE openable project with codeblocks:
For a multi-core compilation (replace NBcore with the number of threads):
Launch the unit tests (if built during the compilation step):
git clone --recursive https://github.com/alicevision/aliceVision.git.AliceVision can be used as a third party library once it has been installed. Consider using the CMAKE_INSTALL_PREFIX cmake variable to specify a local installation directory. Here the syntax to add the variable to the cmake command line (use absolute path), e.g.:
Perform make and make install
Then you will be able to use AliceVision as an external library in your CMakeLists.txt using the modern CMake approach as imported target. For example, if your target main depends on the AliceVision module aliceVision_sfmDataIO:
In general, you need to specify the list of the AliceVision modules that your library or executable depends on.
Specify to CMake where AliceVision is installed by using the AliceVision_DIR cmake variable: -DAliceVision_DIR:PATH="YourInstallPath"/share/aliceVision/cmake or by simply adding the installation path to your CMAKE_PREFIX_PATH, i.e. -DCMAKE_PREFIX_PATH:PATH="YourInstallPath". Check the sample in samples for an example of use.
A docker image can be built using the Ubuntu or Rocky Linux Dockerfiles. The Dockerfiles are based on nvidia/cuda images (https://hub.docker.com/r/nvidia/cuda/).
To generate the Docker image, just run:
or
To do it manually, parameters ROCKY_VERSION/UBUNTU_VERSION and CUDA_TAG should be passed to choose the OS and CUDA versions. For example, the first line of the commands below shows the example to build a Docker for a Rocky 9 with Cuda 12.1.0, while the second line is for Ubuntu 22.04 with Cuda 12.1.0:
In order to run the image, nvidia docker is needed.
To retrieve the generated files:
You must set the ALICEVISION_ROOT environment variable to point to your installation directory, regardless of how you installed it.
AliceVision provides nodes and templates meant to be used with Meshroom.
To install the plugin, build AliceVision with ALICEVISION_INSTALL_MESHROOM_PLUGIN=ON (enabled by default) and set the MESHROOM_NODES_PATH and MESHROOM_PIPELINE_TEMPLATES_PATH environment variables for Meshroom to detect it.
To use AliceVision in Meshroom to the best of its abilities, we recommend building with the following flags:
ALICEVISION_USE_OPENCV=ONALICEVISION_BUILD_SWIG_BINDING=ONALICEVISION_USE_POPSIFT=ONALICEVISION_USE_CCTAG=ONALICEVISION_INSTALL_MESHROOM_PLUGIN=ONMeshroom relies on specific files provided by AliceVision:
Environment variables need to be set for Meshroom to find those files:
If these variables are not set, Meshroom will expect those files to be located in {ALICEVISION_ROOT}/share/aliceVision.
1.8.17