原创

recompile with -fPIC报错解决

温馨提示:
本文最后更新于 2022年09月28日,已超过 574 天没有更新。若文章内的图片失效(无法正常加载),请留言反馈或直接联系我

背景

安装synapser R包时需要PythonEmbedInR R包依赖,安装这个依赖命令如下

install.packages("PythonEmbedInR",destdir = '/home/xhs/Rpack/download',repos=c("http://cran.fhcrc.org", "http://ran.synapse.org"))

安装失败,报错如下

一大串的编译错误

/usr/lib/libpython3.6m.a(myreadline.o): relocation R_X86_64_32 against `xxxxxxx’ can not be used when making a shared object; recompile with -fPIC.

解决方案

这个是一个共享库的问题,直接去/usr/lib/目录下重名后,再安装

sudo mv libpython3.6m.a libpython3.6m.a.bak

再返回rstudio安装PythonEmbedInR,成功无报错。

正文到此结束
本文目录