Skip to content

Commit

Permalink
Merge pull request #3706 from agriyakhetarpal/fix-pybamm-install-odes
Browse files Browse the repository at this point in the history
Make `pybamm_install_odes` a bit more robust
  • Loading branch information
agriyakhetarpal authored and Saransh-cpp committed Jan 16, 2024
1 parent 89b9420 commit 6ddd47e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Features

- The `pybamm_install_odes` command now includes support for macOS systems and can be used to set up SUNDIALS and install the `scikits.odes` solver on macOS ([#3417](https://github.com/pybamm-team/PyBaMM/pull/3417))
- The `pybamm_install_odes` command now includes support for macOS systems and can be used to set up SUNDIALS and install the `scikits.odes` solver on macOS ([#3417](https://github.com/pybamm-team/PyBaMM/pull/3417), [#3706](https://github.com/pybamm-team/PyBaMM/3706]))
- Added support for Python 3.12 ([#3531](https://github.com/pybamm-team/PyBaMM/pull/3531))
- Added method to get QuickPlot axes by variable ([#3596](https://github.com/pybamm-team/PyBaMM/pull/3596))
- Added custom experiment terminations ([#3596](https://github.com/pybamm-team/PyBaMM/pull/3596))
Expand Down
4 changes: 3 additions & 1 deletion docs/source/user_guide/installation/gnu-linux-mac.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@ Users can install `scikits.odes <https://github.com/bmcage/odes>`__ to utilize i

.. code:: bash
apt install libopenblas-dev
apt-get install libopenblas-dev
pip install wget 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``.)
Expand All @@ -131,6 +132,7 @@ Users can install `scikits.odes <https://github.com/bmcage/odes>`__ to utilize i
.. code:: bash
brew install openblas gcc gfortran
pip install wget cmake
pybamm_install_odes
The ``pybamm_install_odes`` command, installed with PyBaMM, automatically downloads and installs the SUNDIALS library on your
Expand Down
7 changes: 6 additions & 1 deletion pybamm/install_odes.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,12 @@ def main(arguments=None):
# see https://scikits-odes.readthedocs.io/en/latest/installation.html#id1
os.environ["SUNDIALS_INST"] = SUNDIALS_LIB_DIR
env = os.environ.copy()
subprocess.run(["pip", "install", "scikits.odes"], env=env, check=True)
logger.info("Installing scikits.odes via pip")
subprocess.run(
[f"{sys.executable}", "-m", "pip", "install", "scikits.odes", "--verbose"],
env=env,
check=True,
)


if __name__ == "__main__":
Expand Down

0 comments on commit 6ddd47e

Please sign in to comment.