liunx 安装rJava时:/usr/bin/ld: cannot find -lpcre

15 篇文章 0 订阅

各位朋友,我已开通微信公共号:小程在线

我会把文章及时的更新到公共号上,欢迎大家的关注。

 

环境:redhat6.4;R-3.3.1;JDK-1.7

/usr/bin/ld: cannot find -lpcre

collect2: ld returned 1 exit status
make[2]: *** [libjri.so] Error 1
make[2]: Leaving directory `/tmp/RtmpDRk6WF/R.INSTALL1054e47ef3321/rJava/jri/src'
make[1]: *** [src/JRI.jar] Error 2
make[1]: Leaving directory `/tmp/RtmpDRk6WF/R.INSTALL1054e47ef3321/rJava/jri'
make: *** [jri] Error 2
ERROR: compilation failed for package ‘rJava’

* removing ‘/home/cheng/R/R-3.3.1/lib64/R/library/rJava’

解决方法:

yum install pcre

yum install pcre pcre-devel

/usr/bin/ld: cannot find -lpcre中lpcre中的‘l’忽略就可以,后面才是对应库名称。

installing via 'install.libs.R' to /home/cheng/R/R-3.3.1/lib64/R/library/rJava
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (rJava)


The downloaded source packages are in
‘/tmp/Rtmpvdvb1f/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done

> library('rJava')

就可以正常使用了

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值