Gazebo | Ignition | Community
Ask Your Question
0

How to rebuild ign-msgs for gazebo9?

asked 2020-01-14 11:12:21 -0600

I've install gazebo9 on a Bionic machine which has more up to date versions of protobuf than gazebo is expecting. Specifically, the apt package for ign-msgs1 was compiled with something before protobuf 3. So naturally, I'm trying to rebuild ign-msgs1 so that it will be up to date. However, this fails because there are macros in ign-msgs1 Utils.cmake which are defined by ign-cmake0 in IgnUtils.cmake. This conflict makes it impossible to rebuild ign-msgs1 on Bionic.

I can't upgrade from ign-msgs1 without recompiling everything else, so I'm wondering if there's a way to make ign-msgs use its own macros instead of getting them stomped on by ign-cmake0

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2020-01-15 13:29:41 -0600

updated 2020-01-15 13:41:13 -0600

The solution here was to build protobuf 3.0.0 from source. The ubuntu package installed 3.8.0 because I was using a Lambda Labs machine which requires 3.8.0 for some other packages

Luckily, it's incredibly easy. Install protobuf 3.0.0 (from github releases for example) using the cmake install process (not the make process!). In protobuf, go to the cmake subdirectory and do the usual

mkdir build
cd build
cmake ..
make
sudo make install

Then if you're building with cmake, just make sure you either 1) append /usr/local to CMAKE_PREFIX_PATH or set CMAKE_INSTALL_PREFIX=/usr when building proto.

For me, this process installed /usr/local/lib/cmake/protobuf/protobuf-config.cmake, which could be found by catkin (or normal cmake) without messing with system protobuf 3.8.0

edit flag offensive delete link more
1

answered 2020-01-14 14:47:34 -0600

chapulina gravatar image

I'm trying to rebuild ign-msgs1 so that it will be up to date.

There might be a way to get this to work, but I wouldn't recommend it. Proto 3's API is not backwards compatible with Proto 2 (for example, no more optional fields). You can install Proto 2 and 3 side-by-side. Since ign-msgs1 and gazebo9 depend on Proto 2, I recommend you install and use that.

there are macros in ign-msgs1 Utils.cmake which are defined by ign-cmake0 in IgnUtils.cmake

I don't see a Utils.cmake on ign-msgs1. All its cmake macros should be coming from ign-cmake0. What are the conflicting macros you're seeing?

I'm wondering if there's a way to make ign-msgs use its own macros instead of getting them stomped on by ign-cmake0

We created ign-cmake so it could hold macros to be reused by all other Ignition libraries. So it's expected that the macros are coming from that package.

edit flag offensive delete link more

Comments

Do you have any experience with proto2 being installed alongside proto3? I'm not sure it would work nicely because they have the same fundamental library names. I'll try it though.

Here are the conflicting macros: https://bitbucket.org/ignitionrobotic...

Peter Mitrano gravatar imagePeter Mitrano ( 2020-01-15 12:18:58 -0600 )edit

Interesting, that file doesn't exist on ign-msgs1: https://bitbucket.org/ignitionrobotic..., maybe you can try updating to the latest release branch. I haven't investigated much, but Gazebo 9 seems to be linking against libprotobuf 3.0.0, but still using proto2 message syntax. So I guess maybe 2 versions can't be co-installed, but version 3 supports syntax 2.

chapulina gravatar imagechapulina ( 2020-01-15 12:31:18 -0600 )edit

I just noticed that and I'm confused -- if gazebo uses libprotobuf3, why am I getting compiler errors: /usr/include/ignition/msgs1/ignition/msgs/time.pb.h This file was generated by an older version of protoc which is incompatible with your Protocol Buffer headers. Please regenerate this file with a newer version of protoc

Peter Mitrano gravatar imagePeter Mitrano ( 2020-01-15 13:01:38 -0600 )edit

The failing check is 3000000 < GOOGLE_PROTOBUF_MIN_PROTOC_VERSION so it would seem that the ign-msgs1 headers were generated with protoc 2? Is that true?

Peter Mitrano gravatar imagePeter Mitrano ( 2020-01-15 13:03:44 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2020-01-14 11:12:21 -0600

Seen: 562 times

Last updated: Jan 15 '20