Skip to content

Commit

Permalink
pybamm-team#3312 Update CMake, Python versions and add nox
Browse files Browse the repository at this point in the history
Co-Authored-By: Arjun <[email protected]>
  • Loading branch information
2 people authored and js1tr3 committed Aug 12, 2024
1 parent 2753c72 commit 8c59da8
Showing 1 changed file with 23 additions and 18 deletions.
41 changes: 23 additions & 18 deletions scripts/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ WORKDIR /

# Install the necessary dependencies
RUN apt-get update && apt-get -y upgrade
RUN apt-get install -y libopenblas-dev gcc gfortran graphviz git make g++ build-essential cmake
RUN apt-get install -y libopenblas-dev gcc gfortran graphviz git make g++ build-essential cmake pandoc texlive-latex-extra dvipng
RUN rm -rf /var/lib/apt/lists/*

RUN useradd -m -s /bin/bash pybamm
Expand All @@ -21,45 +21,50 @@ ENV CMAKE_C_COMPILER=/usr/bin/gcc
ENV CMAKE_CXX_COMPILER=/usr/bin/g++
ENV CMAKE_MAKE_PROGRAM=/usr/bin/make
ENV SUNDIALS_INST=/home/pybamm/.local
ENV LD_LIBRARY_PATH=/home/pybamm/.local/lib:
ENV LD_LIBRARY_PATH=/home/pybamm/.local/lib

RUN conda create -n pybamm python=3.11
RUN conda init --all
SHELL ["conda", "run", "-n", "pybamm", "/bin/bash", "-c"]
RUN conda install -y pip

ARG IDAKLU
ARG ODES
ARG JAX
ARG ALL

RUN conda create -n pybamm python=3.9
RUN conda init --all
SHELL ["conda", "run", "-n", "pybamm", "/bin/bash", "-c"]
RUN conda install -y pip

RUN if [ "$IDAKLU" = "true" ]; then \
pip install --upgrade --user pip setuptools wheel wget && \
pip install cmake==3.22 && \
pip install --upgrade --user pip setuptools wheel wget nox && \
pip install cmake && \
python scripts/install_KLU_Sundials.py && \
git clone https://github.com/pybind/pybind11.git && \
pip install --user -e ".[all,dev]"; \
pip install --user -e ".[all,dev,docs]"; \
fi

RUN if [ "$ODES" = "true" ]; then \
pip install cmake==3.22 && \
pip install --upgrade --user pip wget && \
pip install --upgrade --user pip setuptools wheel wget nox && \
pip install cmake && \
python scripts/install_KLU_Sundials.py && \
pip install --user -e ".[all,odes,dev]"; \
git clone https://github.com/pybind/pybind11.git && \
pip install --user -e ".[all,dev,docs,odes]"; \
fi

RUN if [ "$JAX" = "true" ]; then \
pip install --user -e ".[jax,all,dev]";\
pip install --upgrade --user pip setuptools wheel wget nox && \
pip install cmake && \
python scripts/install_KLU_Sundials.py && \
git clone https://github.com/pybind/pybind11.git && \
pip install --user -e ".[all,dev,docs,jax]"; \
fi

RUN if [ "$ALL" = "true" ]; then \
pip install cmake==3.22 && \
pip install --upgrade --user pip setuptools wheel wget && \
pip install --upgrade --user pip setuptools wheel wget nox && \
pip install cmake && \
python scripts/install_KLU_Sundials.py && \
git clone https://github.com/pybind/pybind11.git && \
pip install --user -e ".[all,dev,jax,odes]"; \
pip install --user -e ".[all,dev,docs,jax,odes]"; \
fi

RUN pip install --user -e ".[all,dev]"
RUN pip install --user -e ".[all,dev,docs]"

ENTRYPOINT ["/bin/bash"]

0 comments on commit 8c59da8

Please sign in to comment.