colmap / glomap

GLOMAP - Global Structured-from-Motion Revisited
BSD 3-Clause "New" or "Revised" License
1.3k stars 77 forks source link

Compilation issue. Dependency related? #7

Closed shankar-anantak closed 1 month ago

shankar-anantak commented 1 month ago

Hi I am trying to compile glomap on my development VM.

I initially had issues finding Ceres and suitesparse.

I run:

cmake .. -GNinja -DCeres_DIR=/usr/lib/cmake/Ceres -DCMAKE_CUDA_ARCHITECTURES="75" -DCMAKE_CXX_FLAGS="-I/usr/include/suitesparse" -DCMAKE_EXE_LINKER_FLAGS="-L/usr/lib/x86_64-linux-gnu -lcholmod"
ninja && ninja install

Stack trace below:

(base) dev@gaussian-splatter-9000:~/A/Pipelines/glomap/build$ cmake .. -GNinja -DCeres_DIR=/usr/lib/cmake/Ceres -DCMAKE_CUDA_ARCHITECTURES="75" -DCMAKE_CXX_FLAGS="-I/usr/include/suitesparse" -DCMAKE_EXE_LINKER_FLAGS="-L/usr/lib/x86_64-linux-gnu -lcholmod"
-- Found required Ceres dependency: Eigen version 3.4.0 in /usr/local/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, Multithreading]
-- Found Ceres version: 2.0.0
-- Ceres include directories:
-- Ceres libraries: Ceres::ceres
-- Found CHOLMOD: /usr/lib/x86_64-linux-gnu/libcholmod.so
-- Found SuiteSparse include dir: /usr/include/suitesparse
-- Configuring PoseLib...
-- BUILD_SHARED_LIBS: OFF
-- CMAKE_BUILD_TYPE: Release
-- CMAKE_GENERATOR: Single-config
-- CMAKE_GENERATOR: Ninja
-- CMAKE_REGISTRY_FOLDER: OFF
-- Configuring PoseLib... done
-- Configuring COLMAP...
-- Enabling LSD support
CMake Warning (dev) at build/_deps/colmap-src/cmake/FindDependencies.cmake:7 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  build/_deps/colmap-src/CMakeLists.txt:105 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found 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 required Ceres dependency: Eigen version 3.4.0 in /usr/local/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, Multithreading]
-- Enabling OpenMP support
-- Using header-only CGAL
-- Targetting Ninja
-- Using /usr/bin/c++ compiler.
CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGAL_SetupBoost.cmake:20 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGAL_SetupCGALDependencies.cmake:47 (include)
  /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGALConfig.cmake:153 (include)
  build/_deps/colmap-src/cmake/FindDependencies.cmake:67 (find_package)
  build/_deps/colmap-src/CMakeLists.txt:105 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.48")
-- Boost include dirs: /usr/include
-- Boost libraries:
-- Using gcc version 4 or later. Adding -frounding-math
-- Found CGAL
--   Includes : /usr/include
--   Libraries : CGAL
-- Enabling CUDA support (version: 12.5.82, archs: 75)
-- Found Qt
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5Core
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5OpenGL
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets
-- Enabling GUI support
-- Enabling OpenGL support
-- Enabling GPU support
-- Build type specified as Release
-- Enabling SIMD support
-- Disabling interprocedural optimization
-- Disabling ccache support
-- Disabling profiling support
-- Configuring COLMAP... done
-- Found required Ceres dependency: Eigen version 3.4.0 in /usr/local/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, Multithreading]
CMake Warning (dev) at cmake/FindDependencies.cmake:31 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  CMakeLists.txt:58 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0")
-- Enabling OpenMP
-- Disabling ccache support
-- Configuring done (0.7s)
-- Generating done (0.3s)
-- Build files have been written to: /home/dev/A/Pipelines/glomap/build
(base) dev@gaussian-splatter-9000:~/A/Pipelines/glomap/build$ ninja && ninja install
[57/236] Building CXX object _deps/colmap-build/src/colmap/exe/CMakeFiles/colmap_exe.dir/sfm.cc.o
In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
                 from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23,
                 from /usr/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14,
                 from /usr/include/boost/smart_ptr/detail/spinlock.hpp:42,
                 from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:29,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /usr/include/boost/program_options/options_description.hpp:16,
                 from /usr/include/boost/program_options.hpp:15,
                 from /home/dev/A/Pipelines/glomap/build/_deps/colmap-src/src/colmap/controllers/option_manager.h:36,
                 from /home/dev/A/Pipelines/glomap/build/_deps/colmap-src/src/colmap/controllers/automatic_reconstruction.h:32,
                 from /home/dev/A/Pipelines/glomap/build/_deps/colmap-src/src/colmap/exe/sfm.cc:32:
/usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
   36 | BOOST_PRAGMA_MESSAGE(
      | ^~~~~~~~~~~~~~~~~~~~
[236/236] Linking CXX executable glomap/glomap
FAILED: glomap/glomap
: && /usr/bin/c++ -I/usr/include/suitesparse -I/usr/include -O3 -DNDEBUG -L/usr/lib/x86_64-linux-gnu -lcholmod -L/usr/lib -Wl,-rpath,/usr/lib glomap/CMakeFiles/glomap_main.dir/glomap.cc.o glomap/CMakeFiles/glomap_main.dir/exe/global_mapper.cc.o -o glomap/glomap  -Wl,-rpath,/usr/local/cuda-12.5/targets/x86_64-linux/lib:  glomap/libglomap.a  _deps/colmap-build/src/colmap/exe/libcolmap_exe.a  _deps/colmap-build/src/colmap/ui/libcolmap_ui.a  _deps/colmap-build/src/colmap/controllers/libcolmap_controllers.a  _deps/colmap-build/src/colmap/feature/libcolmap_feature.a  _deps/colmap-build/src/colmap/retrieval/libcolmap_retrieval.a  /usr/lib/x86_64-linux-gnu/libflann.so  /usr/lib/x86_64-linux-gnu/liblz4.so  _deps/colmap-build/src/colmap/sfm/libcolmap_sfm.a  _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a  _deps/colmap-build/src/colmap/optim/libcolmap_optim.a  /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.74.0  _deps/colmap-build/src/colmap/mvs/libcolmap_mvs_cuda.a  _deps/colmap-build/src/colmap/mvs/libcolmap_mvs.a  _deps/colmap-build/src/colmap/image/libcolmap_image.a  _deps/colmap-build/src/thirdparty/LSD/libcolmap_lsd.a  _deps/colmap-build/src/colmap/scene/libcolmap_scene.a  _deps/colmap-build/src/colmap/feature/libcolmap_feature_types.a  _deps/colmap-build/src/colmap/geometry/libcolmap_geometry.a  _deps/colmap-build/src/colmap/math/libcolmap_math.a  /usr/lib/x86_64-linux-gnu/libmetis.so  /usr/lib/x86_64-linux-gnu/libboost_graph.so.1.74.0  /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.74.0  _deps/colmap-build/src/colmap/sensor/libcolmap_sensor.a  /usr/lib/libceres.so.2.0.0  _deps/colmap-build/src/thirdparty/VLFeat/libcolmap_vlfeat.a  /usr/lib/x86_64-linux-gnu/libfreeimage.so  _deps/colmap-build/src/thirdparty/PoissonRecon/libcolmap_poisson_recon.a  /usr/lib/x86_64-linux-gnu/libgmpxx.so  /usr/lib/x86_64-linux-gnu/libmpfr.so  /usr/lib/x86_64-linux-gnu/libgmp.so  _deps/colmap-build/src/colmap/util/libcolmap_util_cuda.a  _deps/colmap-build/src/colmap/util/libcolmap_util.a  /usr/lib/x86_64-linux-gnu/libglog.so.0.4.0  /usr/lib/x86_64-linux-gnu/libgflags.so.2.2.2  -lpthread  /usr/lib/x86_64-linux-gnu/libunwind.so  /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.74.0  /usr/lib/x86_64-linux-gnu/libsqlite3.so  /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5.15.3  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3  /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.3  /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3  _deps/colmap-build/src/thirdparty/SiftGPU/libcolmap_sift_gpu.a  /usr/lib/x86_64-linux-gnu/libGLX.so  /usr/lib/x86_64-linux-gnu/libOpenGL.so  /usr/local/cuda-12.5/targets/x86_64-linux/lib/libcudart.so  -ldl  /usr/lib/x86_64-linux-gnu/librt.a  /usr/local/cuda-12.5/targets/x86_64-linux/lib/libcurand.so  /usr/lib/x86_64-linux-gnu/libGLEW.so  _deps/poselib-build/PoseLib/libPoseLib.a  /usr/lib/x86_64-linux-gnu/libcholmod.so  /usr/lib/x86_64-linux-gnu/libamd.so  /usr/lib/x86_64-linux-gnu/libcolamd.so  /usr/lib/x86_64-linux-gnu/libsuitesparseconfig.so  /usr/lib/gcc/x86_64-linux-gnu/11/libgomp.so  /usr/lib/x86_64-linux-gnu/libpthread.a && :
/usr/bin/ld: glomap/libglomap.a(bundle_adjustment.cc.o): in function `glomap::BundleAdjuster::ParameterizeVariables(std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
bundle_adjustment.cc:(.text+0x10f0): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x1127): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x1145): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x12e3): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x130b): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: glomap/libglomap.a(bundle_adjustment.cc.o):bundle_adjustment.cc:(.text+0x1364): more undefined references to `ceres::Problem::SetParameterBlockConstant(double*)' follow
/usr/bin/ld: glomap/libglomap.a(bundle_adjustment.cc.o): in function `glomap::BundleAdjuster::AddPointToCameraConstraints(glomap::ViewGraph const&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
bundle_adjustment.cc:(.text+0x1642): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*, double*)'
/usr/bin/ld: glomap/libglomap.a(bundle_adjustment.cc.o): in function `glomap::BundleAdjuster::Solve(glomap::ViewGraph const&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
bundle_adjustment.cc:(.text+0x263f): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: glomap/libglomap.a(global_positioning.cc.o): in function `glomap::GlobalPositioner::ParameterizeVariables(std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
global_positioning.cc:(.text+0x17aa): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: global_positioning.cc:(.text+0x17fb): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: global_positioning.cc:(.text+0x1823): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: glomap/libglomap.a(global_positioning.cc.o): in function `glomap::GlobalPositioner::AddTrackToProblem(unsigned long const&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
global_positioning.cc:(.text+0x2e9a): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*)'
/usr/bin/ld: glomap/libglomap.a(global_positioning.cc.o): in function `glomap::GlobalPositioner::AddCameraToCameraConstraints(glomap::ViewGraph const&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&)':
global_positioning.cc:(.text+0x3537): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*)'
/usr/bin/ld: glomap/libglomap.a(global_positioning.cc.o): in function `glomap::GlobalPositioner::Solve(glomap::ViewGraph const&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
global_positioning.cc:(.text+0x4f96): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: glomap/libglomap.a(view_graph_calibration.cc.o): in function `glomap::ViewGraphCalibrator::ParameterizeCameras(std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&)':
view_graph_calibration.cc:(.text+0x122b): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: glomap/libglomap.a(view_graph_calibration.cc.o): in function `glomap::ViewGraphCalibrator::AddImagePair(glomap::ImagePair&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&)':
view_graph_calibration.cc:(.text+0x1cee): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: view_graph_calibration.cc:(.text+0x2198): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*)'
/usr/bin/ld: glomap/libglomap.a(view_graph_calibration.cc.o): in function `glomap::ViewGraphCalibrator::Solve(glomap::ViewGraph&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&)':
view_graph_calibration.cc:(.text+0x2305): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::BundleAdjuster::ParameterizeCameras(colmap::Reconstruction*)':
bundle_adjustment.cc:(.text+0x2d7d): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::BundleAdjuster::ParameterizePoints(colmap::Reconstruction*)':
bundle_adjustment.cc:(.text+0x2f4b): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x2f6c): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::BundleAdjuster::BundleAdjuster(colmap::BundleAdjustmentOptions const&, colmap::BundleAdjustmentConfig const&)':
bundle_adjustment.cc:(.text+0x439b): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::BundleAdjuster::AddPointToProblem(unsigned long, colmap::Reconstruction*, ceres::LossFunction*)':
bundle_adjustment.cc:(.text+0x5351): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::BundleAdjuster::AddImageToProblem(unsigned int, colmap::Reconstruction*, ceres::LossFunction*)':
bundle_adjustment.cc:(.text+0x55f8): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x566b): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*, double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::RigBundleAdjuster::AddPointToProblem(unsigned long, colmap::Reconstruction*, ceres::LossFunction*)':
bundle_adjustment.cc:(.text+0x5e7c): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::RigBundleAdjuster::AddImageToProblem(unsigned int, colmap::Reconstruction*, std::vector<colmap::CameraRig, std::allocator<colmap::CameraRig> >*, ceres::LossFunction*)':
bundle_adjustment.cc:(.text+0x71aa): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*, double*, double*, double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x722f): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x72d0): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*, double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x73ac): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x73bd): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(pose.cc.o): in function `colmap::RefineRelativePose(ceres::Solver::Options const&, std::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> > > const&, std::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> > > const&, colmap::Rigid3d*)':
pose.cc:(.text+0x1546): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: pose.cc:(.text+0x168a): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(pose.cc.o): in function `colmap::RefineAbsolutePose(colmap::AbsolutePoseRefinementOptions const&, std::vector<char, std::allocator<char> > const&, std::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> > > const&, std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&, colmap::Rigid3d*, colmap::Camera*, Eigen::Matrix<double, 6, 6, 0, 6, 6>*)':
pose.cc:(.text+0x213b): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*)'
/usr/bin/ld: pose.cc:(.text+0x24f8): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: pose.cc:(.text+0x26ee): undefined reference to `ceres::Covariance::GetCovarianceMatrixInTangentSpace(std::vector<double const*, std::allocator<double const*> > const&, double*)'
/usr/bin/ld: pose.cc:(.text+0x2817): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: pose.cc:(.text+0x288d): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.

Some more info:

(base) dev@gaussian-splatter-9000:~/A/Pipelines/glomap/build$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Thu_Jun__6_02:18:23_PDT_2024
Cuda compilation tools, release 12.5, V12.5.82
Build cuda_12.5.r12.5/compiler.34385749_0
(base) dev@gaussian-splatter-9000:~/A/Pipelines/glomap/build$ cmake --version
cmake version 3.30.1

CMake suite maintained and supported by Kitware (kitware.com/cmake).
(base) dev@gaussian-splatter-9000:~/A/Pipelines/glomap/build$ colmap
COLMAP 3.11.0.dev0 -- Structure-from-Motion and Multi-View Stereo
(Commit a2db4b6f on 2024-07-26 with CUDA)
(base) dev@gaussian-splatter-9000:~/A/Pipelines/glomap/build$ nvidia-smi
Tue Jul 30 15:14:24 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 555.42.06              Driver Version: 555.42.06      CUDA Version: 12.5     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA L4                      Off |   00000000:00:03.0 Off |                    0 |
| N/A   44C    P8             16W /   72W |     127MiB /  23034MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      1107      G   /usr/lib/xorg/Xorg                            117MiB |
+-----------------------------------------------------------------------------------------+

Running on Ubuntu22

lpanaf commented 1 month ago

Hi, I assume you use sudo apt-get libceres-dev for installing ceres, and use sudo apt-get libsuitesparse-dev for installing suitesparse? Can you maybe try this kind of method for compiling?

cmake .. \
            -GNinja \
            -DCMAKE_CUDA_ARCHITECTURES=75 \
            -DSuiteSparse_CHOLMOD_LIBRARY="/usr/lib/x86_64-linux-gnu/libcholmod.so" \
            -DSuiteSparse_CHOLMOD_INCLUDE_DIR="/usr/include/suitesparse"
prajwalchidananda commented 1 month ago

I built this Dockerfile that works: https://github.com/wayveai/glomap/blob/prajwal/docker/docker/Dockerfile

shankar-anantak commented 1 month ago

Hi, I assume you use sudo apt-get libceres-dev for installing ceres, and use sudo apt-get libsuitesparse-dev for installing suitesparse? Can you maybe try this kind of method for compiling?

cmake .. \
            -GNinja \
            -DCMAKE_CUDA_ARCHITECTURES=75 \
            -DSuiteSparse_CHOLMOD_LIBRARY="/usr/lib/x86_64-linux-gnu/libcholmod.so" \
            -DSuiteSparse_CHOLMOD_INCLUDE_DIR="/usr/include/suitesparse"

Hi I tried running your cmake cmd:

(base) dev@gaussian-splatter-9000:~/A/Pipelines/glomap/build$ cmake .. \
            -GNinja \
            -DCMAKE_CUDA_ARCHITECTURES=75 \
            -DSuiteSparse_CHOLMOD_LIBRARY="/usr/lib/x86_64-linux-gnu/libcholmod.so" \
            -DSuiteSparse_CHOLMOD_INCLUDE_DIR="/usr/include/suitesparse"
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring PoseLib...
-- BUILD_SHARED_LIBS: OFF
-- CMAKE_BUILD_TYPE: Release
-- CMAKE_GENERATOR: Single-config
-- CMAKE_GENERATOR: Ninja
-- CMAKE_REGISTRY_FOLDER: OFF
-- Configuring PoseLib... done
-- Configuring COLMAP...
-- Enabling LSD support
CMake Warning (dev) at build/_deps/colmap-src/cmake/FindDependencies.cmake:7 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  build/_deps/colmap-src/CMakeLists.txt:105 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found 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 SQLite3: /usr/include (found version "3.37.2")
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found Glew
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so
-- Found Git: /usr/bin/git (found version "2.34.1")
-- Found installed version of Eigen: /usr/local/share/eigen3/cmake
-- Found required Ceres dependency: Eigen version 3.4.0 in /usr/local/include/eigen3
-- Found installed version of glog: /usr/lib/x86_64-linux-gnu/cmake/glog
-- Detected glog version: 0.4.0
-- Found required Ceres dependency: glog
-- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.2
-- Found required Ceres dependency: gflags
-- Found Ceres version: 1.14.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
-- Enabling OpenMP support
-- Using header-only CGAL
-- Targetting Ninja
-- Using /usr/bin/c++ compiler.
-- Found GMP: /usr/lib/x86_64-linux-gnu/libgmp.so
-- Found MPFR: /usr/lib/x86_64-linux-gnu/libmpfr.so
CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGAL_SetupBoost.cmake:20 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGAL_SetupCGALDependencies.cmake:47 (include)
  /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGALConfig.cmake:153 (include)
  build/_deps/colmap-src/cmake/FindDependencies.cmake:67 (find_package)
  build/_deps/colmap-src/CMakeLists.txt:105 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.48")
-- Boost include dirs: /usr/include
-- Boost libraries:
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Using gcc version 4 or later. Adding -frounding-math
-- Found CGAL
--   Includes : /usr/include
--   Libraries : CGAL
-- The CUDA compiler identification is NVIDIA 11.5.119
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Enabling CUDA support (version: 12.5.82, archs: 75)
-- Found Qt
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5Core
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5OpenGL
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets
-- Enabling GUI support
-- Enabling OpenGL support
-- Enabling GPU support
-- Build type specified as Release
-- Enabling SIMD support
-- Disabling interprocedural optimization
-- Disabling ccache support
-- Disabling profiling support
-- Configuring COLMAP... done
-- Found installed version of Eigen: /usr/local/share/eigen3/cmake
-- Found required Ceres dependency: Eigen version 3.4.0 in /usr/local/include/eigen3
-- Found installed version of glog: /usr/lib/x86_64-linux-gnu/cmake/glog
-- Detected glog version: 0.4.0
-- Found required Ceres dependency: glog
-- Found installed version of gflags: /usr/lib/x86_64-linux-gnu/cmake/gflags
-- Detected gflags version: 2.2.2
-- Found required Ceres dependency: gflags
-- Found Ceres version: 1.14.0 installed in: /usr/local with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, OpenMP, Multithreading]
CMake Warning (dev) at cmake/FindDependencies.cmake:31 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  CMakeLists.txt:17 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0")
-- Enabling OpenMP
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Found CHOLMOD: /usr/lib/x86_64-linux-gnu/libcholmod.so
-- Disabling ccache support
-- Configuring done (8.5s)
CMake Error at glomap/CMakeLists.txt:77 (target_link_libraries):
  Target "glomap" links to:

    Ceres::ceres

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

-- Generating done (0.3s)
CMake Generate step failed.  Build files cannot be regenerated correctly.

When i run the same cmd and provide ceres path:

(base) dev@gaussian-splatter-9000:~/A/Pipelines/glomap/build$ cmake .. \
            -GNinja \
            -DCeres_DIR=/usr/lib/cmake/Ceres \
            -DCMAKE_CUDA_ARCHITECTURES="75"  \
            -DSuiteSparse_CHOLMOD_LIBRARY="/usr/lib/x86_64-linux-gnu/libcholmod.so" \
            -DSuiteSparse_CHOLMOD_INCLUDE_DIR="/usr/include/suitesparse"
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring PoseLib...
-- BUILD_SHARED_LIBS: OFF
-- CMAKE_BUILD_TYPE: Release
-- CMAKE_GENERATOR: Single-config
-- CMAKE_GENERATOR: Ninja
-- CMAKE_REGISTRY_FOLDER: OFF
-- Configuring PoseLib... done
-- Configuring COLMAP...
-- Enabling LSD support
CMake Warning (dev) at build/_deps/colmap-src/cmake/FindDependencies.cmake:7 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  build/_deps/colmap-src/CMakeLists.txt:105 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0") found 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 SQLite3: /usr/include (found version "3.37.2")
-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Found Glew
--   Includes : /usr/include
--   Libraries : /usr/lib/x86_64-linux-gnu/libGLEW.so
-- Found Git: /usr/bin/git (found version "2.34.1")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found required Ceres dependency: Eigen version 3.4.0 in /usr/local/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, Multithreading]
-- Enabling OpenMP support
-- Using header-only CGAL
-- Targetting Ninja
-- Using /usr/bin/c++ compiler.
-- Found GMP: /usr/lib/x86_64-linux-gnu/libgmp.so
-- Found MPFR: /usr/lib/x86_64-linux-gnu/libmpfr.so
CMake Warning (dev) at /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGAL_SetupBoost.cmake:20 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGAL_SetupCGALDependencies.cmake:47 (include)
  /usr/lib/x86_64-linux-gnu/cmake/CGAL/CGALConfig.cmake:153 (include)
  build/_deps/colmap-src/cmake/FindDependencies.cmake:67 (find_package)
  build/_deps/colmap-src/CMakeLists.txt:105 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found suitable version "1.74.0", minimum required is "1.48")
