Skip to content

Commit

Permalink
Install sxs package
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsvu committed Aug 21, 2024
1 parent d7ef76b commit 2f85cfc
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/Tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -879,7 +879,7 @@ ${{ matrix.build_type }}-pch-${{ matrix.use_pch || 'ON' }}"
# We install some low-level dependencies with Homebrew. They get picked up
# by `spack external find`.
SPECTRE_BREW_DEPS: >- # Line breaks are spaces, no trailing newline
autoconf automake catch2 ccache cmake pkg-config boost
autoconf automake catch2 ccache cmake fftw pkg-config boost
# We install these packages with Spack and cache them. The full specs are
# listed in support/DevEnvironments/spack.yaml. This list is only needed
# to create the cache.
Expand Down
34 changes: 19 additions & 15 deletions containers/Dockerfile.buildenv
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ RUN apt-get update -y \
libboost-thread-dev libboost-tools-dev libssl-dev \
libhdf5-dev hdf5-tools \
libarpack2-dev \
libfftw3-dev \
libbenchmark-dev \
&& if [ ${UBUNTU_VERSION} = 18.04 ]; then \
wget https://github.com/jbeder/yaml-cpp/archive/refs/tags/0.8.0.tar.gz \
Expand All @@ -196,17 +197,10 @@ RUN apt-get update -y \
apt-get install -y libjemalloc2 libjemalloc-dev libyaml-cpp-dev; \
fi

# Install Python packages
# We only install packages that are needed by the build system (e.g. to compile
# Python bindings or build documentation) or used by Python code that is
# unit-tested. Any other packages can be installed on-demand.
# Install Python
# - We use python-is-python3 because on Ubuntu 20.04 /usr/bin/python was removed
# to aid in tracking down anything that depends on python 2. However, many
# scripts use `/usr/bin/env python` to find python so restore it.
# - We install h5py explicitly from binary so that cross compilation is quicker.
COPY support/Python/requirements.txt requirements.txt
COPY support/Python/dev_requirements.txt dev_requirements.txt
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update -y \
&& if [ ${UBUNTU_VERSION} = 18.04 ]; then \
apt-get install -y zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev \
Expand All @@ -215,17 +209,27 @@ RUN apt-get update -y \
&& wget https://www.python.org/ftp/python/3.10.1/Python-3.10.1.tgz \
&& tar -xf Python-3.10.1.tgz && cd ./Python-3.10.1 \
&& ./configure --enable-optimizations && make ${PARALLEL_MAKE_ARG} \
&& make altinstall && cd ../ \
&& make install && cd ../ \
&& rm -rf ./Python-3.10.1.tgz ./Python-3.10.1 \
&& python3.10 -m pip install --upgrade pip \
&& pip3.10 --no-cache-dir install --only-binary=h5py -r requirements.txt \
-r dev_requirements.txt; \
else \
apt-get install -y python3-pip python-is-python3 pkg-config \
&& pip3 --no-cache-dir install --only-binary=h5py -r requirements.txt \
-r dev_requirements.txt; \
fi \
fi

# Install Python packages
# We only install packages that are needed by the build system (e.g. to compile
# Python bindings or build documentation) or used by Python code that is
# unit-tested. Any other packages can be installed on-demand.
# - We install h5py explicitly from binary so that cross compilation is quicker.
COPY support/Python/requirements.txt requirements.txt
COPY support/Python/dev_requirements.txt dev_requirements.txt
ENV DEBIAN_FRONTEND noninteractive
RUN python3 -m pip install --upgrade pip \
&& pip3 --no-cache-dir install --only-binary=h5py \
-r requirements.txt -r dev_requirements.txt; \
&& rm requirements.txt dev_requirements.txt
# Call the SXS package so it downloads Julia on first use, see:
# https://moble.github.io/PostNewtonian.jl/dev/interface/python/
RUN python3 -c "from sxs import julia"

# Enable bash-completion by installing it and then adding it to the .bashrc file
RUN apt-get update -y \
Expand Down
4 changes: 4 additions & 0 deletions support/Python/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@ pyyaml
# Rich: to format CLI output and tracebacks
rich >= 12.0.0
scipy
# SXS package: to work with SXS data, waveforms, etc. Also to evaluate some
# post-Newtonian expressions, e.g. for low-eccentricity initial orbital
# parameters.
sxs >= 2024.0.3

0 comments on commit 2f85cfc

Please sign in to comment.