Open srmainwaring opened 1 year ago
Noted, Thanks for support! Changing the python requirement to 3.8 helped complete the cmake build. Previously I had installed cmake version 3.25.2, since 3.16 was not compatible. Although the protoc version is 3.6 in my system, it did not throw any error. I will go ahead and update it to 3.21.5 as you have mentioned. But I would like to clarify if it is a necessity to downgrade cmake to 3.18; will the higher version cause any compatibility issues?
colcon build --symlink-install --merge-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo --packages-up-to gz-transport12
May I know the directory in which the colcon build for the gz-sim7 has to be run? I am sorry, I am still not quite familiar with the source builds :(
I currently have a binary install of gazebo garden in my system
will the higher version cause any compatibility issues?
No, having a later version of cmake should not be an issue.
May I know the directory in which the colcon build for the gz-sim7 has to be run? I
Run colcon from the workspace directory (i.e. gz_garden_ws
in the diagram below):
gz_garden_ws
├── build
├── install
└── src
├── gz-cmake
├── gz-common
├── gz-fuel-tools
├── gz-gui
├── gz-launch
├── gz-math
├── gz-msgs
├── gz-physics
├── gz-plugin
├── gz-python
├── gz-rendering
├── gz-sensors
├── gz-sim
├── gz-tools
├── gz-transport
├── gz-tutorials
├── gz-utils
└── sdformat
I currently have a binary install of gazebo garden in my system
That may cause conflicts - check your search paths to make sure that headers and libraries are found in the source folder first rather than the system install.
The log you sent me indicates that the system headers are found first:
In file included from /usr/include/gz/msgs9/gz/msgs/clock.pb.h:17,
from /home/anna/workspace/src/gz-transport/src/Clock.cc:17:
This is a problem for gz-msgs
as the C++ header files for the protobuf messages are generated using the older version of protoc
.
Noted, I will check that! Thank you so much for your support!
I tried uninstalling the binary installation, but the gz folder in the usr/include still remains. How do I check or set correct search paths?
@gnanukoth I've posted your request here in case others are interested. It turns out to be a bit more complicated on 20.04, mainly because the default versions of some of the dependencies need to be upgraded. I've run the steps below in an Ubuntu 20.04 VM and they seem to work.
Expand details to see build log.
There are a few issues building on Ubuntu 20.04:
update cmake
The cmake version is imposed by the dependency on one of the protobuf libraries. This SO overflow entry has a helpful summary of how to build cmake from source: https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line.
update protoc
Here's a gist advising how to update the protoc version: https://gist.github.com/jambonn/1f5fffc23f97f8413372a438739c1bff. The tag to use is
v21.5
.build
gz-sim7
from sourceNeeded because
gz-msgs9
usesfind_package()
for the protobuf dependencies rather than fetch content (which is why we needed to upgrade protoc in the previous step). To check things are working you only need to build up togz-transport12
:Remember to set:
before starting the build to ensure the Python marshalling is used.
build
gz-python
You can set the Python version to 3.8 in
CMakeLists.txt
. Version 3.10 is not required. It is set here because on macOS brew installs multiple Python versions side by side, and you can wind up with a mixture of versions during a colcon build if you are not careful.