[SOLVED] Source installation fails to build Gazebo


#1

Hello everyone,

I’m installing NRP on Ubuntu 16.04, closely following the usual instructions.

It’s all sweet until I get to the NRP build step: ./update_nrp build all
When we reach Gazebo errors appear. They all refer to the class ignition::math::Vector2<double> not having the Length or Zero members. here’s an excerpt:

[ 72%] Building CXX object gazebo/gui/CMakeFiles/gazebo_gui.dir/moc_TopicSelector.cxx.o
/home/z/programs/NRP/gazebo/gazebo/gui/building/RectItem.cc: In member function ‘virtual void gazebo::gui::RectItem::mouseReleaseEvent(QGraphicsSceneMouseEvent*)’:
/home/z/programs/NRP/gazebo/gazebo/gui/building/RectItem.cc:580:34: error: ‘Zero’ is not a member of ‘ignition::math::Vector2d {aka ignition::math::Vector2}’
this->dataPtr->mousePressPos = ignition::math::Vector2d::Zero;
^

…OTHER SIMILAR ERRORS…

make[2]: *** [gazebo/gui/CMakeFiles/gazebo_gui.dir/building/EditorView.cc.o] Error 1
CMakeFiles/Makefile2:1309: recipe for target ‘gazebo/gui/CMakeFiles/gazebo_gui.dir/all’ failed
make[1]: *** [gazebo/gui/CMakeFiles/gazebo_gui.dir/all] Error 2
Makefile:160: recipe for target ‘all’ failed
make: *** [all] Error 2
GAZEBO BUILD ERROR

Any ideas on what’s going on?


#2

Dear Sergio,

It is most probably related to step 5 of the NRP installation guide:

 sudo apt-get install libignition-math2-dev libignition-transport-dev libignition-transport0-dev

Did you run successfully this command? It seems that there is a version mismatch for libignition-math2-dev. Maybe you have two different versions installed. Note that math::Vector2d::Zero is part of API Reference 4.0.0 and but isn’t defined for any ealier version, see https://ignitionrobotics.org/libs/math.


#3

Dear Sergio,

The problem is most likely coming from a different version of the Ignition library which is installed in your system. In the installation instructions there is this step here

sudo apt-get install libignition-math2-dev libignition-transport-dev libignition-transport0-dev

which installs the ignition library, and it should be located in /usr/include/ignition

The specific file that CMake is complaining about should be located in /usr/include/ignition/math2/ignition/math/Vector2.hh
and should look like the file that I attach. As you can see in the file, there is a Zero function declared in line 32, which probably your version of ignition does not have. You can also see in the bitbucket of ignition that the file indeed has the zero function as a member of the vector2 class https://bitbucket.org/ignitionrobotics/ign-math/src/default/include/ignition/math/Vector2.hh. Most likely this is missing from your version. If you confirm that is the case, then you will have to remove your version of ignition and reinstall it with apt-get. Let us know if that helps.

Regards,
ManosVector2.txt (13.3 KB)


#4

Thanks Iguyot and Manos! Your comments were on point.

For future reference, the problem is that I somehow neglected step 3 of the Gazebo prerequisites (adding the repository). Thus when I did step 5, an older version of libignition-math2-dev was installed.


#5

Hi

I am getting the error and it does not solve it. Could you please suggest what could be wrong? Thank you.

[ 97%] Built target VehiclePlugin
[ 97%] Built target LookAtDemoPlugin
[ 97%] Linking CXX executable UNIT_OpensimLink_TEST
[ 97%] Linking CXX executable UNIT_OpensimPhysics_TEST
…/libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference to boost::re_detail::put_mem_block(void*)' ../libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference toboost::re_detail::get_mem_block()’
…/libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference to boost::re_detail::raise_runtime_error(std::runtime_error const&)' ../libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference toboost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >, boost::regex_traits<char, boost::cpp_regex_traits > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits > > const&, boost::regex_constants::_match_flags)’
…/libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference to boost::re_detail::get_default_error_string(boost::regex_constants::error_type)' ../libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference toboost::re_detail::cpp_regex_traits_implementation::transform[abi:cxx11](char const*, char const*) const’
…/libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference to boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const' ../libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference toboost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)’
…/libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference to boost::re_detail::put_mem_block(void*)' ../libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference toboost::re_detail::get_mem_block()’
…/libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference to boost::re_detail::raise_runtime_error(std::runtime_error const&)' ../libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference toboost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > >, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits, std::allocator > > > >, boost::regex_traits<char, boost::cpp_regex_traits > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits > > const&, boost::regex_constants::_match_flags)’
…/libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference to boost::re_detail::get_default_error_string(boost::regex_constants::error_type)' ../libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference toboost::re_detail::cpp_regex_traits_implementation::transform[abi:cxx11](char const*, char const*) const’
…/libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference to boost::re_detail::cpp_regex_traits_implementation<char>::transform_primary[abi:cxx11](char const*, char const*) const' ../libgazebo_physics.so.9.8.0.hbp.3.0.0: undefined reference toboost::re_detail::verify_options(unsigned int, boost::regex_constants::_match_flags)’
collect2: error: ld returned 1 exit status
collect2: error: ld returned 1 exit status
gazebo/physics/opensim/CMakeFiles/UNIT_OpensimPhysics_TEST.dir/build.make:155: recipe for target ‘gazebo/physics/opensim/UNIT_OpensimPhysics_TEST’ failed
gazebo/physics/opensim/CMakeFiles/UNIT_OpensimLink_TEST.dir/build.make:155: recipe for target ‘gazebo/physics/opensim/UNIT_OpensimLink_TEST’ failed
make[2]: *** [gazebo/physics/opensim/UNIT_OpensimPhysics_TEST] Error 1
make[2]: *** [gazebo/physics/opensim/UNIT_OpensimLink_TEST] Error 1
CMakeFiles/Makefile2:10854: recipe for target ‘gazebo/physics/opensim/CMakeFiles/UNIT_OpensimPhysics_TEST.dir/all’ failed
make[1]: *** [gazebo/physics/opensim/CMakeFiles/UNIT_OpensimPhysics_TEST.dir/all] Error 2
CMakeFiles/Makefile2:10813: recipe for target ‘gazebo/physics/opensim/CMakeFiles/UNIT_OpensimLink_TEST.dir/all’ failed
make[1]: *** [gazebo/physics/opensim/CMakeFiles/UNIT_OpensimLink_TEST.dir/all] Error 2
Makefile:181: recipe for target ‘all’ failed
make: *** [all] Error 2
gazebo
±------------------------- gazebo build FAILED -------------------------------------+
| If you are upgrading from Ubuntu 16 to 18, try removing the gazebo/build folder |
| and relaunch this script. |
±------------------------------------------------------------------------------------+


#6

Dear Chandandeep,

Are you sure libboost is installed on your computer? I would try to

sudo apt-get install libboost-all-dev

and rebuild afterwards.

Best regards,
Axel


#7

Hi @vonarnim unfortunately this did not fix the issue. I still get the same error.