2

While trying to install R from source, I ran into linker issues, in particular: undefined reference to 'u_getVersion_58

I found limited information on this error (eg, this post on the RStudio forum). Despite running apt-get build-dep, these issues persisted.

It is apparent from these comments by Dirk Eddenbuettel that it relates to libicu versions. I have libicu version 60, while R 3.6.0 and similar recent versions seem to require version 58.

alan ocallaghan
  • 3,116
  • 17
  • 37

1 Answers1

0

We can install a previous version of libicu from source as follows:

wget http://download.icu-project.org/files/icu4c/58.2/icu4c-58_2-src.tgz
tar -xf icu4c-58_2-src.tgz
cd icu
make
make install

However, make is likely to run into a compilation error due to missing xlocale.h. As indicated on this github post, this can be solved by running ln -s /usr/include/locale.h /usr/include/xlocale.h, as xlocale.h is just a subset of locale.h which was removed from glibc recently. After this, make and make install should succeed for icu version 58, and following that, for R.

alan ocallaghan
  • 3,116
  • 17
  • 37
  • Didn't work for me. Still get same errors with make to R even though I enter LDFLAGS=-L/usr/local/lib where I installed icu 58 – Brian Wiley Sep 22 '20 at 18:46
  • 1
    Actually I lied it worked after removing the 2 enable and 2 with parameters indicated here in configure https://docs.rstudio.com/resources/install-r-source/ – Brian Wiley Sep 22 '20 at 18:49
  • As of 2023 August 31, I can't seem to decompress the .tgz as written. ``` tar -xf icu4c-58_2-src.tgz gzip: stdin: not in gzip format tar: Child returned status 1 tar: Error is not recoverable: exiting now ``` – ohnoplus Aug 31 '23 at 20:23
  • @ohnoplus try https://github.com/unicode-org/icu/releases/download/release-58-3/icu4c-58_3-src.tgz – alan ocallaghan Sep 01 '23 at 09:56