zlib/bz2 library and headers are requried for compiling R

11,798

Solution 1

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);

Solution 2

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.

Share:
11,798
cartoonist
Author by

cartoonist

:)

Updated on June 23, 2022

Comments

  • cartoonist
    cartoonist almost 2 years

    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)
  • Haozhe Xie
    Haozhe Xie about 7 years
  • cartoonist
    cartoonist about 7 years
    @HaozheXie I think, it should be a bug report rather than an answer in SO.
  • Mian Asbat Ahmad
    Mian Asbat Ahmad about 6 years
    This is already commented out and I am still getting the bug.