Closed Ratatinator97 closed 9 months ago
I haven't yet had a chance to build bottles for arm64, so I'm not sure how much of gazebo works on that architecture
I installed gz-garden
and the problem persists:
➜ ~ gz gui
Error while loading the library [/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/libCameraTracking.dylib]: dlopen(/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/libCameraTracking.dylib, 0x0085): Library not loaded: '@rpath/libgz-gui7.7.dylib'
Referenced from: '/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/libCameraTracking.dylib'
Reason: tried: '/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/../lib/libgz-gui7.7.dylib' (no such file), '/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/../lib/libgz-gui7.7.dylib' (no such file), '/opt/homebrew/Cellar/gz-plugin2/2.0.0/lib/../lib/libgz-gui7.7.dylib' (no such file), '/usr/local/lib/libgz-gui7.7.dylib' (no such file), '/usr/lib/libgz-gui7.7.dylib' (no such file)
[GUI] [Err] [Application.cc:495] Failed to load plugin [CameraTracking] : couldn't load library on path [/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/libCameraTracking.dylib].
➜ ~ ls /opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/
libCameraTracking.dylib libMinimalScene.dylib libTeleop.dylib
libGrid3D.dylib libNavSatMap.dylib libTopicEcho.dylib
libGridConfig.dylib libPointCloud.dylib libTopicViewer.dylib
libImageDisplay.dylib libPublisher.dylib libTransportPlotting.dylib
libInteractiveViewControl.dylib libScreenshot.dylib libTransportSceneManager.dylib
libKeyPublisher.dylib libShutdownButton.dylib libWorldControl.dylib
libMarkerManager.dylib libTapeMeasure.dylib libWorldStats.dylib
➜ ~ ruby --version
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [arm64-darwin21]
Another example:
/opt/homebrew/opt/ruby/bin/ruby $(which gz) gui
Error while loading the library [/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/libCameraTracking.dylib]: dlopen(/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/libCameraTracking.dylib, 0x0085): Library not loaded: '@rpath/libgz-gui7.7.dylib'
Referenced from: '/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/libCameraTracking.dylib'
Reason: tried: '/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/../lib/libgz-gui7.7.dylib' (no such file), '/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/../lib/libgz-gui7.7.dylib' (no such file), '/opt/homebrew/Cellar/gz-plugin2/2.0.0/lib/../lib/libgz-gui7.7.dylib' (no such file), '/usr/local/lib/libgz-gui7.7.dylib' (no such file), '/usr/lib/libgz-gui7.7.dylib' (no such file)
[GUI] [Err] [Application.cc:495] Failed to load plugin [CameraTracking] : couldn't load library on path [/opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/libCameraTracking.dylib].
Here are the rights of the differents libraries:
➜ ~ ls -al /opt/homebrew/Cellar/gz-gui7/7.0.0/lib/gz-gui-7/plugins/
total 8216
drwxr-xr-x 23 alex admin 736 Nov 7 10:47 .
drwxr-xr-x 3 alex admin 96 Nov 7 10:47 ..
-r--r--r-- 1 alex admin 245392 Nov 7 10:47 libCameraTracking.dylib
-r--r--r-- 1 alex admin 176720 Nov 7 10:47 libGrid3D.dylib
-r--r--r-- 1 alex admin 176720 Nov 7 10:47 libGridConfig.dylib
-r--r--r-- 1 alex admin 197904 Nov 7 10:47 libImageDisplay.dylib
-r--r--r-- 1 alex admin 204400 Nov 7 10:47 libInteractiveViewControl.dylib
-r--r--r-- 1 alex admin 130960 Nov 7 10:47 libKeyPublisher.dylib
-r--r--r-- 1 alex admin 285664 Nov 7 10:47 libMarkerManager.dylib
-r--r--r-- 1 alex admin 277904 Nov 7 10:47 libMinimalScene.dylib
-r--r--r-- 1 alex admin 174816 Nov 7 10:47 libNavSatMap.dylib
-r--r--r-- 1 alex admin 285840 Nov 7 10:47 libPointCloud.dylib
-r--r--r-- 1 alex admin 151776 Nov 7 10:47 libPublisher.dylib
-r--r--r-- 1 alex admin 201344 Nov 7 10:47 libScreenshot.dylib
-r--r--r-- 1 alex admin 128896 Nov 7 10:47 libShutdownButton.dylib
-r--r--r-- 1 alex admin 211328 Nov 7 10:47 libTapeMeasure.dylib
-r--r--r-- 1 alex admin 152592 Nov 7 10:47 libTeleop.dylib
-r--r--r-- 1 alex admin 175968 Nov 7 10:47 libTopicEcho.dylib
-r--r--r-- 1 alex admin 184768 Nov 7 10:47 libTopicViewer.dylib
-r--r--r-- 1 alex admin 128416 Nov 7 10:47 libTransportPlotting.dylib
-r--r--r-- 1 alex admin 286240 Nov 7 10:47 libTransportSceneManager.dylib
-r--r--r-- 1 alex admin 216944 Nov 7 10:47 libWorldControl.dylib
-r--r--r-- 1 alex admin 175424 Nov 7 10:47 libWorldStats.dylib
Feel free to ask other infos in order to debug
I have same problem when try to run gz sim -s
. I noticed that when brew installs gz-sim7 it runs cmake .. -DCMAKE_INSTALL_RPATH=@loader_path/../lib
. You can see it in gz-sim7.rb file and the other gz-*.rb files.
The error is consistent with the linker setting the path to libgz-sim7.7.dylib in each plugin's dylib to @loader_path/../lib
, as the dynamic linker is searching for libgz-sim7.7.dylib one directory below in a folder which doesn't exist.
@loader_path
would be the plugins path, _/opt/homebrew/Cellar/gz-sim7/7.4.02/lib/gz-sim-7/plugins, but libgz-sim7.7.dylib would be in _/opt/homebrew/Cellar/gz-sim7/7.4.02/lib. So, the rpath in the cmake call could be cmake .. -DCMAKE_INSTALL_RPATH=@loader_path/../../../lib
which would let the dynamic loader find libgz-sim7.7.dylib. This might cause problems for libgz-sim7.7.dylib if it has any dependencies in the _/opt/homebrew/Cellar/gz-sim7/7.4.02/lib folder. So, it might be better have a separate rpath for plugins for this. This is a similar problem for all of the gz-* modules that have plugins like gz-gui.
I wonder if this is only on Mac silicon with homebrew as homebrew no longer install to /usr/local, and now everything is in /opt/homebrew on Mac silicon. Is homebrew still adding links to the various libgz-*.dylib in /usr/local/lib on other systems which the dynamic linker includes in its search path?
I believe I have fixed the RPATH issues for garden in #2409 and #2410
Hello I just installed on my M1 the
ignition-gazebo7
package and I have the following errors:Same issue when I run a SDF file with
gz sim -s MySDF.sdf
:and for
gz-sim-physics-system
,gz-sim-user-commands-system
,gz-sim-scene-broadcaster-system
,gz-sim-particle-emitter-system
...My Rbenv config:
Isssue appears in an ArduPilot forum post: https://discuss.ardupilot.org/t/how-to-use-gazebo-garden-for-sitl-simulation-of-ardupilot-on-apple-silicon/92390