colmap icon indicating copy to clipboard operation
colmap copied to clipboard

CMake Error at CMakeLists.txt:368 (install): install TARGETS given target "colmap_controllers" which does not exist in this directory.

Open aiodo-lab opened this issue 1 year ago • 2 comments

Describe the bug I'm trying to build from source with GPU support using the guide: https://colmap.github.io/install.html#library but got the error as shown in the title of this report. I searched previous reports and cannot find a similar error.

Environment:

  • OS: [Ubuntu 18.04]

After installing dependencies, the next step was to Configure and compile COLMAP. The current step is to run cmake:

git clone https://github.com/colmap/colmap.git cd colmap mkdir build cd build cmake .. -DCMAKE_PREFIX_PATH="/home/anicetusodo/anaconda3/envs/colmap" .. -GNinja -DCMAKE_CUDA_ARCHITECTURES=75 -- Enabling LSD support -- Boost found. -- Found Boost components: filesystem;graph;program_options;system -- Found FreeImage -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libfreeimage.so -- Found FLANN -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libflann.so -- Found LZ4 -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/liblz4.so -- Found Metis -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libmetis.so -- Found Glog -- Target : glog::glog -- Found Glew -- Includes : /usr/include -- Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so -- Found installed version of Eigen: /usr/lib/cmake/eigen3 -- Found required Ceres dependency: Eigen version 3.3.4 in /usr/include/eigen3 -- Found required Ceres dependency: glog -- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags -- Detected gflags version: 2.2.1 -- Found required Ceres dependency: gflags -- Found Ceres version: 1.13.0 installed in: /usr with components: [LAPACK, SuiteSparse, SparseLinearAlgebraLibrary, CXSparse, SchurSpecializations, OpenMP] -- Enabling OpenMP support -- Found CGAL -- Includes : /usr//include -- Libraries : /usr/lib/x86_64-linux-gnu/libCGAL.so.13.0.1 -- Found CUDA version 10.2 installed in /usr/local/cuda-10.2 via legacy CMake (<3.17) module. Using the legacy CMake module means that any installation of COLMAP will require that the CUDA libraries are available under LD_LIBRARY_PATH. -- Found CUDA -- Includes : /usr/local/cuda-10.2/include -- Libraries : /usr/local/cuda-10.2/lib64/libcudart_static.a;-lpthread;dl;/usr/lib/x86_64-linux-gnu/librt.so -- Enabling CUDA support (version: 10.2, archs: 75) -- Found Qt -- Module : /home/anicetusodo/anaconda3/envs/colmap/lib/cmake/Qt5Core -- Module : /home/anicetusodo/anaconda3/envs/colmap/lib/cmake/Qt5OpenGL -- Module : /home/anicetusodo/anaconda3/envs/colmap/lib/cmake/Qt5Widgets -- Enabling GUI support -- Enabling OpenGL support -- Enabling GPU support (OpenGL: ON, CUDA: ON) -- Build type not specified, using Release -- Enabling SIMD support -- Disabling interprocedural optimization -- Disabling ccache support -- Disabling profiling support CMake Error at CMakeLists.txt:368 (install): install TARGETS given target "colmap_controllers" which does not exist in this directory.

Please, any idea what this CMake Error is about?

aiodo-lab avatar Jul 25 '24 15:07 aiodo-lab

  1. Rename anaconda3 folder:

mv anaconda3 anaconda3_
  1. Close the current terminal, then open a new one, and run cmake again. Once successfully built.

  2. Change the anaconda3 folder name back to the original.

Abbsalehi avatar Aug 04 '24 20:08 Abbsalehi

Successfully built COLMAP with GPU support.

In place of my conda environment, I created a new virtualenv like below and repeated the installation and outlined in the guide: https://colmap.github.io/install.html

  • virtualenv -p /usr/bin/python3.8 colmap_env

  • source colmap_env/bin/activate

  • Installed dependencies: sudo apt-get install
    git
    cmake
    ninja-build
    build-essential
    libboost-program-options-dev
    libboost-filesystem-dev
    libboost-graph-dev
    libboost-system-dev
    libeigen3-dev
    libflann-dev
    libfreeimage-dev
    libmetis-dev
    libgoogle-glog-dev
    libgtest-dev
    libsqlite3-dev
    libglew-dev
    qtbase5-dev
    libqt5opengl5-dev
    libcgal-dev
    libceres-dev

I use Ubuntu 18.04 and the guide recommends to install the CGAL Qt5 package:

sudo apt-get install libcgal-qt5-dev

-Next, I cloned the colmap repo and run cmake as shown below:

git clone https://github.com/colmap/colmap.git cd colmap mkdir build cd build cmake .. -GNinja -DCMAKE_CUDA_ARCHITECTURES=native -Wno-dev ninja sudo ninja install

Completed Successfully.

I hope someone finds this useful. Thanks

aiodo-lab avatar Aug 14 '24 19:08 aiodo-lab

Inspired by https://stackoverflow.com/questions/34443128/cmake-install-targets-in-subdirectories, I have solved this problem by updating the cmake from 3.11.4 to 3.14.7. I hope this useful.

wangxl0385 avatar Jan 22 '25 02:01 wangxl0385