Skip to content

Commit

Permalink
Add libdeflate support on R 4.4.0 and later
Browse files Browse the repository at this point in the history
Closes #12, once deployed.
  • Loading branch information
gaborcsardi committed Dec 17, 2024
1 parent 88b0d3f commit b7e2a9f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions dockerfiles/bionic/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,23 @@ RUN curl -LO https://github.com/r-hub/r-musl/releases/download/v3.19/$(arch)/whi
mkdir -p /opt/R/${R_VERSION}-glibc/lib/R/tools && \
cp opt/r-lib/bin/which /opt/R/${R_VERSION}-glibc/lib/R/tools

# libdeflate is not in Bionic, so install separately.
# Only needed for R >= 4.4.0, so do it late (=here), for better caching
# over R versions.
RUN if dpkg --compare-versions ${R_VERSION} ge 4.4.0; then \
apt-get update && apt-get install -y cmake && \
curl -LO https://github.com/ebiggers/libdeflate/releases/download/v1.23/libdeflate-1.23.tar.gz && \
tar xzf libdeflate-1.23.tar.gz && \
rm libdeflate-1.23.tar.gz && \
cd libdeflate-1.23 && \
mkdir -p build && \
cd build && \
cmake .. && \
make && \
make install && \
cp /usr/local/lib/libdeflate.a /opt/r-lib/lib/; \
fi

# R should not default to linking to /opt/r-lib, so create some symlinks
RUN mkdir -p /opt/R/${R_VERSION}-glibc/lib/R && \
ln -s /opt/r-lib/lib /opt/R/${R_VERSION}-glibc/lib/R/ && \
Expand Down
2 changes: 1 addition & 1 deletion test/test-caps.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ stopifnot(capabilities()["ICU"])
stopifnot(capabilities()["libcurl"])

stopifnot(extSoftVersion()["xz"] != "")
# stopifnot(extSoftVersion()["libdeflate"] != "") TODO
stopifnot(extSoftVersion()["libdeflate"] != "")
stopifnot(extSoftVersion()["readline"] != "")

0 comments on commit b7e2a9f

Please sign in to comment.