我正在尝试通过以下方式安装R包profvis:
with_envvar(c(LDFLAGS = "-L/usr/local/opt/readline/lib",
CPPFLAGS= "-I/usr/local/opt/readline/include"),
devtools::install_github("rstudio/profvis"))但是,我得到的错误消息是:
...
clang -I/Library/Frameworks/R.framework/Resources/include -DNDEBUG -I/usr/local/include -I/usr/local/include/freetype2 -I/opt/X11/include -DPLATFORM_PKGTYPE='"mac.binary.mavericks"' -fPIC -Wall -mtune=core2 -g -O2 -c pause.c -o pause.o
clang -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/opt/X11/lib -L/usr/local/lib /usr/local/lib/libcairo.a /usr/local/lib/libpixman-1.a /usr/local/lib/libfreetype.a /usr/local/lib/libfontconfig.a -lxml2 /usr/local/lib/libreadline.a -o profvis.so pause.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
clang: error: no such file or directory: '/usr/local/lib/libreadline.a'
make: *** [profvis.so] Error 1
ERROR: compilation failed for package ‘profvis’
* removing ‘/Library/Frameworks/R.framework/Versions/3.2/Resources/library/profvis’
Error: Command failed (1)库的位置在这里:
$ ls /usr/local/opt/readline/lib/libreadline.a
/usr/local/opt/readline/lib/libreadline.a请注意,我没有选择符号链接到/usr/local
$ brew info readline
readline: stable 6.3.8 (bottled) [keg-only]
Library for command-line editing
https://tiswww.case.edu/php/chet/readline/rltop.html
/usr/local/Cellar/readline/6.3.8 (40 files, 2.1M)
Poured from bottle
From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/readline.rb
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local.这是因为我在输入brew link readline时收到警告
Warning: readline is keg-only and must be linked with --force
Note that doing so can interfere with building software.我应该使用--force选项进行符号链接,还是有更好的方法?
发布于 2016-02-09 03:47:22
当我尝试在MacOSX10.11.4Beta (15E33e),MicrosoftROpen3.2.3和RStudio 0.99.491上从github安装hadley/lineprof时,我也遇到了类似的问题。
我决定在安装时强制使用符号链接,然后删除它们。首先,我创建了符号链接:
$ brew link --force readline然后在R I中安装lineprof:
> devtools::install_github("hadley/lineprof")在成功安装lineprof之后,我删除了符号链接:
$ brew unlink readline我还必须在链接后重新启动RStudio,但我不知道这有什么关系。
https://stackoverflow.com/questions/34715849
复制相似问题