HenrikBengtsson / CBI-software

A Scientific Software Stack for HPC (CentOS oriented)
https://wynton.ucsf.edu/hpc/software/software-repositories.html
5 stars 2 forks source link

Install R (<= 3.3.0) with zlib >= 1.2.10 #116

Closed HenrikBengtsson closed 9 months ago

HenrikBengtsson commented 10 months ago

Fix the Makefile so it can install also R (<= 3.3.0) on Rocky 8.

https://cran.r-project.org/src/base/R-3/:

HenrikBengtsson commented 9 months ago

When trying to install R 3.3.0 with zlib 1.2.11 on the system, we get:

checking zlib.h usability... yes
checking zlib.h presence... yes
checking for zlib.h... yes                                                                                                             
checking if zlib version >= 1.2.5... no
checking whether zlib support suffices... configure: error: zlib library and headers are required                                      

This is because there's an assumption in configure that the zlib is x.y.z with only five (5) characters total.

A patch is:

diff -w -u configure.R-3.3.0 configure
--- configure.R-3.3.0   2023-12-11 08:17:53.000000000 -0800
+++ configure   2023-12-11 08:26:41.000000000 -0800
@@ -35496,10 +35496,11 @@
 #include <string.h>
 #include <zlib.h>
 int main() {
-#ifdef ZLIB_VERSION
-/* Work around Debian bug: it uses 1.2.3.4 even though there was no such
-   version on the master site zlib.net */
-  exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0);
+#ifdef ZLIB_VERNUM
+  if (ZLIB_VERNUM < 0x1250) {
+    exit(1);
+  }
+  exit(0);
 #else
   exit(1);
 #endif