-- Boost include dirs: /usr/include
-- Boost libraries:
-- Using gcc version 4 or later. Adding -frounding-math
-- Found CGAL
--   Includes : /usr/include
--   Libraries : CGAL
-- The CUDA compiler identification is NVIDIA 11.5.119
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Enabling CUDA support (version: 12.5.82, archs: 75)
-- Found Qt
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5Core
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5OpenGL
--   Module : /usr/lib/x86_64-linux-gnu/cmake/Qt5Widgets
-- Enabling GUI support
-- Enabling OpenGL support
-- Enabling GPU support
-- Build type specified as Release
-- Enabling SIMD support
-- Disabling interprocedural optimization
-- Disabling ccache support
-- Disabling profiling support
-- Configuring COLMAP... done
-- Found required Ceres dependency: Eigen version 3.4.0 in /usr/local/include/eigen3
-- Found required Ceres dependency: glog
-- Found required Ceres dependency: gflags
-- Found Ceres version: 2.0.0 installed in: /usr with components: [EigenSparse, SparseLinearAlgebraLibrary, LAPACK, SuiteSparse, CXSparse, SchurSpecializations, Multithreading]
CMake Warning (dev) at cmake/FindDependencies.cmake:31 (find_package):
  Policy CMP0167 is not set: The FindBoost module is removed.  Run "cmake
  --help-policy CMP0167" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

