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

Add Windows installation; move installation in README to tutorial #146

Merged
merged 13 commits into from
Jan 21, 2021
70 changes: 1 addition & 69 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ encoding/decoding to thread pools.

[Install](#install)

* [Binary Install](#binary-install)

* [Source Install](#source-install)

* [Prerequisites](#prerequisites)

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

[Usage](#usage)

[Documentation](#documentation)
Expand Down Expand Up @@ -68,67 +60,7 @@ callback system.

# Install

We recommend following the [Binary Install](#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.

## Binary Install

On Ubuntu systems, `apt-get` can be used to install `ignition-common`:

```
sudo apt install libignition-common<#>-dev
```

Be sure to replace `<#>` with a number value, such as 2 or 3, 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.

### Prerequisites

Ignition Common requires:

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

The Graphics component requires:

* [FreeImage](http://freeimage.sourceforge.net/)
* [GTS](http://gts.sourceforge.net/).

The AV component requires:

* [libswscale](https://www.ffmpeg.org/libswscale.html)
* [libavdevice](https://www.ffmpeg.org/libavdevice.html)
* [libavformat](https://www.ffmpeg.org/libavformat.html)
* [libavcodec](https://www.ffmpeg.org/libavcodec.html)
* [libavutil](https://www.ffmpeg.org/libavutil.html)

### Building from source

1. Clone the repository

```
git clone https://github.com/ignitionrobotics/ign-common
```

2. Install the [Prerequisites](#prerequisites).

3. Configure and build

```
cd ign-common; mkdir build;cd build; cmake ..; make
```

4. Optionally, install Ignition Common

```
sudo make install
```
See the [installation tutorial](https://ignitionrobotics.org/api/common/3.9/tutorials.html).

# Usage

Expand Down
1 change: 1 addition & 0 deletions tutorials.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Ignition @IGN_DESIGNATION_CAP@ library and how to use the library effectively.

**The tutorials**

1. \subpage install "Installation"
1. \subpage profiler "Profiler"

## License
Expand Down
141 changes: 141 additions & 0 deletions tutorials/install.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
\page install Installation

Next Tutorial: \ref profiler

These instructions are for installing only Ignition Common.
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 Installation instructions to get up and running as quickly and painlessly as possible.

The Source Installation 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 Installation

## Ubuntu

On Ubuntu systems, `apt-get` can be used to install `ignition-common`:
```
sudo apt install libignition-common<#>-dev
```

Be sure to replace `<#>` with a number value, such as 2 or 3, 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 `ignition-common`:
```
conda install libignition-common<#> --channel conda-forge
```

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

# Source Installation

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

## Prerequisites

Ignition Common requires:

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

The Graphics component requires:

* [FreeImage](http://freeimage.sourceforge.net/)
* [GTS](http://gts.sourceforge.net/).

The AV component requires:

* [libswscale](https://www.ffmpeg.org/libswscale.html)
* [libavdevice](https://www.ffmpeg.org/libavdevice.html)
* [libavformat](https://www.ffmpeg.org/libavformat.html)
* [libavcodec](https://www.ffmpeg.org/libavcodec.html)
* [libavutil](https://www.ffmpeg.org/libavutil.html)

### Windows

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`).

Activate the Conda environment:
```
conda activate ign-ws
```

Install prerequisites:
```
conda install freeimage gts glib dlfcn-win32 ffmpeg --channel conda-forge
```

Install Ignition dependencies:

You can view available versions and their dependencies:
```
conda search libignition-common* --channel conda-forge --info
```

Install dependencies, replacing `<#>` with the desired versions:
```
conda install libignition-cmake<#> libignition-math<#> --channel conda-forge
```

## Build from Source

### Ubuntu

1. Clone the repository
```
git clone https://github.com/ignitionrobotics/ign-common
```

2. Configure and build
```
cd ign-common
mkdir build
cd build
cmake ..
make
```

3. Optionally, install
```
sudo make install
```

### Windows

This assumes you have created and activated a Conda environment while installing the Prerequisites.

1. Navigate to where you would like to build the library, and clone the repository.
```
# Optionally, append `-b ign-common#` (replace # with a number) to check out a specific version
git clone https://github.com/ignitionrobotics/ign-common.git
```

2. Configure and build
```
cd ign-common
mkdir build
cd build
cmake .. -DBUILD_TESTING=OFF # Optionally, -DCMAKE_INSTALL_PREFIX=path\to\install
cmake --build . --config Release
```

3. Optionally, install
```
cmake --install . --config Release
```
13 changes: 6 additions & 7 deletions tutorials/profiler.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,15 @@ If the profiler is run successfully, you should see output in a browser. Similar
If you see ``connection error``, there are a couple of things to double check
1. Was the profiler enabled when the project you're trying to run was compiled? Note that this isn't the case if you installed Ignition libraries from binaries, for example. You need to compile the project from source with the `ENABLE_PROFILER` variable set.
2. Are you using the correct port number in the upper left corner ``Connection Addresss: ws://127.0.0.1:1500/rmt``? Running ``ign gazebo -v 4`` will show the port number in use near the top of the outputted text. The port number will be printed out if the profiler is enabled.

```{.sh}
[Dbg] [RemoteryProfilerImpl.cc:187] Starting ign-common profiler impl: Remotery (port: 1500)
```
```{.sh}
[Dbg] [RemoteryProfilerImpl.cc:187] Starting ign-common profiler impl: Remotery (port: 1500)
```
3. Are you running the program in a separate terminal? The profiler only establishes connection if there is a program running and being actively profiled.

4. If you want to use a different port, configure the environment variable `RMT_PORT` by running the following in terminal, and update the web viewer port in your browser accordingly (see 2 above)
```{.sh}
export RMT_PORT=1500
```
```{.sh}
export RMT_PORT=1500
```


## Using the Profiler
Expand Down