Search code examples
rfedora

libicu and stringi on Fedora 24 causing R headaches


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?


Solution

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