Call Stack (most recent call first):
  CMakeLists.txt:17 (include)
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.74.0/BoostConfig.cmake (found version "1.74.0")
-- Enabling OpenMP
-- Found OpenMP_C: -fopenmp (found version "4.5")
-- Found OpenMP_CXX: -fopenmp (found version "4.5")
-- Found OpenMP: TRUE (found version "4.5")
-- Found CHOLMOD: /usr/lib/x86_64-linux-gnu/libcholmod.so
-- Disabling ccache support
-- Configuring done (7.2s)
-- Generating done (0.2s)
-- Build files have been written to: /home/dev/A/Pipelines/glomap/build
(base) dev@gaussian-splatter-9000:~/A/Pipelines/glomap/build$ ninja && ninja install
[96/278] Building CXX object _deps/colmap-build/src/colmap/exe/CMakeFiles/colmap_exe.dir/sfm.cc.o
In file included from /usr/include/boost/smart_ptr/detail/sp_thread_sleep.hpp:22,
                 from /usr/include/boost/smart_ptr/detail/yield_k.hpp:23,
                 from /usr/include/boost/smart_ptr/detail/spinlock_gcc_atomic.hpp:14,
                 from /usr/include/boost/smart_ptr/detail/spinlock.hpp:42,
                 from /usr/include/boost/smart_ptr/detail/spinlock_pool.hpp:25,
                 from /usr/include/boost/smart_ptr/shared_ptr.hpp:29,
                 from /usr/include/boost/shared_ptr.hpp:17,
                 from /usr/include/boost/program_options/options_description.hpp:16,
                 from /usr/include/boost/program_options.hpp:15,
                 from /home/dev/A/Pipelines/glomap/build/_deps/colmap-src/src/colmap/controllers/option_manager.h:36,
                 from /home/dev/A/Pipelines/glomap/build/_deps/colmap-src/src/colmap/controllers/automatic_reconstruction.h:32,
                 from /home/dev/A/Pipelines/glomap/build/_deps/colmap-src/src/colmap/exe/sfm.cc:32:
