Avalon-Benchmark / avalon

A 3D video game environment and benchmark designed from scratch for reinforcement learning research
https://generallyintelligent.com/avalon/
GNU General Public License v3.0
175 stars 16 forks source link

Fix "realpath command not found" error on Mac #7

Closed Elijas closed 1 year ago

Elijas commented 1 year ago

Issue

When running on Mac, quickstart resulted in realpath command not found crash at avalon/datagen/godot/datagen.sh (Line 16).

Solution

This was solved with brew install coreutils.

mx781 commented 1 year ago

Thanks for pointing out the dependency and the initiative on the PR @Elijas! I think we'd prefer to adapt datagen.sh to work across platforms instead of introducing an extra dependency for Mac users (and additionally, requiring Homebrew/MacPorts). It seems there are a few portable implementations of realpath that we could use here.

I'll keep the PR open as a good solution for now, but we'll look into doing it that way instead of merging this. More than happy to accept that approach as a PR instead if you like!

enorms commented 1 year ago

I also encountered some issues with Mac setup, and along the way made an implementation of this. I define realpath using the implementation shared above, then use that when invoking the function.

So, save the shared implementation as a new file like ./utils/realpath.sh. Then add an import to the top of ./datagen.sh like source $(dirname "$0")/utils/realpath.sh. Directory looks like:

.
├── godot
│   ├── datagen.sh
│   └── utils
│       └── realpath.sh

Code is here, feel free to make use of it is that is helpful.