在macOS Sierra 10.12.1上安装rJava:链接器错误licuuc [英] Install rJava on macOS Sierra 10.12.1: linker error licuuc

查看:248
本文介绍了在macOS Sierra 10.12.1上安装rJava:链接器错误licuuc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在R-Studio中安装rJava但错误

I am trying to install rJava within R-Studio but the error

ld: library not found for -licuuc
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [libjri.jnilib] Error 1
make[1]: *** [src/JRI.jar] Error 2
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rJava’
* removing ‘/Users/iMacLinda/Library/R/3.3/library/rJava’
Warning in install.packages :
  installation of package ‘rJava’ had non-zero exit status

R


version _ platform x86_64- apple-darwin16.1.0 arch x86_64 os
darwin16.1.0 system x86_64,darwin16.1.0 status major 3 3年
2016月10日31 svn rev 71607语言R version.string R版本
3.3.2(2016-10-31)昵称真诚的南瓜补丁

version _ platform x86_64-apple-darwin16.1.0 arch x86_64 os darwin16.1.0 system x86_64, darwin16.1.0 status major 3 minor 3.2 year 2016 month 10 day 31 svn rev 71607 language R version.string R version 3.3.2 (2016-10-31) nickname Sincere Pumpkin Patch

如何修复此链接器错误?

推荐答案

Anaconda有一个解决方案这里。问题在于路径变量,所以也许这也可以解决问题。我在下面概述了如何在这里解决它的解决方案。

There is a solution for this with Anaconda here. The problem was with the path variable so perhaps this could solve the problem here as well. I outline the solution below about how it could be solved here.


  1. 检查配置设置

  1. Check up your config settings

R CMD config --ldflags
-L/Users/osx/anaconda3/lib/R/lib -lR -lpcre -llzma -lbz2 -lz -lm -liconv -licuuc -licui18n


  • 测试此 mv~ / .bash_profile~ / .bash_profile_backup

    重新启动终端。

    现在R中的环境变量应该不同

    Now the environment variables in R should be different

    $ R CMD config --ldflags
    -F/Library/Frameworks/R.framework/.. -framework R -lpcre -llzma -lbz2 -lz -licucore -lm -liconv
    


  • 运行以下

  • Run the following

    sudo R CMD javareconf 
    Rscript -e 'install.packages("rJava", repos="http://rforge.net", type="source")' 
    


  • 如果你能够安装rJava,问题在你的道路上,否则尝试替代解决方案。

  • If you was able to install rJava, the problem was in your path otherwise try alternative solutions.

    使用Homebrew的替代解决方案

    此外,Homebrew还有一个解决方案此处其中R安装了 brew cask install r-app 并且必须在没有forenmp标志的情况下重新编译gcc。

    There is also a solution for this with Homebrew here where R is installed with brew cask install r-app and gcc had to be recompiled without a forenmp flag.

    这篇关于在macOS Sierra 10.12.1上安装rJava:链接器错误licuuc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

  • 查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