Closed Shaswat2001 closed 1 month ago
I guess this was something related to my system only. Because I was able to build the package on a different machines successfully.
These errors are typically caused by installing a wrong version of GTSAM. Please check the installed GTSAM version with:
ls /usr/local/lib/libgtsam*
# /usr/local/lib/libgtsam_points_cuda.so /usr/local/lib/libgtsam.so /usr/local/lib/libgtsam.so.4.2.0 /usr/local/lib/libgtsam_unstable.so.4
# /usr/local/lib/libgtsam_points.so /usr/local/lib/libgtsam.so.4 /usr/local/lib/libgtsam_unstable.so /usr/local/lib/libgtsam_unstable.so.4.2.0
If there exist libgtsam.so.4.3a0
or something similar, remove them and re-install GTSAM 4.2a9.
I tried building glim_ros2 on Ubuntu 22.04 and ROS2 humble without CUDA. But get the following error
Cmake Error
Starting >>> glim_ros --- stderr: glim_ros > const&)'
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to ::marginalMultifrontalBayesNet(boost::variant<gtsam::Ordering const&, std::vector<unsigned long, std::allocator > const&>, std::function<std::pair<boost::shared_ptr, boost::shared_ptr > (gtsam::GaussianFactorGraph const&, gtsam::Ordering const&)> const&, boost::optional<gtsam::VariableIndex const&>) const'
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::function<std:: cxx11::basic_string<char, std::char_traits, std::allocator > (unsigned long)> const&)'
collect2: error: ld returned 1 exit status
gmake[2]: [CMakeFiles/offline_viewer.dir/build.make:272: offline_viewer] エラー 1
gmake[1]: [CMakeFiles/Makefile2:281: CMakeFiles/offline_viewer.dir/all] エラー 2
gmake[1]: 未完了のジョブを待っています....
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to > const&, std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1> > > const&, std::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>, std::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > const&, double)'
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to > const&, gtsam::SymmetricBlockMatrix ) const'
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to > const&) const'
collect2: error: ld returned 1 exit status
gmake[2]: ** [CMakeFiles/glim_rosnode.dir/build.make:271: glim_rosnode] エラー 1
gmake[1]: [CMakeFiles/Makefile2:200: CMakeFiles/glim_rosnode.dir/all] エラー 2
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to > const&)'
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to ::marginalMultifrontalBayesNet(boost::variant<gtsam::Ordering const&, std::vector<unsigned long, std::allocator > const&>, std::function<std::pair<boost::shared_ptr, boost::shared_ptr > (gtsam::GaussianFactorGraph const&, gtsam::Ordering const&)> const&, boost::optional<gtsam::VariableIndex const&>) const'
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to > const&, std::cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::function<std:: cxx11::basic_string<char, std::char_traits, std::allocator > (unsigned long)> const&)'
collect2: error: ld returned 1 exit status
gmake[2]: [CMakeFiles/validator_node.dir/build.make:271: validator_node] エラー 1
gmake[1]: [CMakeFiles/Makefile2:254: CMakeFiles/validator_node.dir/all] エラー 2
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to > const&, std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1> > > const&, std::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>, std::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > const&, double)'
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to > const&, gtsam::SymmetricBlockMatrix*) const'
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to > const&) const'
collect2: error: ld returned 1 exit status
gmake[2]: [CMakeFiles/glim_rosbag.dir/build.make:271: glim_rosbag] エラー 1
gmake[1]: [CMakeFiles/Makefile2:227: CMakeFiles/glim_rosbag.dir/all] エラー 2
gmake: *** [Makefile:146: all] エラー 2
/usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::JacobianFactor::updateHessian(std::vector<unsigned long, std::allocator<unsigned long> > const&, gtsam::SymmetricBlockMatrix*) const' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::FixedLagSmoother::eraseKeyTimestampMap(std::vector<unsigned long, std::allocatorgtsam::NonlinearFactor::rekey(std::vector<unsigned long, std::allocator<unsigned long> > const&) const' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::EliminateableFactorGraphgtsam::HessianFactor::HessianFactor(std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1> > > const&, std::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>, std::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > const&, double)' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::PrintKeyVector(std::vector<unsigned long, std::allocatorgtsam::FixedLagSmoother::eraseKeyTimestampMap(std::vector<unsigned long, std::allocator<unsigned long> > const&)' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::HessianFactor::HessianFactor(std::vector<unsigned long, std::allocatorgtsam::PrintKeyVector(std::vector<unsigned long, std::allocator<unsigned long> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > (unsigned long)> const&)' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::JacobianFactor::updateHessian(std::vector<unsigned long, std::allocatorgtsam::EliminateableFactorGraph<gtsam::GaussianFactorGraph>::marginalMultifrontalBayesNet(boost::variant<gtsam::Ordering const&, std::vector<unsigned long, std::allocator<unsigned long> > const&>, std::function<std::pair<boost::shared_ptr<gtsam::GaussianConditional>, boost::shared_ptr<gtsam::GaussianFactor> > (gtsam::GaussianFactorGraph const&, gtsam::Ordering const&)> const&, boost::optional<gtsam::VariableIndex const&>) const' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::NonlinearFactor::rekey(std::vector<unsigned long, std::allocatorgtsam::JacobianFactor::updateHessian(std::vector<unsigned long, std::allocator<unsigned long> > const&, gtsam::SymmetricBlockMatrix*) const' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::FixedLagSmoother::eraseKeyTimestampMap(std::vector<unsigned long, std::allocatorgtsam::NonlinearFactor::rekey(std::vector<unsigned long, std::allocator<unsigned long> > const&) const' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::EliminateableFactorGraphgtsam::HessianFactor::HessianFactor(std::vector<unsigned long, std::allocator<unsigned long> > const&, std::vector<Eigen::Matrix<double, -1, -1, 0, -1, -1>, std::allocator<Eigen::Matrix<double, -1, -1, 0, -1, -1> > > const&, std::vector<Eigen::Matrix<double, -1, 1, 0, -1, 1>, std::allocator<Eigen::Matrix<double, -1, 1, 0, -1, 1> > > const&, double)' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::PrintKeyVector(std::vector<unsigned long, std::allocatorgtsam::FixedLagSmoother::eraseKeyTimestampMap(std::vector<unsigned long, std::allocator<unsigned long> > const&)' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::HessianFactor::HessianFactor(std::vector<unsigned long, std::allocatorgtsam::PrintKeyVector(std::vector<unsigned long, std::allocator<unsigned long> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::function<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > (unsigned long)> const&)' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::JacobianFactor::updateHessian(std::vector<unsigned long, std::allocatorgtsam::EliminateableFactorGraph<gtsam::GaussianFactorGraph>::marginalMultifrontalBayesNet(boost::variant<gtsam::Ordering const&, std::vector<unsigned long, std::allocator<unsigned long> > const&>, std::function<std::pair<boost::shared_ptr<gtsam::GaussianConditional>, boost::shared_ptr<gtsam::GaussianFactor> > (gtsam::GaussianFactorGraph const&, gtsam::Ordering const&)> const&, boost::optional<gtsam::VariableIndex const&>) const' /usr/bin/ld: /usr/local/lib/libgtsam_points.so: undefined reference to
gtsam::NonlinearFactor::rekey(std::vector<unsigned long, std::allocatorFailed <<< glim_ros [2.44s, exited with code 2]
Summary: 0 packages finished [2.94s] 1 package failed: glim_ros 1 package had stderr output: glim_ros
I have followed the exact steps in the installation page. But the issue still exists. How to solve it?