/usr/include/boost/bind.hpp:36:1: note: ‘#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
   36 | BOOST_PRAGMA_MESSAGE(
      | ^~~~~~~~~~~~~~~~~~~~
[278/278] Linking CXX executable glomap/glomap
FAILED: glomap/glomap
: && /usr/bin/c++ -O3 -DNDEBUG  glomap/CMakeFiles/glomap_main.dir/glomap.cc.o glomap/CMakeFiles/glomap_main.dir/exe/global_mapper.cc.o -o glomap/glomap  -Wl,-rpath,/usr/local/cuda-12.5/targets/x86_64-linux/lib:  glomap/libglomap.a  _deps/colmap-build/src/colmap/exe/libcolmap_exe.a  _deps/colmap-build/src/colmap/ui/libcolmap_ui.a  _deps/colmap-build/src/colmap/controllers/libcolmap_controllers.a  _deps/colmap-build/src/colmap/feature/libcolmap_feature.a  _deps/colmap-build/src/colmap/retrieval/libcolmap_retrieval.a  /usr/lib/x86_64-linux-gnu/libflann.so  /usr/lib/x86_64-linux-gnu/liblz4.so  _deps/colmap-build/src/colmap/sfm/libcolmap_sfm.a  _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a  _deps/colmap-build/src/colmap/optim/libcolmap_optim.a  /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.74.0  _deps/colmap-build/src/colmap/mvs/libcolmap_mvs_cuda.a  _deps/colmap-build/src/colmap/mvs/libcolmap_mvs.a  _deps/colmap-build/src/colmap/image/libcolmap_image.a  _deps/colmap-build/src/thirdparty/LSD/libcolmap_lsd.a  _deps/colmap-build/src/colmap/scene/libcolmap_scene.a  _deps/colmap-build/src/colmap/feature/libcolmap_feature_types.a  _deps/colmap-build/src/colmap/geometry/libcolmap_geometry.a  _deps/colmap-build/src/colmap/math/libcolmap_math.a  /usr/lib/x86_64-linux-gnu/libmetis.so  /usr/lib/x86_64-linux-gnu/libboost_graph.so.1.74.0  /usr/lib/x86_64-linux-gnu/libboost_regex.so.1.74.0  _deps/colmap-build/src/colmap/sensor/libcolmap_sensor.a  _deps/colmap-build/src/thirdparty/VLFeat/libcolmap_vlfeat.a  /usr/lib/libceres.so.2.0.0  /usr/lib/x86_64-linux-gnu/libfreeimage.so  _deps/colmap-build/src/thirdparty/PoissonRecon/libcolmap_poisson_recon.a  /usr/lib/x86_64-linux-gnu/libgmpxx.so  /usr/lib/x86_64-linux-gnu/libmpfr.so  /usr/lib/x86_64-linux-gnu/libgmp.so  _deps/colmap-build/src/colmap/util/libcolmap_util_cuda.a  _deps/colmap-build/src/colmap/util/libcolmap_util.a  /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.74.0  /usr/lib/x86_64-linux-gnu/libsqlite3.so  /usr/lib/x86_64-linux-gnu/libglog.so.0.4.0  /usr/lib/x86_64-linux-gnu/libgflags.so.2.2.2  /usr/lib/x86_64-linux-gnu/libQt5OpenGL.so.5.15.3  /usr/lib/x86_64-linux-gnu/libQt5Widgets.so.5.15.3  /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5.15.3  /usr/lib/x86_64-linux-gnu/libQt5Core.so.5.15.3  _deps/colmap-build/src/thirdparty/SiftGPU/libcolmap_sift_gpu.a  /usr/lib/x86_64-linux-gnu/libGLX.so  /usr/lib/x86_64-linux-gnu/libOpenGL.so  /usr/local/cuda-12.5/targets/x86_64-linux/lib/libcudart.so  -ldl  /usr/lib/x86_64-linux-gnu/librt.a  /usr/local/cuda-12.5/targets/x86_64-linux/lib/libcurand.so  /usr/lib/x86_64-linux-gnu/libGLEW.so  _deps/poselib-build/PoseLib/libPoseLib.a  /usr/lib/libceres.so.2.0.0  /usr/lib/x86_64-linux-gnu/libglog.so.0.4.0  /usr/lib/x86_64-linux-gnu/libunwind.so  /usr/lib/x86_64-linux-gnu/libgflags.so.2.2.2  -lpthread  /usr/lib/x86_64-linux-gnu/libcholmod.so  /usr/lib/gcc/x86_64-linux-gnu/11/libgomp.so  /usr/lib/x86_64-linux-gnu/libpthread.a && :
/usr/bin/ld: glomap/libglomap.a(bundle_adjustment.cc.o): in function `glomap::BundleAdjuster::ParameterizeVariables(std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
bundle_adjustment.cc:(.text+0x10f0): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x1127): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x1145): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x12e3): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x130b): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: glomap/libglomap.a(bundle_adjustment.cc.o):bundle_adjustment.cc:(.text+0x1364): more undefined references to `ceres::Problem::SetParameterBlockConstant(double*)' follow
/usr/bin/ld: glomap/libglomap.a(bundle_adjustment.cc.o): in function `glomap::BundleAdjuster::AddPointToCameraConstraints(glomap::ViewGraph const&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
bundle_adjustment.cc:(.text+0x1642): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*, double*)'
/usr/bin/ld: glomap/libglomap.a(bundle_adjustment.cc.o): in function `glomap::BundleAdjuster::Solve(glomap::ViewGraph const&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
bundle_adjustment.cc:(.text+0x263f): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: glomap/libglomap.a(global_positioning.cc.o): in function `glomap::GlobalPositioner::ParameterizeVariables(std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
global_positioning.cc:(.text+0x17aa): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: global_positioning.cc:(.text+0x17fb): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: global_positioning.cc:(.text+0x1823): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: glomap/libglomap.a(global_positioning.cc.o): in function `glomap::GlobalPositioner::AddTrackToProblem(unsigned long const&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
global_positioning.cc:(.text+0x2e9a): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*)'
/usr/bin/ld: glomap/libglomap.a(global_positioning.cc.o): in function `glomap::GlobalPositioner::AddCameraToCameraConstraints(glomap::ViewGraph const&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&)':
global_positioning.cc:(.text+0x3537): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*)'
/usr/bin/ld: glomap/libglomap.a(global_positioning.cc.o): in function `glomap::GlobalPositioner::Solve(glomap::ViewGraph const&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&, std::unordered_map<unsigned long, glomap::Track, std::hash<unsigned long>, std::equal_to<unsigned long>, std::allocator<std::pair<unsigned long const, glomap::Track> > >&)':
global_positioning.cc:(.text+0x4f96): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: glomap/libglomap.a(view_graph_calibration.cc.o): in function `glomap::ViewGraphCalibrator::ParameterizeCameras(std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&)':
view_graph_calibration.cc:(.text+0x122b): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: glomap/libglomap.a(view_graph_calibration.cc.o): in function `glomap::ViewGraphCalibrator::AddImagePair(glomap::ImagePair&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&)':
view_graph_calibration.cc:(.text+0x1cee): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: view_graph_calibration.cc:(.text+0x2198): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*)'
/usr/bin/ld: glomap/libglomap.a(view_graph_calibration.cc.o): in function `glomap::ViewGraphCalibrator::Solve(glomap::ViewGraph&, std::unordered_map<unsigned int, glomap::Camera, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Camera> > >&, std::unordered_map<unsigned int, glomap::Image, std::hash<unsigned int>, std::equal_to<unsigned int>, std::allocator<std::pair<unsigned int const, glomap::Image> > >&)':
view_graph_calibration.cc:(.text+0x2305): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::BundleAdjuster::ParameterizeCameras(colmap::Reconstruction*)':
bundle_adjustment.cc:(.text+0x2d7d): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::BundleAdjuster::ParameterizePoints(colmap::Reconstruction*)':
bundle_adjustment.cc:(.text+0x2f4b): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x2f6c): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::BundleAdjuster::BundleAdjuster(colmap::BundleAdjustmentOptions const&, colmap::BundleAdjustmentConfig const&)':
bundle_adjustment.cc:(.text+0x439b): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::BundleAdjuster::AddPointToProblem(unsigned long, colmap::Reconstruction*, ceres::LossFunction*)':
bundle_adjustment.cc:(.text+0x5351): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::BundleAdjuster::AddImageToProblem(unsigned int, colmap::Reconstruction*, ceres::LossFunction*)':
bundle_adjustment.cc:(.text+0x55f8): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x566b): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*, double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::RigBundleAdjuster::AddPointToProblem(unsigned long, colmap::Reconstruction*, ceres::LossFunction*)':
bundle_adjustment.cc:(.text+0x5e7c): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(bundle_adjustment.cc.o): in function `colmap::RigBundleAdjuster::AddImageToProblem(unsigned int, colmap::Reconstruction*, std::vector<colmap::CameraRig, std::allocator<colmap::CameraRig> >*, ceres::LossFunction*)':
bundle_adjustment.cc:(.text+0x71aa): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*, double*, double*, double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x722f): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x72d0): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*, double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x73ac): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: bundle_adjustment.cc:(.text+0x73bd): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(pose.cc.o): in function `colmap::RefineRelativePose(ceres::Solver::Options const&, std::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> > > const&, std::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> > > const&, colmap::Rigid3d*)':
pose.cc:(.text+0x1546): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*)'
/usr/bin/ld: pose.cc:(.text+0x168a): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: _deps/colmap-build/src/colmap/estimators/libcolmap_estimators.a(pose.cc.o): in function `colmap::RefineAbsolutePose(colmap::AbsolutePoseRefinementOptions const&, std::vector<char, std::allocator<char> > const&, std::vector<Eigen::Matrix<double, 2, 1, 0, 2, 1>, std::allocator<Eigen::Matrix<double, 2, 1, 0, 2, 1> > > const&, std::vector<Eigen::Matrix<double, 3, 1, 0, 3, 1>, std::allocator<Eigen::Matrix<double, 3, 1, 0, 3, 1> > > const&, colmap::Rigid3d*, colmap::Camera*, Eigen::Matrix<double, 6, 6, 0, 6, 6>*)':
pose.cc:(.text+0x213b): undefined reference to `ceres::Problem::AddResidualBlock(ceres::CostFunction*, ceres::LossFunction*, double*, double*, double*)'
/usr/bin/ld: pose.cc:(.text+0x24f8): undefined reference to `ceres::Solver::Summary::Summary()'
/usr/bin/ld: pose.cc:(.text+0x26ee): undefined reference to `ceres::Covariance::GetCovarianceMatrixInTangentSpace(std::vector<double const*, std::allocator<double const*> > const&, double*)'
/usr/bin/ld: pose.cc:(.text+0x2817): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
/usr/bin/ld: pose.cc:(.text+0x288d): undefined reference to `ceres::Problem::SetParameterBlockConstant(double*)'
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
(base) dev@gaussian-splatter-9000:~/A/Pipelines/glomap/build$

