Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libicu and stringi on Fedora 24 causing R headaches

Tags:

r

fedora

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?

like image 790
KirkD-CO Avatar asked Aug 17 '16 02:08

KirkD-CO


2 Answers

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'
like image 183
Stefano Avatar answered Sep 18 '22 21:09

Stefano


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).

like image 36
pbarill Avatar answered Sep 17 '22 21:09

pbarill