From 319c68960926bd886b78b8f98d16122067e9510e Mon Sep 17 00:00:00 2001 From: jangorecki Date: Sat, 27 Jun 2020 23:23:57 +0100 Subject: [PATCH 01/10] fwrite zlib switch --- src/fwrite.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/fwrite.c b/src/fwrite.c index cf58c2581b..7e6d67e8f4 100644 --- a/src/fwrite.c +++ b/src/fwrite.c @@ -7,7 +7,12 @@ #include // isfinite, isnan #include // abs #include // strlen, strerror + +#ifndef NOZLIB #include // for compression to .gz +#else +#define z_stream struct +#endif #ifdef WIN32 #include @@ -552,6 +557,7 @@ void writeCategString(const void *col, int64_t row, char **pch) write_string(getCategString(col, row), pch); } +#ifndef NOZLIB int init_stream(z_stream *stream) { stream->next_in = Z_NULL; stream->zalloc = Z_NULL; @@ -589,6 +595,7 @@ void print_z_stream(const z_stream *s) // temporary tracing function for #4099 } DTPRINT("\n"); } +#endif void fwriteMain(fwriteMainArgs args) { @@ -694,6 +701,10 @@ void fwriteMain(fwriteMainArgs args) // # nocov end } } + #ifdef NOZLIB + if (args.is_gzip) + STOP(_("fwrite compression requires zlib which is not present")); // # nocov + #endif int yamlLen = strlen(args.yaml); if (verbose) { @@ -735,6 +746,7 @@ void fwriteMain(fwriteMainArgs args) } else { int ret1=0, ret2=0; if (args.is_gzip) { + #ifndef NOZLIB z_stream stream; if(init_stream(&stream)) { free(buff); // # nocov @@ -753,6 +765,7 @@ void fwriteMain(fwriteMainArgs args) if (ret1==Z_OK) ret2 = WRITE(f, zbuff, (int)zbuffUsed); deflateEnd(&stream); free(zbuff); + #endif } else { ret2 = WRITE(f, buff, (int)(ch-buff)); } @@ -798,11 +811,13 @@ void fwriteMain(fwriteMainArgs args) // compute zbuffSize which is the same for each thread size_t zbuffSize = 0; if(args.is_gzip){ + #ifndef NOZLIB z_stream stream; if(init_stream(&stream)) STOP(_("Can't allocate gzip stream structure")); // # nocov zbuffSize = deflateBound(&stream, buffSize); deflateEnd(&stream); + #endif } errno=0; @@ -816,6 +831,7 @@ void fwriteMain(fwriteMainArgs args) char *zbuffPool = NULL; if (args.is_gzip) { zbuffPool = malloc(nth*(size_t)zbuffSize); + #ifndef NOZLIB if (!zbuffPool) { // # nocov start free(buffPool); @@ -823,11 +839,14 @@ void fwriteMain(fwriteMainArgs args) (size_t)zbuffSize/(1024^2), nth, errno, strerror(errno)); // # nocov end } + #endif } bool failed = false; // naked (unprotected by atomic) write to bool ok because only ever write true in this special paradigm int failed_compress = 0; // the first thread to fail writes their reason here when they first get to ordered section + #ifndef NOZLIB char failed_msg[1001] = ""; // to hold zlib's msg; copied out of zlib in ordered section just in case the msg is allocated within zlib + #endif int failed_write = 0; // same. could use +ve and -ve in the same code but separate it out to trace Solaris problem, #3931 if (nth>1) verbose=false; // printing isn't thread safe (there's a temporary print in compressbuff for tracing solaris; #4099) @@ -841,6 +860,7 @@ void fwriteMain(fwriteMainArgs args) void *myzBuff = NULL; size_t myzbuffUsed = 0; + #ifndef NOZLIB z_stream mystream; if (args.is_gzip) { myzBuff = zbuffPool + me*zbuffSize; @@ -850,6 +870,7 @@ void fwriteMain(fwriteMainArgs args) } if (verbose) {DTPRINT("z_stream for data (1): "); print_z_stream(&mystream);} } + #endif #pragma omp for ordered schedule(dynamic) for(int64_t start=0; startmsg==\"%s\" Z_FINISH=%d Z_BLOCK=%d. %s"), zlibVersion(), ZLIB_VERSION, failed_compress, failed_msg, Z_FINISH, Z_BLOCK, verbose ? _("Please include the full output above and below this message in your data.table bug report.") : _("Please retry fwrite() with verbose=TRUE and include the full output with your data.table bug report.")); + #endif if (failed_write) STOP("%s: '%s'", strerror(failed_write), args.filename); // # nocov end From 19e24b502bc76738165be84f7adbb369cca42d4a Mon Sep 17 00:00:00 2001 From: jangorecki Date: Sat, 12 Dec 2020 16:18:13 +0200 Subject: [PATCH 02/10] configure disables zlib if not present --- DESCRIPTION | 1 - configure | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/DESCRIPTION b/DESCRIPTION index 44894189d7..8e9c0f7af5 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -64,7 +64,6 @@ Authors@R: c( Depends: R (>= 3.1.0) Imports: methods Suggests: bit64 (>= 4.0.0), bit (>= 4.0.4), curl, R.utils, xts, nanotime, zoo (>= 1.8-1), yaml, knitr, rmarkdown -SystemRequirements: zlib Description: Fast aggregation of large data (e.g. 100GB in RAM), fast ordered joins, fast add/modify/delete of columns by group using no copies at all, list columns, friendly and fast character-separated-value read/write. Offers a natural and flexible syntax, for faster development. License: MPL-2.0 | file LICENSE URL: https://Rdatatable.gitlab.io/data.table, https://github.com/Rdatatable/data.table diff --git a/configure b/configure index e29156d61a..ce1fdb5ddf 100755 --- a/configure +++ b/configure @@ -60,6 +60,8 @@ if [ $msg -ne 0 ]; then echo "*** 1) 'pkg-config --exists zlib' succeeds (i.e. \$? -eq 0)" echo "*** 2) 'pkg-config --libs zlib' contains -lz" echo "*** Compilation will now be attempted ..." + ## add some meaningful output here + PKG_CFLAGS="$PKG_CFLAGS -DNOZLIB" else version=`pkg-config --modversion zlib` echo "zlib ${version} is available ok" From 3395905fe1b56876358aaeb9a72bfd2d958d2dc5 Mon Sep 17 00:00:00 2001 From: jangorecki Date: Sat, 12 Dec 2020 16:27:02 +0200 Subject: [PATCH 03/10] zlib escape also in utils function --- src/utils.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/utils.c b/src/utils.c index 8a3598f575..89f75f8e75 100644 --- a/src/utils.c +++ b/src/utils.c @@ -374,10 +374,17 @@ SEXP coerceUtf8IfNeeded(SEXP x) { return(ans); } +#ifndef NOZLIB #include +#endif SEXP dt_zlib_version() { char out[51]; +#ifndef NOZLIB snprintf(out, 50, "zlibVersion()==%s ZLIB_VERSION==%s", zlibVersion(), ZLIB_VERSION); +#else + snprintf(out, 50, "zlib is not installled"); +#endif return ScalarString(mkChar(out)); } + From e0d8d10592399fb324acde61b3e265b9d5c21e12 Mon Sep 17 00:00:00 2001 From: jangorecki Date: Sat, 12 Dec 2020 16:40:54 +0200 Subject: [PATCH 04/10] proper escape in configure --- configure | 13 ++++++++++--- src/Makevars.in | 2 +- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/configure b/configure index ce1fdb5ddf..9005394373 100755 --- a/configure +++ b/configure @@ -18,7 +18,7 @@ esac # "[pkg-config] is available on the machines used to produce the CRAN binary packages" # This script should pass `checkbashisms` for portability; e.g. CRAN's Solaris 10, # and R-exts note 24 now suggests 'checkbashisms' as we proposed. - +NOZLIB=0 msg=0 pkg-config --version >/dev/null 2>&1 if [ $? -ne 0 ]; then @@ -28,6 +28,7 @@ else pkg-config --exists zlib if [ $? -ne 0 ]; then echo "*** pkg-config is installed but 'pkg-config --exists zlib' did not return 0." + NOZLIB=1 msg=1 else lib=`pkg-config --libs zlib` @@ -60,8 +61,6 @@ if [ $msg -ne 0 ]; then echo "*** 1) 'pkg-config --exists zlib' succeeds (i.e. \$? -eq 0)" echo "*** 2) 'pkg-config --libs zlib' contains -lz" echo "*** Compilation will now be attempted ..." - ## add some meaningful output here - PKG_CFLAGS="$PKG_CFLAGS -DNOZLIB" else version=`pkg-config --modversion zlib` echo "zlib ${version} is available ok" @@ -112,4 +111,12 @@ fi sed -e "s|@PKG_CFLAGS@|$PKG_CFLAGS|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars sed -e "s|@PKG_LIBS@|$PKG_LIBS|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars +# optional zlib dependency +if [ "$NOZLIB" = "1" ]; then + echo "*** Compilation without compression support in fwrite" + sed -e "s|@zlib_libs@||" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars +else + sed -e "s|@zlib_libs@|-lz|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars +fi + exit 0 diff --git a/src/Makevars.in b/src/Makevars.in index 7750c1e8ac..fb9927dc38 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -1,5 +1,5 @@ PKG_CFLAGS = @PKG_CFLAGS@ @openmp_cflags@ -PKG_LIBS = @PKG_LIBS@ @openmp_cflags@ -lz +PKG_LIBS = @PKG_LIBS@ @openmp_cflags@ @zlib_libs@ # See WRE $1.2.1.1. But retain user supplied PKG_* too, #4664. # WRE states ($1.6) that += isn't portable and that we aren't allowed to use it. # Otherwise we could use the much simpler PKG_LIBS += @openmp_cflags@ -lz. From 4b4a5326a3d1877925812eca4226380b44117d44 Mon Sep 17 00:00:00 2001 From: jangorecki Date: Sat, 12 Dec 2020 16:45:55 +0200 Subject: [PATCH 05/10] missing switch --- configure | 2 ++ src/Makevars.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 9005394373..c3a65a1d3b 100755 --- a/configure +++ b/configure @@ -114,8 +114,10 @@ sed -e "s|@PKG_LIBS@|$PKG_LIBS|" src/Makevars > src/Makevars.tmp && mv src/Makev # optional zlib dependency if [ "$NOZLIB" = "1" ]; then echo "*** Compilation without compression support in fwrite" + sed -e "s|@zlib_cflags@|-DNOZLIB|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars sed -e "s|@zlib_libs@||" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars else + sed -e "s|@zlib_cflags@||" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars sed -e "s|@zlib_libs@|-lz|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars fi diff --git a/src/Makevars.in b/src/Makevars.in index fb9927dc38..a35ead0a7d 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -1,4 +1,4 @@ -PKG_CFLAGS = @PKG_CFLAGS@ @openmp_cflags@ +PKG_CFLAGS = @PKG_CFLAGS@ @openmp_cflags@ @zlib_cflags@ PKG_LIBS = @PKG_LIBS@ @openmp_cflags@ @zlib_libs@ # See WRE $1.2.1.1. But retain user supplied PKG_* too, #4664. # WRE states ($1.6) that += isn't portable and that we aren't allowed to use it. From 5808d1906ffd2493f5d19a425b035c94bafa122b Mon Sep 17 00:00:00 2001 From: jangorecki Date: Sat, 12 Dec 2020 17:07:26 +0200 Subject: [PATCH 06/10] more verbose output --- configure | 13 ++++++------- src/Makevars.in | 1 + src/fwrite.c | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/configure b/configure index c3a65a1d3b..8e1c7dd4e3 100755 --- a/configure +++ b/configure @@ -18,8 +18,8 @@ esac # "[pkg-config] is available on the machines used to produce the CRAN binary packages" # This script should pass `checkbashisms` for portability; e.g. CRAN's Solaris 10, # and R-exts note 24 now suggests 'checkbashisms' as we proposed. -NOZLIB=0 msg=0 +NOZLIB=1 # if pkg-config is not available then zlib will be disabled for higher chance of compilation success pkg-config --version >/dev/null 2>&1 if [ $? -ne 0 ]; then echo "*** pkg-config is not installed." @@ -28,9 +28,9 @@ else pkg-config --exists zlib if [ $? -ne 0 ]; then echo "*** pkg-config is installed but 'pkg-config --exists zlib' did not return 0." - NOZLIB=1 msg=1 else + NOZLIB=0 lib=`pkg-config --libs zlib` expr -- "$lib" : ".*-lz$" >/dev/null # -- for FreeBSD, #4652 if [ $? -ne 0 ]; then @@ -47,9 +47,9 @@ fi if [ $msg -ne 0 ]; then echo "*** Compilation will now be attempted and if it works you can ignore this message. In" - echo "*** particular, this should be the case on Mac where zlib is built in." - echo "*** However, if compilation fails, try 'locate zlib.h zconf.h' and ensure the zlib" - echo "*** development library is installed :" + echo "*** particular, this should be the case on Mac where zlib is built in or pkg-config" + echo "*** is not installed. However, if compilation fails, try 'locate zlib.h zconf.h' and" + echo "*** ensure the zlib development library is installed :" echo "*** deb: zlib1g-dev (Debian, Ubuntu, ...)" echo "*** rpm: zlib-devel (Fedora, EPEL, ...)" echo "*** There is a zlib in brew for OSX but the built in zlib should work." @@ -110,8 +110,7 @@ fi # retain user supplied PKG_ env variables, #4664. See comments in Makevars.in too. sed -e "s|@PKG_CFLAGS@|$PKG_CFLAGS|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars sed -e "s|@PKG_LIBS@|$PKG_LIBS|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars - -# optional zlib dependency +# optional dependency on zlib if [ "$NOZLIB" = "1" ]; then echo "*** Compilation without compression support in fwrite" sed -e "s|@zlib_cflags@|-DNOZLIB|" src/Makevars > src/Makevars.tmp && mv src/Makevars.tmp src/Makevars diff --git a/src/Makevars.in b/src/Makevars.in index a35ead0a7d..b411786283 100644 --- a/src/Makevars.in +++ b/src/Makevars.in @@ -5,6 +5,7 @@ PKG_LIBS = @PKG_LIBS@ @openmp_cflags@ @zlib_libs@ # Otherwise we could use the much simpler PKG_LIBS += @openmp_cflags@ -lz. # Can't do PKG_LIBS = $(PKG_LIBS)... either because that's a 'recursive variable reference' error in make # Hence the onerous @...@ substitution. Is it still appropriate in 2020 that we can't use +=? +# Note that -lz is now escaped via @zlib_libs@ when zlib is not installed all: $(SHLIB) @echo PKG_CFLAGS = $(PKG_CFLAGS) diff --git a/src/fwrite.c b/src/fwrite.c index c82be92104..aeb2682057 100644 --- a/src/fwrite.c +++ b/src/fwrite.c @@ -728,7 +728,7 @@ void fwriteMain(fwriteMainArgs args) } #ifdef NOZLIB if (args.is_gzip) - STOP(_("fwrite compression requires zlib which is not present")); // # nocov + STOP(_("Compression in fwrite uses zlib library which was not installed at the time when data.table was compiled. To enable compression support in fwrite one must install zlib and re-install data.table.")); // # nocov #endif int yamlLen = strlen(args.yaml); From 28d83ecdbaa3ec4672aa3f4b072fdcb0e04ea110 Mon Sep 17 00:00:00 2001 From: jangorecki Date: Sat, 12 Dec 2020 17:38:29 +0200 Subject: [PATCH 07/10] reduce diff --- configure | 1 + src/fwrite.c | 1 - src/utils.c | 1 - 3 files changed, 1 insertion(+), 2 deletions(-) diff --git a/configure b/configure index 8e1c7dd4e3..f2e98ec312 100755 --- a/configure +++ b/configure @@ -18,6 +18,7 @@ esac # "[pkg-config] is available on the machines used to produce the CRAN binary packages" # This script should pass `checkbashisms` for portability; e.g. CRAN's Solaris 10, # and R-exts note 24 now suggests 'checkbashisms' as we proposed. + msg=0 NOZLIB=1 # if pkg-config is not available then zlib will be disabled for higher chance of compilation success pkg-config --version >/dev/null 2>&1 diff --git a/src/fwrite.c b/src/fwrite.c index aeb2682057..1b4489518d 100644 --- a/src/fwrite.c +++ b/src/fwrite.c @@ -7,7 +7,6 @@ #include // isfinite, isnan #include // abs #include // strlen, strerror - #ifndef NOZLIB #include // for compression to .gz #else diff --git a/src/utils.c b/src/utils.c index 89f75f8e75..01b3dbeff7 100644 --- a/src/utils.c +++ b/src/utils.c @@ -387,4 +387,3 @@ SEXP dt_zlib_version() { return ScalarString(mkChar(out)); } - From a16cc1e230875d74e346d30fb287d70b29339976 Mon Sep 17 00:00:00 2001 From: Matt Dowle Date: Mon, 4 Jan 2021 14:36:29 -0700 Subject: [PATCH 08/10] added news item --- NEWS.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/NEWS.md b/NEWS.md index e0ea1222ea..745defe556 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,6 +10,8 @@ ## NOTES +1. Compiling from source no longer requires `zlib` to be available, [#4844](https://github.com/Rdatatable/data.table/pull/4844). The output suggests installing `zlib`, and how, but now proceeds with `gzip` compression disabled in `fwrite`. Upon requesting `gzip` compression from `fwrite`, an error message suggests to reinstall `data.table` with `zlib` available. + # data.table [v1.13.6](https://github.com/Rdatatable/data.table/milestone/22?closed=1) (30 Dec 2020) From 59557ea235bb9f9ea43623db5da329318e94264c Mon Sep 17 00:00:00 2001 From: Matt Dowle Date: Mon, 4 Jan 2021 14:45:41 -0700 Subject: [PATCH 09/10] news item tweak --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 745defe556..7a28946121 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,7 +10,7 @@ ## NOTES -1. Compiling from source no longer requires `zlib` to be available, [#4844](https://github.com/Rdatatable/data.table/pull/4844). The output suggests installing `zlib`, and how, but now proceeds with `gzip` compression disabled in `fwrite`. Upon requesting `gzip` compression from `fwrite`, an error message suggests to reinstall `data.table` with `zlib` available. +1. Compiling from source no longer requires `zlib` header files to be available, [#4844](https://github.com/Rdatatable/data.table/pull/4844). The output suggests installing `zlib` headers, and how (e.g. `zlib1g-dev` on Ubuntu), but now proceeds with `gzip` compression disabled in `fwrite`. Upon requesting `gzip` compression from `fwrite`, an error message suggests to reinstall `data.table` with `zlib` headers available. This does not apply to users on Windows or Mac who install the pre-compiled binary package from CRAN. # data.table [v1.13.6](https://github.com/Rdatatable/data.table/milestone/22?closed=1) (30 Dec 2020) From 08a2584c394d659dbc36486f5089c9b4c61747e0 Mon Sep 17 00:00:00 2001 From: Matt Dowle Date: Mon, 4 Jan 2021 17:14:00 -0700 Subject: [PATCH 10/10] zlib is still a requirement in DESCRIPTION; see PR comment to follow. And other tweaks. --- DESCRIPTION | 1 + NEWS.md | 2 +- src/fwrite.c | 12 ++++-------- src/utils.c | 2 +- 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index a07ffb6102..3e878e84bd 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -64,6 +64,7 @@ Authors@R: c( Depends: R (>= 3.1.0) Imports: methods Suggests: bit64 (>= 4.0.0), bit (>= 4.0.4), curl, R.utils, xts, nanotime, zoo (>= 1.8-1), yaml, knitr, rmarkdown +SystemRequirements: zlib Description: Fast aggregation of large data (e.g. 100GB in RAM), fast ordered joins, fast add/modify/delete of columns by group using no copies at all, list columns, friendly and fast character-separated-value read/write. Offers a natural and flexible syntax, for faster development. License: MPL-2.0 | file LICENSE URL: https://Rdatatable.gitlab.io/data.table, https://github.com/Rdatatable/data.table diff --git a/NEWS.md b/NEWS.md index 7a28946121..df1b96436c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -10,7 +10,7 @@ ## NOTES -1. Compiling from source no longer requires `zlib` header files to be available, [#4844](https://github.com/Rdatatable/data.table/pull/4844). The output suggests installing `zlib` headers, and how (e.g. `zlib1g-dev` on Ubuntu), but now proceeds with `gzip` compression disabled in `fwrite`. Upon requesting `gzip` compression from `fwrite`, an error message suggests to reinstall `data.table` with `zlib` headers available. This does not apply to users on Windows or Mac who install the pre-compiled binary package from CRAN. +1. Compiling from source no longer requires `zlib` header files to be available, [#4844](https://github.com/Rdatatable/data.table/pull/4844). The output suggests installing `zlib` headers, and how (e.g. `zlib1g-dev` on Ubuntu) as before, but now proceeds with `gzip` compression disabled in `fwrite`. Upon calling `fwrite(DT, "file.csv.gz")` at runtime, an error message suggests to reinstall `data.table` with `zlib` headers available. This does not apply to users on Windows or Mac who install the pre-compiled binary package from CRAN. # data.table [v1.13.6](https://github.com/Rdatatable/data.table/milestone/22?closed=1) (30 Dec 2020) diff --git a/src/fwrite.c b/src/fwrite.c index f98f9841f8..b85d513a6f 100644 --- a/src/fwrite.c +++ b/src/fwrite.c @@ -9,8 +9,6 @@ #include // strlen, strerror #ifndef NOZLIB #include // for compression to .gz -#else -#define z_stream struct #endif #ifdef WIN32 @@ -691,7 +689,7 @@ void fwriteMain(fwriteMainArgs args) } #ifdef NOZLIB if (args.is_gzip) - STOP(_("Compression in fwrite uses zlib library which was not installed at the time when data.table was compiled. To enable compression support in fwrite one must install zlib and re-install data.table.")); // # nocov + STOP(_("Compression in fwrite uses zlib library. Its header files were not found at the time data.table was compiled. To enable fwrite compression, please reinstall data.table and study the output for further guidance.")); // # nocov #endif int yamlLen = strlen(args.yaml); @@ -831,18 +829,16 @@ void fwriteMain(fwriteMainArgs args) bool failed = false; // naked (unprotected by atomic) write to bool ok because only ever write true in this special paradigm int failed_compress = 0; // the first thread to fail writes their reason here when they first get to ordered section -#ifndef NOZLIB - char failed_msg[1001] = ""; // to hold zlib's msg; copied out of zlib in ordered section just in case the msg is allocated within zlib -#endif int failed_write = 0; // same. could use +ve and -ve in the same code but separate it out to trace Solaris problem, #3931 - if (nth>1) verbose=false; // printing isn't thread safe (there's a temporary print in compressbuff for tracing solaris; #4099) - +#ifndef NOZLIB z_stream thread_streams[nth]; // VLA on stack should be fine for nth structs; in zlib v1.2.11 sizeof(struct)==112 on 64bit // not declared inside the parallel region because solaris appears to move the struct in // memory when the #pragma omp for is entered, which causes zlib's internal self reference // pointer to mismatch, #4099 + char failed_msg[1001] = ""; // to hold zlib's msg; copied out of zlib in ordered section just in case the msg is allocated within zlib +#endif #pragma omp parallel num_threads(nth) { diff --git a/src/utils.c b/src/utils.c index 01b3dbeff7..b1cb3b1aed 100644 --- a/src/utils.c +++ b/src/utils.c @@ -382,7 +382,7 @@ SEXP dt_zlib_version() { #ifndef NOZLIB snprintf(out, 50, "zlibVersion()==%s ZLIB_VERSION==%s", zlibVersion(), ZLIB_VERSION); #else - snprintf(out, 50, "zlib is not installled"); + snprintf(out, 50, "zlib header files were not found when data.table was compiled"); #endif return ScalarString(mkChar(out)); }