0

I am getting an error when I am trying to install xgboost_1.3.2.1 in R V4.0.5

The error

Error: package or namespace load failed for ‘xgboost’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/opt/R/4.0.5/lib/R/library/00LOCK-
xgboost/00new/xgboost/libs/xgboost.so':
  /usr/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.23' not found (required by     
/opt/R/4.0.5/lib/R/library/00LOCK-xgboost/00new/xgboost/libs/xgboost.so)
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/opt/R/4.0.5/lib/R/library/xgboost’

The session info :

R version 4.0.5 (2021-03-31)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux

Matrix products: default
BLAS/LAPACK: /usr/lib64/libopenblasp-r0.3.3.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C               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    LC_PAPER=en_US.UTF-8       LC_NAME=C                 
[9] LC_ADDRESS=C               LC_TELEPHONE=C             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] compiler_4.0.5    magrittr_2.0.1    Matrix_1.3-2      tools_4.0.5       grid_4.0.5        
data.table_1.14.0
[7] lattice_0.20-41 

I can install the XGboost in the linux with no problem. But when I try to load it in the Rstudio Server, I still get the same error

library("xgboost") Error: package or namespace load failed for ‘xgboost’ in dyn.load(file, DLLpath = DLLpath, ...): unable to load shared object '/opt/R/4.0.5/lib/R/library/xgboost/libs/xgboost.so': /usr/local/lib64/libstdc++.so.6: version `GLIBCXX_3.4.23' not found (required by /opt/R/4.0.5/lib/R/library/xgboost/libs/xgboost.so)

Phil
  • 7,287
  • 3
  • 36
  • 66
Sadjad
  • 1
  • I read that as 'I can't find the GLIBCXX' to accomplish this. Using binutils `$strings /path/to/your/libstdc++.so.6 | grep LIBCXX | more` which if you have _3.4.23 it's probably permissions (maybe try sudo RStudio startup if you have admin), or `rpm -q libstdc++`, all from [libstdc++ version](https://stackoverflow.com/questions/10354636/how-do-you-find-what-version-of-libstdc-library-is-installed-on-your-linux-mac), HTH – Chris Apr 20 '21 at 19:35
  • @Chris, Thanks for the comment. I can see the GLIBCXX_3.4.23 when I run `$strings /usr/lib64/libstdc++.so.6 | grep LIBCXX | more` but not in /usr/lib/... . How can I fix the permission issue? I tried `ln -fs /usr/local/lib/libstdc++.so.6 /usr/lib64/libstdc++.so.6` which was not helpful. I ran `rpm -q libstdc++` and the results where `libstdc++-4.8.5-44.el7.x86_64 libstdc++-4.8.5-44.el7.i686`. sorry, I am very new in this world! – Sadjad Apr 20 '21 at 20:17
  • When you run `$strings` you see it in /usr/lib64 rather than /usr/lib, I'm guessing. `ln` -s [thing you desperately want] [what you call it, ie filename], in that order. So, you go to /usr/lib and do `ln -s /usr/lib64/libstdc++.so.6 /usr/local/lib/libstdc++.so.6` And see how it goes. Perhaps close the terminal you're in and start again, new state. For how `install.packages` is doing configure-args see [config_args]( https://stackoverflow.com/questions/42287164/install-udunits2-package-for-r3-3?rq=1), HTH – Chris Apr 22 '21 at 02:39

0 Answers0