ArduPilot / ardupilot_gazebo

Plugins and models for vehicle simulation in Gazebo Sim with ArduPilot SITL controllers
GNU Lesser General Public License v3.0
81 stars 76 forks source link

Unable to install this plugin on M1 Mac using GZ Harmonic #95

Closed nacorti closed 2 months ago

nacorti commented 2 months ago

Bug report

Issue details Attempting to install this plugin on an M1 Macbook Pro, running OSX 14.4.1. However, I persistently run into this error message

CMake Error at /opt/homebrew/lib/cmake/protobuf/protobuf-targets.cmake:71 (set_target_properties):
  The link interface of target "protobuf::libprotobuf" contains:

    absl::absl_check

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /opt/homebrew/lib/cmake/protobuf/protobuf-config.cmake:16 (include)
  /opt/homebrew/share/cmake/gz-cmake3/cmake3/FindGzProtobuf.cmake:29 (find_package)
  /opt/homebrew/lib/cmake/gz-transport13/gz-transport13-config.cmake:92 (find_package)
  /opt/homebrew/lib/cmake/gz-sim8/gz-sim8-config.cmake:94 (find_package)
  /opt/homebrew/share/cmake/gz-cmake3/cmake3/GzFindPackage.cmake:243 (find_package)
  CMakeLists.txt:31 (gz_find_package)

Please describe the problem I've installed GZ harmonic using brew install gz-harmonic. I'm able to run simple test examples using just gazebo. I've exported the GZ_VERSION env variable. However running cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo as instructed in the install notes causes the above error. I can see that brew is pulling down protobuf v27 and abseil successfully, but something in this installation isn't picking up abseil properly. Wondering if you guys have certain versions of these dependency libraries that you pin that work for y'all. I'm in the process of going down the rabbit hole to try and get an earlier version of protobuf without abseil to work but figured I'd ask around here. I'm hoping at least one of y'all has this working on an M1 Mac.

Thanks in advance!

Version What version was the issue encountered with GZ Harmonic, attempting to build this package from latest master Platform [ x] All [ ] AntennaTracker [ ] Copter [ ] Plane [ ] Rover [ ] Submarine

Logs Please provide a link to any relevant logs that show the issue

srmainwaring commented 2 months ago

@nacorti - the ardupilot gazebo plugin does not use protobuf or abseil directly as it does not need to generate custom message types. I wonder whether the versions used to build gz-harmonic are out of date compared to those available in brew latest in you set up (will need to look at the brew formula for osrf and compare to brew info protobuf for this)?

I build gz-harmonic from source on macOS and don't see this issue, because the the gz libraries and additional plugins are always in sync. If you could try a source build for comparison that would be helpful.

Update:

Looks like the most recent brew update pulls in a new version of protobuf. Before running brew update today:

% brew info protobuf 
==> protobuf: stable 26.1 (bottled)
Protocol buffers (Google's data interchange format)
https://protobuf.dev/
Installed
/opt/homebrew/Cellar/protobuf/26.1 (297 files, 11.9MB) *
  Poured from bottle on 2024-05-08 at 22:56:28
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/p/protobuf.rb
License: BSD-3-Clause
==> Dependencies
Build: cmake ✔
Required: abseil ✔, jsoncpp ✔
==> Caveats
Emacs Lisp files have been installed to:
  /opt/homebrew/share/emacs/site-lisp/protobuf
% brew outdated
highway (1.1.0) < 1.2.0
pipx (1.5.0) < 1.6.0
proj (9.4.0) < 9.4.1

and after:

 % brew update
==> Updating Homebrew...
Updated 3 taps (osrf/simulation, homebrew/core and homebrew/cask).
==> New Formulae
fern-api                   openjdk@21                 vexctl
==> New Casks
alcom                      clion@eap                  get-api
==> Outdated Formulae
apache-arrow    grpc            opencv          proj            ruff
cmake           harfbuzz        openjdk         protobuf        spdlog
gcc             highway         pipx            protobuf-c

You have 14 outdated formulae installed.
You can upgrade them with brew upgrade
or list them with brew outdated.

That's annoying... Until OSRF rebuild the bottles for gz-harmonic and dependencies you will most likely have to build Gazebo from source, or try rolling back your brew formula repo (would not recommend as it can get messy).

nacorti commented 2 months ago

@srmainwaring Understood, I'll try a source build tonight and report back 🫡

srmainwaring commented 2 months ago

Closing as no follow up activity.