This is a short tutorial for compiling COLMAP on Leonhard with GCC 6.3.0. Qt installation is quite large so COLMAP cannot be compiled in the home directories.
Create a file called colmap_startup.sh
in your home directory containing the following:
export DATA=/cluster/project/infk/cvg/$USER
# COLMAP
module load gcc/6.3.0
module load cmake/3.4.3
module load boost eigen glog gflags glew
module load cgal openblas suite-sparse atlas
module load mpfr
module load mesa/12.0.3 mesa-glu
module load libxcb
module load cuda/10.0.130
export FREEIMAGE_DIR=/cluster/project/infk/cvg/$USER/dev/FreeImage/Dist
export Qt5_DIR=/cluster/project/infk/cvg/$USER/dev/qt5-build/qtbase/lib/cmake/Qt5
export COLMAP_PATH=/cluster/project/infk/cvg/$USER/dev/colmap/build/src/exe
Navigate to the project storage and create a folder for development:
source colmap_startup.sh
cd $DATA
mkdir dev
cd dev
This part is adapted from the official tutorial.
git clone git://code.qt.io/qt/qt5.git
cd qt5
git checkout 5.9.8
perl init-repository --module-subset=qtbase
cd ..
mkdir qt5-build
cd qt5-build
../qt5/configure -developer-build -opensource -nomake examples -nomake tests
bsub -I -n 8 -R "rusage[mem=4096]" "make -j 8"
# Check that the compilation finished successfully.
cd ..
wget "http://ceres-solver.org/ceres-solver-1.14.0.tar.gz"
tar xvzf ceres-solver-1.14.0.tar.gz
rm ceres-solver-1.14.0.tar.gz
cd ceres-solver-1.14.0
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_EXAMPLES=Off -DEXPORT_BUILD_DIR=On ..
bsub -I -n 8 -R "rusage[mem=4096]" "make -j 8"
# Check that the compilation finished successfully.
bsub -I -n 8 -R "rusage[mem=4096]" "make test"
# Check that all tests pass.
cd ../..
wget "https://sourceforge.net/projects/freeimage/files/Source Distribution/3.18.0/FreeImage3180.zip"
unzip FreeImage3180.zip
rm FreeImage3180.zip
cd FreeImage
bsub -I -n 8 -R "rusage[mem=4096]" "make -j 8"
# Check that the compilation finished successfully.
cd ..
git clone https://github.com/colmap/colmap.git
cd colmap
mkdir build
cd build
cmake .. -DFREEIMAGE_INCLUDE_DIR_HINTS=$FREEIMAGE_DIR -DFREEIMAGE_LIBRARY_DIR_HINTS=$FREEIMAGE_DIR -DTESTS_ENABLED=ON -DCUDA_ARCHS="Pascal;Turing;Volta"
bsub -I -n 8 -R "rusage[mem=4096,ngpus_excl_p=1]" "make -j 8"
# Check that the compilation finished successfully.
bsub -I -n 8 -R "rusage[mem=4096,ngpus_excl_p=1]" "ctest"
# Check that tests pass. Currently known to fail: sift_test, opengl_utils_test.
cd ../..
Please note that currently there is no 30XX support on the cluster (no CUDA 11).
- Known issue The matcher is currently not working - it seems to prefer OpenGL to CUDA even when OpenGL is disabled during compilation (
-DOPENGL_ENABLED=OFF
). I have tried multiple versions of CUDA and OpenGL, but the two tests mentioned above were always failing. I suggest using a custom matcher (i.e., PyTorch based) and running GV without GPU (--SiftMatching.use_gpu 0
option formatches_importer
). - While I am around, you can probably use the compiled version of Qt / FreeImage available on my project storage. Try changing the following lines of
colmap_startup.sh
:
export FREEIMAGE_DIR=/cluster/project/infk/cvg/dusmanum/dev/FreeImage/Dist
export Qt5_DIR=/cluster/project/infk/cvg/dusmanum/dev/qt5-build/qtbase/lib/cmake/Qt5
Dear Mihai,
I am trying to install pycolmap to use the following code https://github.com/cvg/Hierarchical-Localization.
Although I followed exact steps you explained here, I could not figure out how to use FreeImage since it has no cmake support. (All other libraries have *.cmake which I can set *_DIR to the corresponding directory). I am using Euler Cluster if it matters.
Do you know how to solve this error?
Best,
Oguzhan