[R] if zlib version >= 1.2.5... no

bastl73 bastl73 at freenet.de
Wed Jan 4 17:09:39 CET 2017

Configuring R with zlib-1.2.10 I get this error:

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

So I asked Mark from zlib about this problem and he wrote back:

>  exit(strncmp(ZLIB_VERSION, "1.2.5", 5) < 0);

strcmp("1.2.10", "1.2.5") will indicate incorrectly that the 1.2.10 is *less* than 
1.2.5. This is why there is ZLIB_VERNUM, which is a number that can be compared. So 
it should be simply:

    exit(ZLIB_VERNUM < 0x1250);


More information about the R-help mailing list