diff --git a/tutorials/02_installation.md b/tutorials/02_installation.md index 4c69b642..473c68f0 100644 --- a/tutorials/02_installation.md +++ b/tutorials/02_installation.md @@ -1,16 +1,16 @@ \page installation Installation -This tutorial describes how to install Ignition Plugin on [Ubuntu Linux](#ubuntu_install) and [macOS](#macos_install) via either a binary distribution or from source. Support for Windows is coming soon. +This tutorial describes how to install Ignition Plugin via either a binary distribution or from source. +## Ubuntu -## Ubuntu ## {#ubuntu_install} - +### Prerequisites Ignition Plugin versions 1+ require Ubuntu Bionic, while version 0 can be used with Ubuntu Xenial. If you don't already have the `lsb-release` package installed, please do so now: -```{.sh} +``` sudo apt-get update sudo apt-get install lsb-release ``` @@ -18,37 +18,37 @@ sudo apt-get install lsb-release Setup your computer to accept software from [packages.osrfoundation.org](http://packages.osrfoundation.org): -```{.sh} +``` sudo sh -c 'echo "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-stable.list' ``` Setup keys: -```{.sh} +``` wget http://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add - ``` -Install Ignition Plugin +### Binary Install -```{.sh} +``` sudo apt-get update sudo apt-get install libignition-plugin-dev ``` -**Build from source** +### Source Install Run the following to install dependencies -```{.sh} +``` sudo apt-get install libignition-cmake2-dev ``` Clone the ign-plugin repository from GitHub -```{.sh} +``` git clone https://github.com/ignitionrobotics/ign-plugin ``` Then build using CMake -```{.sh} +``` cd ign-plugin mkdir build cd build @@ -57,7 +57,9 @@ make sudo make install ``` -## macOS ## {#macos_install} +## macOS + +### Prerequisites Ignition Plugin and several of its dependencies can be installed on macOS with [Homebrew](http://brew.sh/) using the [osrf/simulation @@ -65,37 +67,37 @@ tap](https://github.com/osrf/homebrew-simulation). Ignition Plugin versions 1+ require macOS High Sierra (10.13) or later, while version 0 supports Sierra (10.12) or later. -**Install Binaries using Homebrew** +### Install Binaries using Homebrew Install homebrew, which should also prompt you to install the XCode command-line tools: -```{.sh} +``` ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" ``` Run the following commands: -```{.sh} +``` brew tap osrf/simulation brew install ignition-plugin2 ``` -**Build from source using Homebrew** +### Build from source using Homebrew Run the following to install dependencies -```{.sh} +``` brew tap osrf/simulation brew install ignition-plugin2 --only-dependencies ``` Clone the ign-plugin repository from GitHub -```{.sh} +``` git clone https://github.com/ignitionrobotics/ign-plugin ``` Then build using CMake -```{.sh} +``` cd ign-plugin mkdir build cd build @@ -103,3 +105,66 @@ cmake .. make sudo make install ``` + +## Windows + +### Prerequisites + +First, follow the [ign-cmake](https://github.com/ignitionrobotics/ign-cmake) tutorial for installing Conda, Visual Studio, CMake, etc., prerequisites, and creating a Conda environment. + +Navigate to ``condabin`` if necessary to use the ``conda`` command (i.e., if Conda is not in your `PATH` environment variable. You can find the location of ``condabin`` in Anaconda Prompt, ``where conda``). + +Create if necessary, and activate a Conda environment: + +``` +conda create -n ign-ws +conda activate ign-ws +``` + +### Binary Install + +``` +conda install libignition-plugin<#> --channel conda-forge +``` + +Be sure to replace `<#>` with a number value, such as 1 or 2, depending on +which version you need. + +### Source Install + +1. Install Ignition dependencies: + +You can view available versions and their dependencies: + +``` +conda search libignition-plugin* --channel conda-forge --info +``` + +Install dependencies, replacing `<#>` with the desired version: + +``` +conda install libignition-cmake<#> --channel conda-forge +``` + +1. Navigate to where you would like to build the library, and clone the repository. + + ``` + # Optionally, append `-b ign-plugin#` (replace # with a number) to check out a specific version + git clone https://github.com/ignitionrobotics/ign-plugin.git + ``` + +1. Configure and build + + ``` + cd ign-plugin + mkdir build + cd build + cmake .. -DBUILD_TESTING=OFF # Optionally, -DCMAKE_INSTALL_PREFIX=path\to\install + cmake --build . --config Release + ``` + +1. Optionally, install + + ``` + cmake --install . --config Release + ```