Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

zlib/bz2 library and headers are requried for compiling R

Trying to compile R-3.3.2 on Debian Jessie, all dependencies are installed. However the ./configure script complains about the zlib/bzip2 library versions not matching with the minimum requirement.

Minimum version required:

  • zlib: 1.2.6 (installed version: 1.2.11)
  • bzip2: 1.0.6 (installed version: 1.0.6)
like image 507
cartoonist Avatar asked Feb 06 '17 20:02

cartoonist


2 Answers

After looking at the parts of configure script checking the library versions, it seems that it compares versions with strcmp or strncmp. Since "1.2.11" is lexicographically smaller that "1.2.6" it return a non-zero value indicating that the match failed. Besides, it just compares the first 5 characters which is also not what it is intented. So, it's a bug in configure script. Changing the script fixed the issue.

For zlib, find this line:

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

Change it to:

exit(ZLIB_VERNUM < 0x1250);
like image 166
cartoonist Avatar answered Nov 19 '22 05:11

cartoonist


I had some issues installing R myself, specifically with the error

checking for BZ2_bzlibVersion in -lbz2... no

I had to install libbz2-dev to get that error to go away.

Unfortunately, I came across a few more issues while running ./configure and had to do a little more digging to find out how to solve it.

Discussion on issue

After reading that, I had realized I had to install a couple packages like libcurl4-openssl-dev, libpcre3, and liblzma-dev to finally finish the configuration.

The cited link suggested

At this stage you could have as well tried to install R 3.2.0RC ... R-devel has not yet diverged much.

Personally, I think that installing an older version to resolve dependency issues reeks of laziness, but that's just my two cents.

like image 27
chase Avatar answered Nov 19 '22 06:11

chase