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

Windows installation via conda-forge #185

Merged
merged 16 commits into from
Jan 21, 2021
116 changes: 95 additions & 21 deletions tutorials/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,14 @@

Next Tutorial: \ref cppgetstarted

# Overview

This tutorial describes how to install Ignition Math on Linux, Mac OS X and
Windows via either a binary distribution or from source.

[Install](#install)

* [Binary Install](#binary-install)

* [Source Install](#source-install)

* [Prerequisites](#prerequisites)

* [Building from Source](#building-from-source)

# Install

We recommend following the [Binary Install](#binary-install) instructions to get up and running as quickly and painlessly as possible.
These instructions are for installing only Ignition Math.
If you're interested in using all the Ignition libraries, check out this [Ignition installation](https://ignitionrobotics.org/docs/latest/install).

We recommend following the Binary Install instructions to get up and running as quickly and painlessly as possible.

The [Source Install](#source-install) instructions should be used if you need the very latest software improvements, you need to modify the code, or you plan to make a contribution.
The Source Install instructions should be used if you need the very latest software improvements, you need to modify the code, or you plan to make a contribution.

## Binary Install

Expand All @@ -30,13 +18,13 @@ The [Source Install](#source-install) instructions should be used if you need th
Setup your computer to accept software from
*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 -
```

Expand All @@ -49,13 +37,40 @@ sudo apt install libignition-math<#>-dev
Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
which version you need.

### Windows

Install [Conda package management system](https://docs.conda.io/projects/conda/en/latest/user-guide/install/download.html).
Miniconda suffices.

Create if necessary, and activate a Conda environment:

```
conda create -n ign-ws
conda activate ign-ws
```

Install:

```
conda install libignition-math<#> --channel conda-forge
```

Be sure to replace `<#>` with a number value, such as 1 or 2, depending on
which version you need.

## Source Install

Source installation can be performed in UNIX systems by first installing the
necessary prerequisites followed by building from source.
Source installation can be performed by first installing the necessary
prerequisites followed by building from source.

### Prerequisites

Ignition Math requires:

* [Ignition CMake](https://ignitionrobotics.org/libs/cmake)

#### Ubuntu Linux

The optional Eigen component of Ignition Math requires:

* [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page). Refer to the [Eigen Documentation](http://eigen.tuxfamily.org/index.php?title=Main_Page#Documentation) for installation instructions. On Ubuntu systems, `apt-get` can be used to install Eigen:
Expand All @@ -78,8 +93,22 @@ The optional Ruby tests of Ignition Math require:
sudo apt-get install swig
```

#### Windows 10

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.
mabelzhang marked this conversation as resolved.
Show resolved Hide resolved

The optional Eigen component of Ignition Math requires:

* [Eigen](http://eigen.tuxfamily.org/index.php?title=Main_Page). Refer to the [Eigen Documentation](http://eigen.tuxfamily.org/index.php?title=Main_Page#Documentation) for installation instructions. On Windows, we will use `conda` to install Eigen:

```
conda install eigen --channel conda-forge
```

### Building from source

#### Ubuntu

1. Clone the repository

```
Expand Down Expand Up @@ -107,3 +136,48 @@ The optional Ruby tests of Ignition Math require:
```
sudo make install
```

#### Windows

1. 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``).
Activate the Conda environment created in the prerequisites:

```
conda activate ign-ws
```

1. Install dependencies

You can view available versions and their dependencies:
```
conda search libignition-math* --channel conda-forge --info
```
See the [Conda release repository](https://github.com/conda-forge/libignition-math4-feedstock) for more information.

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-math#` (replace # with a number) to check out a specific version
git clone https://github.com/ignitionrobotics/ign-math.git
```

1. Configure and build

```
cd ign-math
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
```