gpt4 book ai didi

macos - 安装 Cairo R 包时出错

转载 作者:行者123 更新时间:2023-12-05 02:24:32 24 4
gpt4 key购买 nike

我正在尝试在 Mac OS X 10.7.4 上的 R 开发版本中安装 Cairo 包,但我遇到了无法解决的问题。

我已经用自制软件安装了 Cairo(即 brew install cairo)并收到以下消息:

==> Caveats This formula is keg-only, so it was not symlinked into /usr/local.

Mac OS X already provides this program and installing another version in parallel can cause all kinds of trouble.

The Cairo provided by Leopard is too old for newer software to link against.

Generally there are no consequences of this for you. If you build your own software and it requires this formula, you'll need to add its lib & include paths to your build variables:

LDFLAGS  -L/usr/local/Cellar/cairo/1.12.2/lib
CPPFLAGS -I/usr/local/Cellar/cairo/1.12.2/include

考虑到上述消息,我尝试使用以下 R 命令从 R-Forge 安装 Cairo 包:

install.packages("Cairo", repos="http://www.rforge.net/", configure.args = c("CAIRO_LIBS=/usr/local/Cellar/cairo/1.12.2/lib", "CAIRO_CFLAGS=/usr/local/Cellar/cairo/1.12.2/include/cairo"))

我收到以下错误:

checking cairo.h usability... no

checking cairo.h presence... no

checking for cairo.h... no

configure: error: Cannot find cairo.h!

Please install cairo (http://www.cairographics.org/) and/or set

CAIRO_CFLAGS/LIBS correspondingly. ERROR: configuration failed for package ‘Cairo’

我在没有 repos 参数的情况下重复了相同的命令(默认情况下,我使用 FHCRC 镜像),结果相同。

此时,问题似乎很明显:文件 cairo.h 不存在。但后来我列出了 include/cairo 目录中的文件。这是响应:

ls /usr/local/Cellar/cairo/1.12.2/include/cairo

cairo-deprecated.h cairo-ft.h cairo-ps.h cairo-script-interpreter.h cairo-svg.h cairo-xcb.h cairo-xlib.h cairo-features.h cairo-pdf.h cairo-quartz.h cairo-script.h cairo-version.h cairo-xlib-xrender.h cairo.h

因此,我将 Cairo 包的安装指向适当的位置,但错误仍然存​​在。我尝试过一些变体,例如 CAIRO_CFLAGS=/usr/local/Cellar/cairo/1.12.2/include,但没有成功。

想法?非常感谢您提供的任何帮助。

如果有必要,这是我的sessionInfo:

R Under development (unstable) (2012-08-08 r60208) Platform: x86_64-apple-darwin11.4.0 (64-bit)

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils
datasets methods base

other attached packages: [1] BiocInstaller_1.5.12

loaded via a namespace (and not attached): [1] tools_2.16.0

最佳答案

我在 cairo 配置错误方面遇到了类似的问题,并且我已经使用自制软件安装了 cairo。试试下面

brew install pkg-config

这解决了我的问题。

关于macos - 安装 Cairo R 包时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11893780/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com