1

I am trying to install R 4.0.0 from source according to these instructions on my trisquel 8.0 machine.

Specifically, I'm configuring with the command ./configure --prefix=/opt/R/4.0.0 --enable-memory-profiling --with-blas --with-lapack --with-x=no

However, this does not complete successfully and returns the error: checking whether zlib support suffices... configure: error: zlib library and headers are required

But I've already installed zlib, as evidenced by sudo dpkg -s zlib1g which outputs

Package: zlib1g
Status: install ok installed
...
Version: 1:1.2.11.dfsg-2ubuntu1
... 

All troubleshooting on the internet I've found so far points to doing something like this, which doesn't work for me since the suggested fix is already implemented (more or less) in configure for R 4.0.0:

#ifdef ZLIB_VERNUM
  if(ZLIB_VERNUM < 0x1250)
    exit(1);
  exit(0);
  else
    exit(1);
#endif

I've also tried installing another copy of zlib in /opt, which didn't work, and I can't uninstall the current version of zlib because of dependencies.

Also, I'd really rather not install zlib 1.2.9 or another out of date version of zlib. The latest version of zlib came out in 2017 and R 4.0.0 came out this year, they should hopefully work together?

Thanks to anyone who can help.

anthony_m
  • 61
  • 1
  • 5
  • 1
    You might need `zlib1g-dev` – GKi Apr 28 '20 at 15:41
  • @GKi I forgot to mention that zlib1g-dev is already installed and the configure still doesn't work :/ – anthony_m Apr 28 '20 at 15:50
  • Check config.log for more detailed errors? – Shawn Apr 28 '20 at 20:36
  • Are you cross compiling? What else is said about zlib in the configure log? E.g. I see this: ````checking for zlib.h... yes checking if zlib version >= 1.2.5... yes checking whether zlib support suffices... yes``` – CameronNemo Mar 12 '22 at 21:28
  • Hello, I have the same issue, installing R-4.3.0 on an Ubuntu machine, zlib 1.2.11 already installed, I cannot find any relevant answer on this. – paulduf May 10 '23 at 08:30

1 Answers1

2

This should solve your problem.

$ sudo apt install zlib1g zlib1g-dev