Skip to content

Commit

Permalink
Add more Linux distribution specific installation procedures (pybamm-…
Browse files Browse the repository at this point in the history
…team#3914)

* added more linux distros in installation docs

* added distro specific installation documentation

* Apply suggestions from code review

Co-authored-by: Agriya Khetarpal <[email protected]>

* Apply suggestions from code review

Co-authored-by: Arjun Verma <[email protected]>

* resolved reviews

* Apply suggestions from code review

Co-authored-by: Eric G. Kratz <[email protected]>

* added a note and using apt to install cmake

* using apt to install cmake

* Apply suggestions from code review

Co-authored-by: Eric G. Kratz <[email protected]>

* removed sundials from mac user install

---------

Co-authored-by: Agriya Khetarpal <[email protected]>
Co-authored-by: Arjun Verma <[email protected]>
Co-authored-by: Eric G. Kratz <[email protected]>
  • Loading branch information
4 people authored Mar 23, 2024
1 parent 8243c74 commit 314825c
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 30 deletions.
30 changes: 10 additions & 20 deletions docs/source/user_guide/installation/gnu-linux-mac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,14 @@ Prerequisites

To use PyBaMM, you must have Python 3.8, 3.9, 3.10, 3.11, or 3.12 installed.

.. tab:: Debian-based distributions (Debian, Ubuntu, Linux Mint)
.. tab:: Debian-based distributions (Debian, Ubuntu)

To install Python 3 on Debian-based distributions (Debian, Ubuntu, Linux Mint), open a terminal and run
To install Python 3 on Debian-based distributions (Debian, Ubuntu), open a terminal and run

.. code:: bash
sudo apt update
sudo apt install python3
.. tab:: Fedora/CentOS

On Fedora or CentOS, you can use DNF or Yum. For example

.. code:: bash
sudo dnf install python3
sudo apt-get update
sudo apt-get install python3
.. tab:: macOS

Expand All @@ -40,6 +32,7 @@ To use PyBaMM, you must have Python 3.8, 3.9, 3.10, 3.11, or 3.12 installed.
brew install python3
Install PyBaMM
--------------

Expand Down Expand Up @@ -84,11 +77,10 @@ library beforehand.
.. tab:: macOS

In a terminal, run the following commands:
In a terminal, run the following command:

.. code:: bash
brew install sundials
pip install pybamm
PyBaMM’s required dependencies (such as ``numpy``, ``casadi``, etc) will be
Expand All @@ -113,26 +105,24 @@ Users can install `scikits.odes <https://github.com/bmcage/odes>`__ to utilize i
The ``scikits.odes`` solver is not supported on Python 3.12 yet. Please refer to https://github.com/bmcage/odes/issues/162.
There is support for Python 3.8, 3.9, 3.10, and 3.11.

.. tab:: GNU/Linux
.. tab:: Debian/Ubuntu

In a terminal, run the following commands:

.. code:: bash
apt-get install libopenblas-dev
pip install wget cmake
sudo apt-get install libopenblas-dev cmake
pybamm_install_odes
system (under ``~/.local``), before installing ``scikits.odes``. (Alternatively, one can install SUNDIALS without this script and run ``pip install pybamm[odes]`` to install ``pybamm`` with ``scikits.odes``.)
This will compile and install SUNDIALS for the system (under ``~/.local``), before installing ``scikits.odes``. (Alternatively, one can install SUNDIALS without this script and run ``pip install pybamm[odes]`` to install ``pybamm`` with ``scikits.odes``.)

.. tab:: macOS

In a terminal, run the following command:

.. code:: bash
brew install openblas gcc gfortran
pip install wget cmake
brew install openblas gcc gfortran cmake
pybamm_install_odes
The ``pybamm_install_odes`` command, installed with PyBaMM, automatically downloads and installs the SUNDIALS library on your
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guide/installation/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ It can be installed using ``pip`` or ``conda``, or from source.

.. code:: bash
brew install sundials && pip install pybamm
pip install pybamm
.. tab:: conda
Expand Down
17 changes: 9 additions & 8 deletions docs/source/user_guide/installation/install-from-source.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,24 +34,25 @@ To install PyBaMM, you will need:

You can install the above with

.. tab:: Ubuntu
.. tab:: Ubuntu/Debian

.. code:: bash
sudo apt install python3.X python3.X-dev libopenblas-dev gcc gfortran graphviz
sudo apt install python3.X python3.X-dev libopenblas-dev gcc gfortran graphviz cmake
Where ``X`` is the version sub-number.

.. note::

On Windows, you can install ``graphviz`` using the `Chocolatey <https://chocolatey.org/>`_ package manager, or
follow the instructions on the `graphviz website <https://graphviz.org/download/>`_.

.. tab:: MacOS

.. code:: bash
brew install python openblas gcc gfortran graphviz libomp
brew install python openblas gcc gfortran graphviz libomp cmake
.. note::

If you are using some other linux distribution you can install the equivalent packages for ``python3, cmake, gcc, gfortran, openblas``.

On Windows, you can install ``graphviz`` using the `Chocolatey <https://chocolatey.org/>`_ package manager, or follow the instructions on the `graphviz website <https://graphviz.org/download/>`_.

Finally, we recommend using `Nox <https://nox.thea.codes/en/stable/>`_.
You can install it to your local user account (make sure you are not within a virtual environment) with
Expand Down
2 changes: 1 addition & 1 deletion docs/source/user_guide/installation/windows-wsl.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Get PyBaMM's Source Code
5. Follow the Installation Steps
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Follow the `installation instructions for PyBaMM on Linux <gnu-linux-mac.html>`__.
Follow the `installation instructions for PyBaMM on Linux <install-from-source.html>`__.

Using Visual Studio Code with the WSL
---------------------------------------
Expand Down

0 comments on commit 314825c

Please sign in to comment.