Installation des dépendances d'AliceVision
AliceVision requiert plusieurs bibliothèques et outils spécifiques. Voici les étapes pour les installer sur Ubuntu 16.04.
Mise à jour de CMake
La version de CMake fournie par défaut (3.5) est trop ancienne. Une mise à jour vers la version 3.16 est nécessaire.
# Suppression de l'ancienne version
sudo apt-get remove cmake
cd /usr/src
# Téléchargement et compilation de CMake 3.16
wget https://github.com/Kitware/CMake/releases/download/v3.16.0/cmake-3.16.0.tar.gz
tar -zxvf cmake-3.16.0.tar.gz
cd cmake-3.16.0
apt install libssl-dev build-essential
./bootstrap && make && sudo make install
Installation d'OpenEXR 2.5.3
AliceVision requiert spécifiquement la version 2.5.3 de la bibliothèque OpenEXR.
wget -c https://github.com/AcademySoftwareFoundation/openexr/archive/v2.5.3.zip
unzip -q v2.5.3.zip
cd openexr-2.5.3 && mkdir build && cd build
cmake -LAH .. && make -j$(nproc) && sudo make install
Installation de Boost 1.74
wget -c https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.gz
tar -zxvf boost_1_74_0.tar.gz
cd boost_1_74_0
./bootstrap.sh
sudo ./b2 install
Isntallation d'OpenImageIO
La compilation se fait sans liaison Python.
git clone --depth 1 https://github.com/OpenImageIO/oiio.git
cd oiio && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release -DSTOP_ON_WARNING=0 -DUSE_PYTHON=0 ..
make -j$(nproc) && sudo make install && make clean
Instalation d'Eigen 3.3.7
wget -c https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.zip
unzip -q eigen-3.3.7.zip
cd eigen-3.3.7 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
sudo make install
sudo cp -r /usr/local/include/eigen3 /usr/include
Installation de Ceres Solver 1.14.0
Prérequis système :
sudo apt-get install libatlas-base-dev libgoogle-glog-dev libgflags-dev libsuitesparse-dev
Compilation de Ceres :
wget -c https://github.com/ceres-solver/ceres-solver/archive/1.14.0.zip
unzip -q 1.14.0.zip
cd ceres-solver-1.14.0 && mkdir build && cd build
cmake .. && make -j$(nproc) && sudo make install && make clean
Installatino de Geogram 1.7.5
wget -c https://gforge.inria.fr/frs/download.php/file/38315/geogram_1.7.5.zip
sh -f configure.sh
cd build/Linux64-gcc-dynamic-Release
make -j$(nproc)
sudo make install
Installation d'OpenGV
git clone --depth 1 https://github.com/alicevision/opengv.git --branch=cmake_fix_install
cd opengv && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release .. && make -j$(nproc)
sudo make install
Installation d'OpenCV 4.1.0 avec contrib
Installation des dépendances système :
sudo apt -y remove x264 libx264-dev
sudo apt -y install build-essential checkinstall cmake pkg-config yasm git gfortran
sudo apt -y install libjpeg8-dev libjasper-dev libpng12-dev libtiff5-dev libtiff-dev
sudo apt -y install libavcodec-dev libavformat-dev libswscale-dev libdc1394-22-dev
sudo apt -y install libxine2-dev libv4l-dev
cd /usr/include/linux && sudo ln -s -f ../libv4l1-videodev.h videodev.h
sudo apt -y install libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev
sudo apt -y install libgtk2.0-dev libtbb-dev qt5-default
sudo apt -y install libatlas-base-dev libfaac-dev libmp3lame-dev libtheora-dev
sudo apt -y install libvorbis-dev libxvidcore-dev libopencore-amrnb-dev libopencore-amrwb-dev
sudo apt -y install libavresample-dev x264 v4l-utils
sudo apt -y install libprotobuf-dev protobuf-compiler libgoogle-glog-dev libgflags-dev
sudo apt -y install libgphoto2-dev libeigen3-dev libhdf5-dev doxygen
Téléchargement et compilation d'OpenCV 4.1.0 :
mkdir opencv_build && cd opencv_build
wget -c https://github.com/opencv/opencv/archive/4.1.0.tar.gz -O opencv.tar.gz
wget -c https://github.com/opencv/opencv_contrib/archive/4.1.0.tar.gz -O contrib.tar.gz
tar -xf opencv.tar.gz && tar -xf contrib.tar.gz
mkdir build && cd build
# Configuration et compilation
cmake -DCMAKE_BUILD_TYPE=RELEASE \
-DWITH_TBB=ON -DWITH_V4L=ON -DWITH_QT=ON -DWITH_OPENGL=ON \
-DOPENCV_EXTRA_MODULES_PATH=../../opencv_contrib-4.1.0/modules \
-DWITH_CUDA=ON -DBUILD_opencv_cudacodec=OFF \
-DENABLE_FAST_MATH=1 -DCUDA_FAST_MATH=1 -DWITH_CUBLAS=1 \
-DBUILD_EXAMPLES=OFF \
../../opencv-4.1.0
make -j$(nproc)
sudo make install && make clean
Compilation et installation d'AliceVision
git clone https://github.com/alicevision/AliceVision.git --recursive
cd AliceVision && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j$(nproc)
Installation et configuration de Meshroom
Environnement Python
Meshroom nécessite Python 3.5 ou supérieur. Utilisation de Conda pour l'environnement :
conda create -n meshroom python=3.6
conda activate meshroom
pip install -U pip
pip install -r requirements.txt -r dev_requirements.txt
Composants Qt
Installation de Qt 5.13.2
Téléchargez l'installateur depuis un miroir et lancez-le :
chmod +x qt-opensource-linux-x64-5.13.2.run
sudo ./qt-opensource-linux-x64-5.13.2.run
L'installation se trouve généralement dans /opt/qt.
Installation de QmlAlembic
Prérequis : la bibliothèque Alembic.
git clone --depth 1 https://github.com/alembic/alembic
cd alembic && mkdir build && cd build
cmake .. && make -j$(nproc)
sudo make install
Ensuite, compilez le plugin QmlAlembic en pointant vers votre installation Qt :
export QT_DIR=/opt/qt/5.13.2/gcc_64
cd ../.. # Retour au dossier parent de alembic si nécessaire
git clone https://github.com/alicevision/QmlAlembic.git
cd QmlAlembic && mkdir build && cd build
cmake .. -DCMAKE_PREFIX_PATH=$QT_DIR -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
sudo make install
Le plugin est installé dans /usr/local/qml.
Plugins QtOIIO et QtAliceVision
La compilation et l'installation de ces plugins suivent un processus similaire, en configurant le chemin vers Qt et les dépendances AliceVision. Les instructions détaillées se trouvent dans leurs dépôts respectifs.