I can not install the stringi package in CentOS

5

I'm trying to install the package stringi on a cluster that runs CentOS 7, but I'm failing miserably. The error that occurs is below:

** testing if installed package can be loaded
Error in dyn.load(file, DLLpath = DLLpath, ...) :
  unable to load shared object '/home/marcus/R/x86_64-redhat-linux-gnu-library/3.3/stringi/libs/stringi.so':
  /lib64/libstdc++.so.6: version 'CXXABI_1.3.8' not found (required by /home/marcus/R/x86_64-redhat-linux-gnu-library/3.3/stringi/libs/stringi.so)
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/home/marcus/R/x86_64-redhat-linux-gnu-library/3.3/stringi’

The downloaded source packages are in
    ‘/tmp/RtmpHKpp7q/downloaded_packages’
Warning message:
In install.packages("stringi") :
  installation of package ‘stringi’ had non-zero exit status

I already asked this question in the original OS and got a comment on it , but my ignorance in Linux did not allow me to understand what I need to do. I know it has something to do with libstdc++.so.6 , but I can not go any further than this.

The session details of R where I tried to install the package are below.

> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C
 [9] LC_ADDRESS=C               LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

loaded via a namespace (and not attached):
[1] tools_3.3.1
    
asked by anonymous 07.12.2016 / 01:22

1 answer

2

I discovered the problem. While rolling

strings /usr/lib64/libstdc++.so.6 | grep CXXABI

I get the output

CXXABI_1.3
CXXABI_1.3.1
CXXABI_1.3.2
CXXABI_1.3.3
CXXABI_1.3.4
CXXABI_1.3.5
CXXABI_1.3.6
CXXABI_1.3.7
CXXABI_TM_1

That is, I do not have CXXABI_1.3.8 installed in the cluster. When I went to investigate the reason for this, I discovered that it might be my version of gcc that was outdated. I checked out which version I had and bingo:

$ gcc -v
gcc version 4.8.5 20150623 (Red Hat 4.8.5-4) (GCC)

Now it was just a matter of installing gcc 4.9.x . To do this in CentOS, just run

$ sudo yum install devtoolset-3-gcc-c++
$ sudo yum install devtoolset-3-gcc-gfortran
$ scl enable devtoolset-3 bash

The first two commands install the C, C ++, and Fortran compilers. The third tells the operating system to use gcc 4.9.x as the default compiler. So when I check which version of gcc is active in the cluster, I get the following:

$ gcc -v
gcc version 4.9.2 20150212 (Red Hat 4.9.2-6) (GCC)

This is done, just enter R , execute install.packages("stringi") and install the package normally.

In short, my problem was the gcc version installed on the machine. As far as I'm concerned, stringi requires version 4.9.x. Version 4.8.x, older, did not work, as 5.3.0 did not work either.

    
08.12.2016 / 16:56