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

Update instances of conda with mamba in docs #3370

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

[![Ubuntu version](https://img.shields.io/badge/ubuntu-(PPA)-blue?logo=debian)](https://nest-simulator.readthedocs.io/en/latest/installation/)
[![Fedora package](https://img.shields.io/fedora/v/nest?logo=fedora)](https://src.fedoraproject.org/rpms/nest)
[![Conda version](https://img.shields.io/conda/vn/conda-forge/nest-simulator.svg?logo=conda-forge&logoColor=white)](https://anaconda.org/conda-forge/nest-simulator)
[![conda-forge version](https://img.shields.io/conda/vn/conda-forge/nest-simulator.svg?logo=conda-forge&logoColor=white)](https://anaconda.org/conda-forge/nest-simulator)
[![Homebrew version](https://img.shields.io/homebrew/v/nest.svg?logo=apple)](https://formulae.brew.sh/formula/nest)
[![Docker Image Version](https://img.shields.io/docker/v/nest/nest-simulator?color=blue&label=docker&logo=docker&logoColor=white&sort=semver)](https://hub.docker.com/r/nest/nest-simulator)
[![Virtual applicance](https://img.shields.io/badge/VM-v3.7-blue?logo=CodeSandbox)](https://nest-simulator.readthedocs.io/en/latest/installation/livemedia.html#live-media)
Expand Down Expand Up @@ -127,5 +127,3 @@ to find out how to install NEST.
Please cite NEST if you use it in your work.

- You can find all the information for [citing NEST here](https://nest-simulator.readthedocs.io/en/latest/citing-nest.html)


6 changes: 3 additions & 3 deletions doc/htmldoc/connect_nest/nest_server.rst
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ For native installations, the requirements can be simply installed via ``pip``::

pip3 install Flask Flask-Cors gunicorn RestrictedPython

or by installing the full NEST development environment in case you prefer using ``conda``::
or by installing the full NEST development environment in case you prefer using ``mamba``::

cd <nest-source-dir>
conda env create -p conda/
conda activate conda/
mamba env create -p mamba/
mamba activate mamba/

As an alternative to a native installation, NEST Server is available from the NEST Docker image. Please check out the
corresponding :ref:`installation instructions <docker>` for more details.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ please follow the guidelines below:

* the steps you took that lead to the problem.
* the specific error messages you get.
* relevant system and version information (e.g., Ubuntu 22.04/ NEST 3.5 installed using the Conda package).
* relevant system and version information (e.g., Ubuntu 22.04/ NEST 3.8 installed using the conda-forge package).

#. Keep topics separate.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,30 +84,38 @@ If you have not done so alrealdy first
Set up your environment
~~~~~~~~~~~~~~~~~~~~~~~

Using the Conda package (includes everything to build NEST, including documentation)
````````````````````````````````````````````````````````````````````````````````````
Using the conda-forge package (includes everything to build NEST, including documentation)
```````````````````````````````````````````````````````````````````````````````````````````

For details on Conda, see :ref:`conda_tips`
For details on installation see :ref:`conda_forge_install`

.. code-block:: bash

cd <nest_source_dir>/
conda env create -p conda/
conda activate conda/
mamba env create -p mamba/
mamba activate mamba/

If you later on want to deactivate or delete the build environment:

.. code-block:: bash

conda deactivate
rm -rf conda/
mamba deactivate
rm -rf mamba/

Using pip (includes packages for documentation only)
````````````````````````````````````````````````````

If you want to install only a minimal set of packages for building the
documentation and avoid using Conda, you can use pip:

Create and activate a Python virtual environment:

.. code-block:: bash

python -m venv <myvenv>

source <myvenv>/bin/activate

.. code-block:: bash

pip3 install -r <nest_source_dir>/doc/requirements.txt
Expand Down
16 changes: 8 additions & 8 deletions doc/htmldoc/developer_space/workflows/nest_with_ides.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Requirements and limitations
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

* Focus on single build configuration
* Assumes all dependencies (OpenMPI, GSL, etc) installed in a Conda environment
* Assumes all dependencies (OpenMPI, GSL, etc) installed in a Mamba environment
* Does not support debugging on macOS (because Eclipse does not support lldb)
* Does not read the NEST `.clang-format` file, so code formatting may
be incorrect
Expand Down Expand Up @@ -62,25 +62,25 @@ Setting up the project
#. Right click the project and choose ``Properties`` from the context
menu

a. Under ``C/C++ Build/Build Variables``, define ``BUILD_DIR`` and ``CONDA_ENV``,
a. Under ``C/C++ Build/Build Variables``, define ``BUILD_DIR`` and ``MAMBA_ENV``,
both of type ``Path``. The first should contain the full path to the build
directory you created above, the second the full path to your conda
environment, usually something like ``.../miniconda3/envs/nest-dev``.
directory you created above, the second the full path to your mamba
environment, usually something like ``.../mamba/envs/nest-dev``.
#. Under ``C/C++ Build – [Tab] Builder Settings``,

#. uncheck ``Use default build command``
#. set ``Build Command`` to ``make -k -j4 all install`` (adjust
number of processes to your situation)
#. set ``Build Directory`` to ``${BUILD_DIR}``
#. Under ``C/C++ Build > Environment``, prepend
``${CONDA_ENV}/bin`` to ``PATH``
``${MAMBA_ENV}/bin`` to ``PATH``
#. Under ``C/C++ General > Paths and Symbols – [Tab] Includes``, add the
following two direcories

* ``${BUILD_DIR}/libnestutil`` (contains ``config.h``)
* ``${CONDA_ENV}/include`` (all headers from packages provided in conda environment)
* ``${mamba_env}/include`` (all headers from packages provided in Mamba environment)
#. Under ``PyDev - Interpreter/Grammar``, choose the interpreter from
your Conda environment (you may need to add it by following the
your Mamba environment (you may need to add it by following the
``Click here to configure an interpreter not listed`` link and
then ``Browse for python/pypy exe`` (this temporarily takes you
to the global Eclipse preferences in a separate window).
Expand Down Expand Up @@ -261,7 +261,7 @@ We need several packages installed, before we can become productive with NEST:
* gsl
* cmake
* libtool
* ipython, python, cython, ... The best way to install all the python requirements is to use `Anaconda <https://store.continuum.io/cshop/anaconda/>`_.
* ipython, python, cython, ... The best way to install all the python requirements is to use `Mamba <https://mamba.readthedocs.io/en/latest/index.html/>`_.

We present two ways to install the rest: MacPorts and Homebrew. For both versions you need to have Xcode and Xcode command line tools installed:

Expand Down
29 changes: 13 additions & 16 deletions doc/htmldoc/installation/conda_forge.rst
Original file line number Diff line number Diff line change
@@ -1,61 +1,58 @@
.. _conda_forge_install:

Conda forge install
conda-forge install
===================

.. admonition:: osx-arm64: missing random number generators

Due to a cross-compiling issue in the conda NEST package, some random number
generators are not available if you are using macOS arm64 architecture.
Due to a cross-compiling issue in the conda-forge NEST package, some random number
generators are not available if you are using macOS arm64 architecture.
The available generators are the Mersenne Twister generators `mt19937` and `mt19937_64`.

.. note::

If you encounter problems installing the NEST conda package and
environment, we recommend using Mamba (https://mamba.readthedocs.io).
We recommend using Mamba (https://mamba.readthedocs.io).
Mamba has the advantage of installing conda packages and
environments more quickly and can be used as a complete drop-in replacement for conda.

1. To keep your conda setup tidy, we recommend that you install NEST into
a separate `conda environment <https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`_
1. To keep your mamba setup tidy, we recommend that you install NEST into
a separate environment
together with Python packages that you will use when working with NEST;
see also our :ref:`conda_tips`.

To install the latest version of NEST in a new environment called ``ENVNAME``, just run

.. code-block:: sh

conda create --name ENVNAME -c conda-forge nest-simulator
mamba create --name ENVNAME -c conda-forge nest-simulator

To install additional packages into the environment, just list them together with ``nest-simulator``.

.. code-block:: sh

conda create --name ENVNAME -c conda-forge nest-simulator jupyterlab seaborn
mamba create --name ENVNAME -c conda-forge nest-simulator jupyterlab seaborn

#. To see all NEST versions available via conda, either run

.. code-block:: sh

conda search -c conda-forge nest-simulator
mamba search -c conda-forge nest-simulator

or browse the `conda forge file list
<https://anaconda.org/conda-forge/nest-simulator/files>`_ (note
there are multiple pages). To install, e.g., NEST 2.18.0, run
To install a specific version e.g., NEST 2.18.0, run

.. code-block:: sh

conda create --name nest_2_18_0 -c conda-forge nest-simulator=2.18.0=*
mamba create --name nest_2_18_0 -c conda-forge nest-simulator=2.18.0=*

The syntax for this install follows the pattern: ``nest-simulator=<version>=<build_string>``.

#. Activate your environment:

.. code-block:: sh

conda activate ENVNAME
mamba activate ENVNAME

#. Note the following:

- We currently provide NEST with thread-based parallelization on conda. This should suffice for most
- We currently provide NEST with thread-based parallelization on conda-forge. This should suffice for most
uses on personal computers.
66 changes: 25 additions & 41 deletions doc/htmldoc/installation/conda_tips.rst
Original file line number Diff line number Diff line change
@@ -1,35 +1,27 @@
.. _conda_tips:

Tips for installing NEST with conda
Tips for installing NEST with Mamba
===================================

.. note::
.. note::

If you encounter problems installing the NEST conda package and
environment, we recommend using Mamba (https://mamba.readthedocs.io).
Mamba has the advantage of installing conda packages and
We recommend using Mamba (https://mamba.readthedocs.io).
Mamba has the advantage of installing conda packages and
environments more quickly and can be used as a complete drop-in replacement for conda.

This page provides a series of recommendations for installing pre-built NEST with
conda or to set up conda environments for building NEST and NEST documentation.

Basic conda setup
Basic mamba setup
-----------------

Choice of conda base installation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We test NEST in conda environments using Miniconda installations and thus recommend
that you do the same. The recommendations that we provide here will also likely work with a
full-sized Anaconda installation, but we can only provide limited support for this.

You can either install
Apple systems
~~~~~~~~~~~~~

- Miniconda from `<https://docs.conda.io/en/latest/miniconda.html>`_
- Miniforge from `<https://github.com/conda-forge/miniforge>`_

For Apple systems with an M1 chip, you must at present use Miniforge and
select the ``arm64 (Apple Silicon)`` installer to create a conda environment
For Apple systems with an M1 chip, you must at present use `Miniforge
<https://github.com/conda-forge/miniforge>`_ and
select the ``arm64 (Apple Silicon)`` installer to create a mamba environment
that will support native builds of NEST.


Expand All @@ -38,32 +30,29 @@ Keep your base environment empty

Your base environment should be as empty as possible in order to avoid
conflicts with other environments. Always install packages only in the new
environments (don't worry about duplicates, conda will link the packages
environments (don't worry about duplicates, mamba will link the packages
if they are used in multiple environments, and not produce disk eating copies).


Get familiar with conda environments
Get familiar with mamba environments
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Conda environments are a powerful tool. See the `Conda documentation on Managing Environments
<https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`_
for more information.

To see which environments are installed on your system, use

.. code:: sh

conda info --envs
mamba info --envs


Installing NEST with Conda
--------------------------
Installing NEST with conda-forge
--------------------------------

We provide pre-built versions of NEST on `Conda Forge <https://anaconda.org/conda-forge/nest-simulator/files>`_.
Follow :ref:`these instructions to install NEST from Conda Forge <conda_forge_install>`.
We provide pre-built versions of NEST on `conda-forge <https://conda-forge.org/docs/>`_.
Follow :ref:`these instructions to install NEST from conda-forge <conda_forge_install>`.


Creating a Conda environment for running and building NEST
Creating a mamba environment for running and building NEST
----------------------------------------------------------

If you want to compile NEST yourself, you can create an environment containing all necessary
Expand All @@ -72,31 +61,26 @@ software for running and building NEST by executing the following command from t
.. code:: sh

cd <nest-source-dir>
conda env create -p conda
mamba env create -p mamba

This will create an environment in the folder ``conda/``. If you would like to activate the environment, use
This will create an environment in the folder ``mamba/``. If you would like to activate the environment, use

.. code:: sh

conda activate conda/
mamba activate mamba/

Note that the trailing slash is required for conda not to confuse the path with a named environment (for example when
Note that the trailing slash is required for mamba not to confuse the path with a named environment (for example when
using ``--name``).


Get a good overview
-------------------

Obtain a good overview of which packages are installed where. You can use
``conda env export -n base`` and ``conda env export -n yournestenv``
``mamba env export -n base`` and ``mamba env export -n yournestenv``
(replacing the ``yournestenv`` name with whatever you chose). Make
sure each environment contains all dependencies. One way to make
this obvious would be to reduce conda stack to ``0`` (see conda documentation on
`nested activation <https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#nested-activation>`_),
and/or to a certain degree by not auto-activating the base environment (see conda documentation on
`conda init <https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#conda-init>`_).
Then packages from base do not 'leak' into your new environments.
sure each environment contains all dependencies.

.. note::
Packages from your system will usually also be available in your conda
Packages from your system will usually also be available in your mamba
environment and may cause similar conflicts.
23 changes: 9 additions & 14 deletions doc/htmldoc/installation/condaenv_install.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
.. _condaenv:

Install from source in a conda environment
Install from source in a mamba environment
==========================================

.. note::
.. note::

If you encounter problems installing the NEST conda package and
environment, we recommend using Mamba (https://mamba.readthedocs.io).
Mamba has the advantage of installing conda packages and
We recommend using Mamba (https://mamba.readthedocs.io).
Mamba has the advantage of installing conda packages and
environments more quickly and can be used as a complete drop-in replacement for conda.

* Create a conda environment from the `environment.yml <https://github.com/nest/nest-simulator/blob/master/environment.yml>`_ file.
We recommend specifying a dedicated location (``-p <path/to/conda/env>``) for your environment.
See the `conda documentation <https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#specifying-a-location-for-an-environment>`_
on using a custom location rather than the default envs folder.
* Create a mamba environment from the `environment.yml <https://github.com/nest/nest-simulator/blob/master/environment.yml>`_ file.
We recommend specifying a dedicated location (``-p <path/to/mamba/env>``) for your environment.

.. code-block:: sh

conda env create -f nest-simulator/environment.yml --p <path/to/conda/env>
conda activate <path/to/conda/env>
mamba env create -f nest-simulator/environment.yml --p <path/to/mamba/env>
mamba activate <path/to/mamba/env>

* Create a build directory:

Expand All @@ -32,7 +29,7 @@ Install from source in a conda environment

cd build_dir

* Configure NEST. Add the cmake option ``-CDMAKE_INSTALL_PREFIX:PATH=$CONDA_PREFIX`` to link nest to your active conda environment.
* Configure NEST. Add the cmake option ``-CDMAKE_INSTALL_PREFIX:PATH=$CONDA_PREFIX`` to link nest to your active mamba environment.
You may need additional ``cmake`` options (see :ref:`cmake_options`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The environment variable is still $CONDA_PREFIX. Maybe on other places, too.


.. code-block:: sh
Expand Down Expand Up @@ -60,5 +57,3 @@ sourcing the script:
.. note::

To build the developer or user documentation see :ref:`doc_workflow`


Loading
Loading