Any further help is appreciated.

Stocastico commented 1 month ago

Hi, I have the same issue as in the last message. Ceres is correctly installed and detected in cmake, but then I get the following error message:

CMake Error at glomap/CMakeLists.txt:77 (target_link_libraries): Target "glomap" links to:

Ceres::ceres

but the target was not found. Possible reasons include:

  • There is a typo in the target name.
  • A find_package call is missing for an IMPORTED target.
  • An ALIAS target is missing.
shankar-anantak commented 1 month ago

Hi, I have the same issue as in the last message. Ceres is correctly installed and detected in cmake, but then I get the following error message:

CMake Error at glomap/CMakeLists.txt:77 (target_link_libraries): Target "glomap" links to: Ceres::ceres but the target was not found. Possible reasons include:

  • There is a typo in the target name.
  • A find_package call is missing for an IMPORTED target.
  • An ALIAS target is missing.

I was able to resolve this by specifying my ceres path:

''' -DCeres_DIR=/usr/lib/cmake/Ceres '''

but running into issues after running cmake outlined above

lpanaf commented 1 month ago

Regarding this, I am not quite sure what goes wrong. Can you refer to this file to see whether you have performed all the necessary steps?

Stocastico commented 1 month ago

Hi, I have the same issue as in the last message. Ceres is correctly installed and detected in cmake, but then I get the following error message:

