Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apple support for ign command line tool #25

Closed
1 task done
osrf-migration opened this issue May 15, 2019 · 11 comments
Closed
1 task done

Apple support for ign command line tool #25

osrf-migration opened this issue May 15, 2019 · 11 comments
Assignees
Labels
bug Something isn't working macOS macOS support

Comments

@osrf-migration
Copy link

Original report (archived issue) by Nate Koenig (Bitbucket: Nathan Koenig).


Prerequisites

  • Put an X between the brackets on this line if you have done all of the following:

Description

The UNIT_ign_TEST fails on Apple, through homebrew, when using the ign gazebo command line tool. In general, the ign gazebo command line tool fails to load the libignition-gazebo2-ign.dylib. Other packages, such as ign-transport and ign-msgs work fine. There might be a problem associated with loading a component library.

Steps to Reproduce

  1. Change the src/ign_TEST.cc to use ign gazebo instead of ign-gazebo.
  2. Install gazebo on homebrew
  3. Run the /bin/UNIT_ign_TEST test.

Expected behavior:

The test should pass.

Actual behavior:

The test fails

Reproduces how often:

All the time.

Versions

Gazebo 2+

Additional Information

@osrf-migration
Copy link
Author

Original comment by Louise Poubel (Bitbucket: chapulina, GitHub: chapulina).


Pull request #431 removes gflags completely from ign-gazebo3, which means OSX would be left without an alternative until this is solved.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


This bug is kinda odd because other ign commands like ign transport and ign msg work just fine on macOS. One difference is that the implementation of ign gazebo functionality is in the ign-gazebo2-ign component library that must be dynamically linked to the main library. The ign log command is similar in that it uses a component library that is linked to the main library. I tested ign log record on high sierra and mojave, and it works on high sierra but fails on mojave as follows:

$ ign log record
Library error: [/usr/local/Cellar/ignition-transport7/7.1.0_1/lib/libignition-transport7-log.7.1.0.dylib] not found.

It's hard to find documentation about the changes in SIP from 10.13 to 10.14, but I believe that starting in 10.14 any binaries in /usr/bin will ignore the DYLD_LIBRARY_PATH. This is relevant because ign uses /usr/bin/ruby, and I believe it explains why it can't load the component libraries.

As a test, I installed another ruby implementation with brew install ruby and modified the shebang line of /usr/local/bin/ign to point to that other ruby in /usr/local, and it was successful!

So I think this is a clear diagnosis of the problem, though I don't have a suggested solution at this point.

@osrf-migration
Copy link
Author

Original comment by Silvio Traversaro (Bitbucket: traversaro).


I may be a bit OT, but as far as I understand, the same problem will apply to Windows as well. Even if now ignition-gazebo is not supported/tested on Windows, I assume that there is interest in supporting Windows in the future.
Unfortunately, the Ruby situation in Windows is even worse. The default binaries available from https://rubyinstaller.org/ are compiled with a MinGW-w64-based toolchain, so they cannot load libraries compiled with Visual Studio, such as the Ignition Math bindings. As far as I understand in theory it is possible to compile Ruby with Visual Studio (see https://github.com/ruby/ruby/blob/master/win32/README.win32), but then it will be necessary to ship a custom Ruby interpreter just to use ignition-gazebo, and this distribution will not be compatible with most gems from RubyGems, that instead assume the MinGW-w64-based DevKit.
Related comment: conda-forge/ruby-feedstock#30 (comment) .

cc Sean Yen (seanyen-msft)

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


@IeiuniumLux the assimp error is different. it means that bottles are out of sync with each other. try brew outdated to see if any bottles (like [email protected]) are old. I rebuilt some recently

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


brew outdated is just a debugging step. try brew upgrade ignition-physics, which should upgrade several dependencies as well

@osrf-migration
Copy link
Author

Original comment by Alfredo Bencomo (Bitbucket: bencomo, GitHub: IeiuniumLux).


Thanks @scpeters . This is not a priority for me right now so I’ll try it again when Citadel is released.

@osrf-migration
Copy link
Author

@scpeters
Copy link
Member

scpeters commented Dec 8, 2020

I have been successful with ign gazebo -s when invoked with the homebrew version of ruby and have added this as a test command to the ignition-gazebo* formulae in osrf/homebrew-simulation#1221

@scpeters
Copy link
Member

scpeters commented Dec 8, 2020

I am debugging the UNIT_ign_TEST on macOS to see if we can enable at least part of it

@scpeters
Copy link
Member

scpeters commented Dec 9, 2020

I've enabled UNIT_ign_TEST on macOS in #477 by making use of the homebrew ruby formula. It also should provide more helpful error messages if a library fails to load

@chapulina
Copy link
Contributor

Closed by #477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working macOS macOS support
Projects
None yet
Development

No branches or pull requests

3 participants