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
Hello. I also had this issue. The problem is the cmake directory is not created in the expected place. You can fix this by running
make install
after building. You will need to specify a target directory and then use it as your "COLMAP_DIR" for building pycolmap. I did this a couple weeks ago let me know if you want more details.