CMake Error at glomap/CMakeLists.txt:77 (target_link_libraries): Target "glomap" links to: Ceres::ceres but the target was not found. Possible reasons include:

  • There is a typo in the target name.
  • A find_package call is missing for an IMPORTED target.
  • An ALIAS target is missing.

I was able to resolve this by specifying my ceres path:

''' -DCeres_DIR=/usr/lib/cmake/Ceres '''

but running into issues after running cmake outlined above

As an update, I was able to run cmake. The suggestion almost worked. I had to reference Ceres_DIR in /usr/local/lib/, after that I was able to run ninja && ninja install wothout problems.

lpanaf commented 1 month ago

Thanks @Stocastico ! @prajwalchidananda @shankar-anantak can you also try this fix to see whether it solves your problem? I tried to install everything from scratch, and it works for me if I install the ceres2.2 from source. If this fix does not work for you, maybe you can also try upgrading your ceres?

lpanaf commented 1 month ago

As there is no more update, I assume the problem is solved and thereby close the issue

zhangwenniu commented 1 week ago

Hi, I have the same issue as in the last message. Ceres is correctly installed and detected in cmake, but then I get the following error message:

CMake Error at glomap/CMakeLists.txt:77 (target_link_libraries): Target "glomap" links to: Ceres::ceres but the target was not found. Possible reasons include:

  • There is a typo in the target name.
  • A find_package call is missing for an IMPORTED target.
  • An ALIAS target is missing.

I was able to resolve this by specifying my ceres path: ''' -DCeres_DIR=/usr/lib/cmake/Ceres ''' but running into issues after running cmake outlined above

As an update, I was able to run cmake. The suggestion almost worked. I had to reference Ceres_DIR in /usr/local/lib/, after that I was able to run ninja && ninja install wothout problems.

I also encountered the same issue, even though my Ceres was correctly installed, the same error appeared

CMake Error at glomap/CMakeLists.txt:77 (target_link_libraries):
  Target "glomap" links to:

    Ceres::ceres

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

The ultimate solution was to specify the Ceres path, but not /usr/lib/cmake/Ceres, instead it was /usr/local/lib/cmake/Ceres.

cmake .. -GNinja -DCeres_DIR=/usr/local/lib/cmake/Ceres

works.