Skip to content

Commit

Permalink
Update polychord version.
Browse files Browse the repository at this point in the history
  • Loading branch information
tillahoffmann committed Mar 22, 2024
1 parent ee7c652 commit 5d7db72
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ PolyChordLite
shedding/_util.c
shedding/_util.*.so
workspace
polychordlite-source.zip
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ playground_*
.pystan
*workspace/
PolyChordLite/
polychordlite-source.zip
figures/

# Exclude everything in the publications folder ...
Expand Down
20 changes: 6 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,20 @@
FROM python:3.8.10
FROM python:3.10.13

# Install build tools.
RUN apt-get update && apt-get install -y \
gfortran \
&& rm -rf /var/lib/apt/lists/*

# Copy requirements and cython source because it is needed at install time.
COPY requirements.txt setup.py ./
COPY Makefile requirements.txt pyproject.toml setup.py ./
COPY shedding/_util.pyx shedding/__init__.py shedding/

# Install python requirements without cache directory (because we'll have an empty cache every time
# we build this layer anyway). We pre-install cython, cyfunc, and scipy to ensure everything is
# properly linked. We need to also rebuild cyfunc for this to work--not sure why.
RUN pip install --no-cache-dir `cat requirements.txt | grep -E '(cython|cyfunc|scipy)=='` \
&& pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir --force `cat requirements.txt | grep cyfunc==`
# we build this layer anyway).
RUN pip install --no-cache-dir -r requirements.txt

# Install pypolychord (this is duplicated from the Makefile to avoid rebuilding the image every time
# we update Makefile targets). This needs to happen after python dependencies because building
# requires numpy.
RUN git clone --depth 1 --branch 1.18.1 https://github.com/PolyChord/PolyChordLite.git \
&& cd PolyChordLite \
&& make MPI=0 libchord.so \
&& python setup.py --no-mpi install
# Install pypolychord.
RUN make pypolychord

# Copy over everything else.
COPY . .
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,11 @@ sync : requirements.txt
gh-action :
act -P ubuntu-latest=nektos/act-environments-ubuntu:18.04

POLYCHORDLITE_COMMIT = daba49d
PolyChordLite :
git clone --depth 1 --branch 1.18.1 https://github.com/PolyChord/PolyChordLite.git
curl -L -o polychordlite-source.zip https://github.com/PolyChord/PolyChordLite/archive/${POLYCHORDLITE_COMMIT}.zip
unzip polychordlite-source.zip
mv PolyChordLite-${POLYCHORDLITE_COMMIT}* PolyChordLite

pypolychord : PolyChordLite
cd PolyChordLite \
Expand Down

0 comments on commit 5d7db72

Please sign in to comment.