libicu and stringi on Fedora 24 causing R headaches

落爺英雄遲暮 提交于 2020-07-20 10:51:51

问题


I recently upgraded to F24, and now in my R session I cannot get a few packages to load, sp. reshape2, latex2exp, knitr, and others.

The initial problem I found was that F24 uses libicu56 whereas these packages expect libicu54. I followed a suggestion in this thread to set the symbolic links with the desired version:

ln -s /usr/lib64/libicui18n.so.56 /usr/lib64/libicui18n.so.54    
ln -s /usr/lib64/libicuuc.so.56 /usr/lib64/libicuuc.so.54
ln -s /usr/lib64/libicudata.so.56 /usr/lib64/libicudata.so.54

That initial error went away, but now I have this:

Error in dyn.load(file, DLLpath = DLLpath, ...) : 
   unable to load shared object '/home/uname/R/x86_64-redhat-linux-gnu-library/3.3/stringi/libs/stringi.so':
  /home/uname/R/x86_64-redhat-linux-gnu-library/3.3/stringi/libs/stringi.so: undefined symbol: _ZTIN6icu_548ByteSinkE

This leads me to the stringi package for R, but I cannot get it to load - it gives the same error.

I have updated F24 and all the R packages as well.

Any ideas?


回答1:


That just happened to me following an update of icu (Gentoo). Another solution is to remove and install again stringi, as it is looking for a specific library file that does not exist anymore.

remove.packages('stringi')
install.packages('stringi')

If your .Rprofile triggers library(stringi), then you must start a session using R --vanilla in order to do this, else it will keep failing.

The other solution with --disable-pkg-config works as well. It will make stringi build icu for itself rather than rely on the system's (the source ships with a copy of icu).




回答2:


I was able to install the package stringi on fedora 24 by downloading the tar.gz package from CRAN and then run the following command:

R CMD INSTALL stringi_1.1.1.tar.gz --configure-args='--disable-pkg-config'


来源:https://stackoverflow.com/questions/38987157/libicu-and-stringi-on-fedora-24-causing-r-headaches

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!