-
Notifications
You must be signed in to change notification settings - Fork 121
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
Improve install instructions for macOS #414
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,33 +12,34 @@ The easiest way to get the sources of all libraries is to use | |
|
||
To compile all the different libraries and gz-sim in the right order | ||
[colcon](https://colcon.readthedocs.io/en/released/) is recommended. | ||
The colcon tool is available on all platforms using pip (or pip3, if pip fails). | ||
|
||
## Python3 from homebrew | ||
|
||
Tools and dependencies for Harmonic can be installed using the [homebrew package manager](https://brew.sh/). | ||
The homebrew tool can be installed by entering the following in a terminal: | ||
Tools and dependencies for Harmonic can be installed using the [Homebrew package manager](https://brew.sh/). After installing Homebrew, add the `osrf/simulation` to Homebrew tap to be able to install prebuilt dependencies. | ||
|
||
```bash | ||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" | ||
brew tap osrf/simulation | ||
brew update | ||
``` | ||
|
||
Harmonic is compatible with Python3; it can be installed by running the following in a terminal: | ||
### Install compiler requirements | ||
|
||
Building Gazebo Libraries require at least Xcode 10 on MacOS Mojave. The Xcode Command Line Tools are sufficient, and can be installed with: | ||
|
||
```bash | ||
brew install python3 | ||
xcode-select --install | ||
``` | ||
|
||
## vcstool and colcon from pip | ||
## Python 3 from Homebrew | ||
|
||
PIP is available on all platforms: | ||
Harmonic is compatible with Python 3. Install the latest version from Homebrew: | ||
|
||
```bash | ||
python3 -m pip install vcstool | ||
brew install python3 | ||
``` | ||
|
||
## vcstool and colcon from PyPI | ||
|
||
```bash | ||
python3 -m pip install -U colcon-common-extensions | ||
python3 -m pip install -U colcon-common-extensions vcstool | ||
``` | ||
|
||
## Getting the sources | ||
|
@@ -55,7 +56,7 @@ All the sources of gazebo-harmonic are declared in a yaml file. Download | |
it to the workspace: | ||
|
||
```bash | ||
curl -O https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-harmonic.yaml | ||
curl -OL https://raw.githubusercontent.com/gazebo-tooling/gazebodistro/master/collection-harmonic.yaml | ||
``` | ||
|
||
Use `vcstool` to automatically retrieve all the Gazebo libraries sources from | ||
|
@@ -69,19 +70,10 @@ The src subdirectory should contain all the sources ready to be built. | |
|
||
## Install dependencies | ||
|
||
Add `osrf/simulation` to Homebrew formulae | ||
|
||
```bash | ||
brew update | ||
brew tap osrf/simulation | ||
``` | ||
|
||
Install all dependencies: | ||
|
||
Dependency for Ogre: | ||
|
||
```bash | ||
brew install xquartz --cask | ||
brew install --cask xquartz | ||
``` | ||
|
||
General dependencies: | ||
|
@@ -90,42 +82,18 @@ General dependencies: | |
brew install assimp boost bullet cmake cppzmq [email protected] doxygen eigen fcl ffmpeg flann freeimage freetype gdal gflags google-benchmark gts ipopt jsoncpp libccd libyaml libzzip libzip nlopt ode open-scene-graph ossp-uuid ogre1.9 ogre2.3 pkg-config protobuf qt@5 qwt-qt5 rapidjson ruby tbb tinyxml tinyxml2 urdfdom zeromq | ||
``` | ||
|
||
`[email protected]` and `qt@5` are not sym-linked. To use those dependencies when building | ||
`gz-physics7` and `gz-gui8`, run the following after installation: | ||
|
||
For Macs with Intel processors, add them to `/usr/local`: | ||
`[email protected]` and `qt@5` are "keg only" Homebrew formulae and their paths must be explicitly configured before building Gazebo: | ||
|
||
```bash | ||
# [email protected] | ||
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr/local/opt/[email protected] | ||
export DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH}:/usr/local/opt/[email protected]/lib:/usr/local/opt/octomap/local | ||
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/usr/local/opt/[email protected]/lib/pkgconfig | ||
# qt@5 | ||
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/usr/local/opt/qt@5 | ||
``` | ||
|
||
Note if you are on an ARM based Apple Silicon Mac machine, you will need to add them to `/opt/homebrew` instead: | ||
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:+$CMAKE_PREFIX_PATH:}`brew --prefix [email protected]` | ||
export DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH:+$DYLD_FALLBACK_LIBRARY_PATH:}`brew --prefix [email protected]`/lib:`brew --prefix octomap`/local | ||
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH:+$PKG_CONFIG_PATH:}`brew --prefix [email protected]`/lib/pkgconfig | ||
|
||
```bash | ||
# [email protected] | ||
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/opt/homebrew/opt/[email protected] | ||
export DYLD_FALLBACK_LIBRARY_PATH=${DYLD_FALLBACK_LIBRARY_PATH}:/opt/homoebrew/opt/[email protected]/lib:/opt/homebrew/opt/octomap/local | ||
export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:/opt/homebrew/opt/[email protected]/lib/pkgconfig | ||
# qt@5 | ||
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH}:/opt/homebrew/opt/qt@5 | ||
export CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:+$CMAKE_PREFIX_PATH:}`brew --prefix qt@5` | ||
``` | ||
|
||
### Install compiler requirements | ||
|
||
The Gazebo Libraries require the Xcode 10 compiler on MacOS Mojave. | ||
|
||
On Mac machines, gcc is acquired by installing Xcode command line tools. | ||
The required version of Xcode for Harmonic is Xcode 10.3, which can be downloaded from | ||
[Apple Developer Site](https://developer.apple.com/download/more/). | ||
You will need to sign in to your Apple account and download the Mojave version of | ||
Xcode command line tools. Command line tools can also be obtained by downloading | ||
Xcode from the Apple App Store (installing the full app may take over an hour). | ||
|
||
## Building the Gazebo Libraries | ||
|
||
Once the compiler and all the sources are in place it is time to compile them. | ||
|
@@ -184,16 +152,16 @@ If there are no errors, all the binaries should be ready to use. | |
|
||
The workspace needs to be sourced every time a new terminal is used. | ||
|
||
Run the following command to source the workspace in bash: | ||
Run the following command to source the workspace in zsh (the default macOS shell): | ||
|
||
```bash | ||
. ~/workspace/install/setup.bash | ||
```zsh | ||
. ~/workspace/install/setup.zsh | ||
``` | ||
|
||
Or in zsh: | ||
Or if you are using bash: | ||
|
||
```zsh | ||
. ~/workspace/install/setup.zsh | ||
```bash | ||
. ~/workspace/install/setup.bash | ||
``` | ||
|
||
You should now be able to launch gazebo: | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure why you changed the syntax to
${CMAKE_PREFIX_PATH:+$CMAKE_PREFIX_PATH:}
. I think it's easier to read the original syntax. I also think it's a little easier to read the$(...)
instead of backticksThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
${CMAKE_PREFIX_PATH:+$CMAKE_PREFIX_PATH:}
is the unfortunate shell (Bash, Zsh) syntax for "append a : delimiter after the variable if it has a value". Otherwise ifCMAKE_PREFIX_PATH
is not set and you write${CMAKE_PREFIX_PATH}:/opt/homebrew
you get:/opt/homebrew
.