R Cairo 软件包在 Ubuntu 18.04 中安装失败



我尝试在 Docker Ubuntu 18.04 容器下安装 R 中的 Cairo 软件包。在安装 R Cairo 软件包之前,我在 Ubuntu 中安装了这些数据包:libgtk2.0-dev、libcairo2-dev、xvfb、xauth、xfonts-base、r-base-dev 和 libxt-dev。

但是,当我在 R 中安装 Cairo 软件包时,出现以下错误:

checking if R was compiled with the RConn patch... no
checking cairo.h usability... yes
checking cairo.h presence... yes
checking for cairo.h... yes
checking for PNG support in Cairo... yes
checking for ATS font support in Cairo... no
configure: CAIRO_LIBS=-lfreetype -lz -lpng16 -lz -lcairo -lXext -lXrender -lX11
checking for library containing deflate... no
checking whether Cairo programs can be compiled... configure: error: Cannot 
compile a simple Cairo program. See config.log for details.
ERROR: configuration failed for package ‘Cairo’
* removing ‘/opt/conda/lib/R/library/Cairo’
The downloaded source packages are in
‘/tmp/RtmprETcPh/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("Cairo") :
installation of package ‘Cairo’ had non-zero exit status

我已经检查了/tmp/RtmprETcPh/downloaded_packages,只有一个名为Cairo_1.5-9.tar.gz的文件。而且我不知道在哪里可以找到配置.log以获取编译简单开罗程序的更多编译细节。

如果有人知道如何解决此问题,请帮助我解决此问题。

谢谢

您可能需要安装 x11 开发库,因为 docker 容器可能没有运行这些库。 尝试

sudo apt-get install libx11-dev

在 ubuntu 20.04 下,安装 libx11-dev 后,尝试安装 Cairo 给出了错误 X11/Intrinsic.h 找不到。这是在libxt-dev中。安装后,可以安装开罗。

最新更新