bmvdgeijn / WASP

WASP: allele-specific pipeline for unbiased read mapping and molecular QTL discovery
Apache License 2.0
103 stars 51 forks source link

zlib version check suggestion #92

Closed nicolasrochette closed 4 years ago

nicolasrochette commented 4 years ago

This isn't an issue, but if I may suggest the following patch. We all work on different clusters, some of which love playing tricks & a bit of payback wouldn't hurt.

[PATCH] snp2h5/util.c: Added runtime zlib version check
---
 snp2h5/util.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/snp2h5/util.c b/snp2h5/util.c
index 6ffcc18..41c184b 100644
--- a/snp2h5/util.c
+++ b/snp2h5/util.c
@@ -1053,6 +1053,10 @@ FILE *util_must_fopen(const char *path, const char *mode) {
  */
 gzFile util_must_gzopen(const char *path, const char *mode) {
   gzFile f;
+  if(strcmp(ZLIB_VERSION, zlibVersion()) != 0) {
+    my_warn("zlib compilation (%s) and runtime (%s) versions do not match.\n",
+      ZLIB_VERSION, zlibVersion());
+  }

   if((strcmp(mode, "wb") == 0) && !util_str_ends_with(path, ".gz")) {
     my_warn("%s:%d: file '%s' does not end with '.gz' but "

Thank you for all the work, Nicolas

gmcvicker commented 4 years ago

Thank you for the patch! I have merged it into our code.