json87 / SphereSfM

SfM for sphere images in the ERP format within the framework of ColMap
BSD 3-Clause "New" or "Revised" License
106 stars 15 forks source link

Error While building the Code in Ubuntu Server #3

Closed paidiakileswar closed 5 months ago

paidiakileswar commented 5 months ago

Error While Building the code using ninja

I have a linux server (Ubuntu 20.04) , There i created a conda environment and installed all required dependencies provided in build-ubuntu.yaml

Then,All CUDA and all provided libraries are installed in my conda environment !

Issue is : While 'Configure and build' :

I cloned the repo SphereSfM and I proceeded steps mentioned below:

Step - 1:

      mkdir build
      cd build

Step - 2: Configure

cmake .. \
        -GNinja \
        -DTESTS_ENABLED=ON \
        -DCMAKE_CUDA_ARCHITECTURES=50 \
        -DASAN_ENABLED=True

It went sucessfully and output was came finally as : -- Build files have been written to: /home/ubuntu/workdir/colmap_test_build/SphereSfM/build

Step - 3: Build ninja

Main Issue While Executing the ninja (Building the code) =>

Compilation Error: 'hypot' is not a member of 'ceres' in cost_functions.h

While step 3 ninja is executing , I tried many times , It is stopping at middle and rasing many errors ! Could you Please tell me how to move from here ! I think if this step is completed ! Then the work will be more easier to me

Error :


../src/base/cost_functions.h:120:39: error: ‘hypot’ is not a member of ‘ceres’                                                                                              120 |                                ceres::hypot(projection[0], projection[2]));                                                                                            
 |                                       ^~~~~                                                                                                                     
  ../src/base/cost_functions.h:120:39: note: suggested alternatives:                                                                                                 
In file included from /usr/include/c++/9/complex:44,                                                                                                                                       from /usr/include/eigen3/Eigen/Core:96,                                                                                                                                 
 from ../src/optim/bundle_adjustment.h:38,
from ../src/optim/bundle_adjustment.cc:32:                                                                                                               /usr/include/c++/9/cmath:1458:3: note:   ‘hypot’                                                                                                                          
 1458 |   hypot(float __x, float __y)                                                                                                                                          
 |   ^~~~~                                                                                                                                                           /usr/include/c++/9/cmath:1469:5: note:   ‘std::hypot’                                                                                                                     
 1469 |     hypot(_Tp __x, _Up __y)                                                                                                                                         
    |     ^~~~~                                                                                                                                                         
In file included from /usr/include/eigen3/Eigen/Core:371,                                                                                                                                  from ../src/optim/bundle_adjustment.h:38,                                                                                                                                 
from ../src/optim/bundle_adjustment.cc:32:                                                                                                               /usr/include/eigen3/Eigen/src/Core/MathFunctions.h:928:45: note:   ‘Eigen::numext::hypot’                                                                                   928 | inline EIGEN_MATHFUNC_RETVAL(hypot, Scalar) hypot(const Scalar& x, const Scalar& y)                                                                                     |                                             ^~~~~                                                                                                               
  In file included from ../src/optim/bundle_adjustment.cc:41:                                                                                                               ../src/base/cost_functions.h: In member function ‘bool colmap::SphericalBundleAdjustmentConstantPoseCostFunction<CameraModel>::operator()(const T*, const T*, T*) const’: 
../src/base/cost_functions.h:249:39: error: ‘hypot’ is not a member of ‘ceres’                                                                                              249 |                                ceres::hypot(projection[0], projection[2]));                                                                                            
 |                                       ^~~~~                                                                                                                      
 ../src/base/cost_functions.h:249:39: note: suggested alternatives:                                                                                                       
 In file included from /usr/include/c++/9/complex:44,                                                                                                                                       from /usr/include/eigen3/Eigen/Core:96,                                                                                                                                  
from ../src/optim/bundle_adjustment.h:38,
 from ../src/optim/bundle_adjustment.cc:32:                                                                                                               /usr/include/c++/9/cmath:1458:3: note:   ‘hypot’                                                                                                                           
1458 |   hypot(float __x, float __y)                                                                                                                                          
           |   ^~~~~
/usr/include/c++/9/cmath:1469:5: note:   ‘std::hypot’
 1469 |     hypot(_Tp __x, _Up __y)
           |     ^~~~~
In file included from /usr/include/eigen3/Eigen/Core:371,
                 from ../src/optim/bundle_adjustment.h:38,
                 from ../src/optim/bundle_adjustment.cc:32:
/usr/include/eigen3/Eigen/src/Core/MathFunctions.h:928:45: note:   ‘Eigen::numext::hypot’
  928 | inline EIGEN_MATHFUNC_RETVAL(hypot, Scalar) hypot(const Scalar& x, const Scalar& y)
      |                                             ^~~~~
[269/344] Building CUDA object src/CMakeFiles/colmap_cuda.dir/mvs/patch_match_cuda.cu.o
ninja: build stopped: subcommand failed.
json87 commented 5 months ago

I think it is the version problem of Ceres. I have used the Ceres with the version 2.1.0.