NeRF-SLAM icon indicating copy to clipboard operation
NeRF-SLAM copied to clipboard

make error when installing gtsam

Open OceanYing opened this issue 2 years ago • 5 comments

Thanks for the inspiring work and release of code. I met a problem when making install gtsam in step: cmake --build build_gtsam --config RelWithDebInfo -j The gtsam branch I used here is the newest one with the correction proposed by sxyu.

The reported error is:

SLAM/NeRF-SLAM/build_gtsam/python/linear.cpp:401:200: required from here /usr/include/c++/7/bits/allocator.h:113:26: error: forming pointer to reference type ‘const Eigen::Matrix<double, -1, -1>&’ typedef _Tp* pointer; ^~~~~~~ /usr/include/c++/7/bits/allocator.h:114:26: error: forming pointer to reference type ‘const Eigen::Matrix<double, -1, -1>&’ typedef const _Tp* const_pointer; ^~~~~~~~~~~~~

which seems the same as reported by pengwangucla.

After checking , I think the error occurs in linear.cpp (line 401) .def(py::init<const gtsam::KeyVector&, const std::vector<const gtsam::Matrix&>&, const std::vector<const gtsam::Vector&>&, double>(), py::arg("js"), py::arg("Gs"), py::arg("gs"), py::arg("f"))

which is highly related to what ToniRV has said in README:

  1. Somehow the parser converts this to const std::vector<const gtsam::Matrix&>&, and I need to remove manually in gtsam/build/python/linear.cpp the inner const X& ..., and also add <pybind11/stl.h> because: Did you forget to #include <pybind11/stl.h>?

But I cannot find out the correct way to fix this error. Maybe anyone could help explain const X& ... here. Hope someone could help me out. Thanks a lot!

OceanYing avatar Jan 08 '23 13:01 OceanYing