首页 > 解决方案 > R 4.0.0“配置:错误:zlib 库和头文件是必需的”

问题描述

我正在尝试根据这些说明在我的 trisquel 8.0 机器上从源代码安装 R 4.0.0。

具体来说,我正在使用命令进行配置 ./configure --prefix=/opt/R/4.0.0 --enable-memory-profiling --with-blas --with-lapack --with-x=no

但是,这没有成功完成并返回错误: checking whether zlib support suffices... configure: error: zlib library and headers are required

但是我已经安装了 zlib,从sudo dpkg -s zlib1g哪个输出可以看出

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

到目前为止,我在互联网上发现的所有故障排除都指向做这样的事情这对我不起作用,因为建议的修复已经(或多或少)在configureR 4.0.0 中实施:

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

我还尝试在 /opt 中安装另一个 zlib 副本,但没有成功,并且由于依赖关系,我无法卸载当前版本的 zlib。

另外,我真的不想安装 zlib 1.2.9 或其他过时版本的 zlib。2017年最新版zlib出来了,今年R 4.0.0也出来了,他们应该有希望合作吗?

感谢任何能提供帮助的人。

标签: rlinuxzlib

解决方案


这应该可以解决您的问题。

$ sudo apt install zlib1g zlib1g-dev


推荐阅读