-
Notifications
You must be signed in to change notification settings - Fork 166
Clarification re:zlib #161
Description
data.table recently added support for emitting gzipped files, which requires zlib headers to build properly.
I recently happened to be using rocker/r-ver:3.5.3 to chase down a version-specific test failure and also noticed that there doesn't appear to be zlib support on this image:
docker run -it rocker/r-ver:3.5.3
install.packages('data.table', type = 'source', repos = 'http://Rdatatable.github.io/data.table')
# <suppressed>
# gcc -I"/usr/local/lib/R/include" -DNDEBUG -I/usr/local/include -fopenmp -fpic -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c fwrite.c -o fwrite.o
# fwrite.c:22:48: fatal error: zlib.h: No such file or directory
#include "zlib.h" // for writing gzip file
And in fact zlib isn't found:
grep('zlib', list.files('/usr/local/include', recursive = TRUE), value=TRUE)
# character(0)
grep('zlib', list.files('/usr/local/lib/R/include', recursive = TRUE), value=TRUE)
# character(0)
grep('zlib', list.files('/usr/include', recursive = TRUE), value=TRUE)
# character(0)
This is easily solved e.g. with apt-get update && apt-get install zlib1g-dev; what drew my attention is Philippe's (original gzip support author's) pointing out that system zlib is required for R since 3.3.0 (with a version of zlib included in R sources before that):
Rdatatable/data.table#3872 (comment)
Was it an intentional design decision to omit this from the image (e.g. with minimalist constraints in mind)?
A bit more broadly, this raised flags for us that we might be increasing the dependency load of data.table with this new requirement (which in practice is really only a "suggested" dependency for users seeking support for compressed fwrite output), and all the more troublingly so that it's a system requirement (which are a lot more painful for inexperienced users to figure out since they can't install.packages their way out), so we're hoping any insights you offer can illuminate whether we're likely to encounter many users with a setup like that in r-ver:3.5.3 "in the wild" once the zlib-required version of data.table hits CRAN