Skip to content

Commit

Permalink
Update conda instructions to use miniforge and conda instead of mamba…
Browse files Browse the repository at this point in the history
…forge and mamba (#364)
  • Loading branch information
traversaro authored Oct 30, 2024
1 parent 8cb4412 commit 1c2334b
Showing 1 changed file with 12 additions and 19 deletions.
31 changes: 12 additions & 19 deletions docs/sw_installation/conda_binaries.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,24 @@ We provide binary packages for Linux, macOS and Windows of the software containe
## Install a conda distribution

If you do not have a conda distribution on your system, we suggest to use the minimal
[`mambaforge`](https://github.com/conda-forge/miniforge#mambaforge) distribution, that uses `conda-forge` packages by default and installs the [`mamba`](https://github.com/mamba-org/mamba) command by default.

To install `mambaforge`, please follow the instructions [`install-mambaforge`](https://github.com/robotology/robotology-superbuild/blob/master/doc/install-mambaforge.md) in robotology-superbuild documentation.

Even if you are not using `mambaforge` and you are using instead a different `conda` distribution, to follow the instructions on this document you need to install the `mamba` package in your `base` environment. [`mamba`](https://github.com/mamba-org/mamba) is a re-implementation of some functionalities of the `conda` package manager, that is much faster.
[`miniforge`](https://github.com/conda-forge/miniforge) distribution, that uses `conda-forge` packages by default.

To install `miniforge`, please follow the instructions [`install-miniforge`](https://github.com/robotology/robotology-superbuild/blob/master/doc/install-miniforge.md) in robotology-superbuild documentation.

## Create an environment

Differently from `apt` and `homebrew`, the `conda` package manager is an `environment`-oriented package manager, meaning that packages are not
installed in some global location, but rather you install packages in an `environment` (that is just a directory in your filesystem), so that you
can easily have multiple different environments with different packages installed on your system. To read more about this, check https://docs.conda.io/projects/conda/en/4.6.1/user-guide/tasks/manage-environments.html .

For this reason, to use the robotology conda packages it is suggested to first create a conda environment, and then install in it all the packages you want to use. To create a new environment called `robotologyenv`, execute the following command:
~~~
mamba create -n robotologyenv
conda create -n robotologyenv
~~~

Once you created the `robotologyenv` environment, you can "activate" it for the current terminal (i.e. make sure that the installed packages can be found) by the command:
~~~
mamba activate robotologyenv
conda activate robotologyenv
~~~

!!! note
Expand All @@ -40,28 +38,23 @@ mamba activate robotologyenv

Once you are in an activated environment, you can install robotology packages by just running the command:
~~~
mamba install -c conda-forge -c robotology <packagename>
conda install -c conda-forge -c robotology <packagename>
~~~

The list of available packages is available at https://anaconda.org/robotology/repo .
Some conda packages of software contained in the `robotology-superbuild` are contained in the `conda-forge` channel, while others in `robotology` channel.
When a package is available in both, the `conda-forge` channel contains the most updated version, so always ensure that the `conda-forge` channel as an higher priority w.r.t. to the `robotology` channel.

For example, if you want to install yarp and icub-main, you simple need to install:
~~~
mamba install -c conda-forge -c robotology yarp icub-main
conda install -c conda-forge -c robotology yarp icub-main
~~~

In addition, if you want to simulate the iCub in Gazebo, you should also install `icub-models` and `gazebo-yarp-plugins`:
In addition, if you want to simulate the iCub in Gazebo Classic, you should also install `icub-models` and `gazebo-yarp-plugins`:
~~~
mamba install -c conda-forge -c robotology gazebo-yarp-plugins icub-models
conda install -c conda-forge -c robotology gazebo-yarp-plugins icub-models
~~~

If you want to develop some C++ code on the top of these libraries, it is recommended to also install the necessary compiler and development tools directly in the same environment:
~~~
mamba install -c conda-forge compilers cmake pkg-config make ninja
~~~

If you want instead install all the robotology distro just:

~~~
mamba install -c robotology robotology-distro
conda install -c conda-forge compilers cmake pkg-config make ninja
~~~

0 comments on commit 1c2334b

Please sign in to comment.