19

I was a happy user of StatET on Ubuntu 14.04 until recently when after R upgrades strange things begin to happen. Anything related to network operations fails. For example, I can not install packages from CRAN any more:

> install.packages("Hmisc")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Error in url("http://cran.r-project.org/CRAN_mirrors.csv") : 
  internet routines cannot be loaded
In addition: Warning message:
In url("http://cran.r-project.org/CRAN_mirrors.csv") :
  unable to load shared object '/usr/lib/R/modules//internet.so':
  /usr/lib/R/modules//internet.so: symbol curl_multi_wait, version CURL_OPENSSL_3 not defined in file libcurl.so.4 with link time reference

It works smoothly if I run R in terminal:

> install.packages("Hmisc")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.at.r-project.org/src/contrib/Hmisc_3.16-0.tar.gz'
Content type 'application/x-gzip' length 629536 bytes (614 KB)
==================================================
downloaded 614 KB

OpenBLAS : Your OS does not support AVX instructions. OpenBLAS is using Nehalem kernels as a fallback, which may give poorer performance.
* installing *source* package ‘Hmisc’ ...
** package ‘Hmisc’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Hmisc.c -o Hmisc.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c cidxcn.f -o cidxcn.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c cidxcp.f -o cidxcp.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c hoeffd.f -o hoeffd.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c jacklins.f -o jacklins.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c largrec.f -o largrec.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c mChoice.c -o mChoice.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c maxempr.f -o maxempr.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c nstr.c -o nstr.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c ranksort.c -o ranksort.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c rcorr.f -o rcorr.o
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG      -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c string_box.c -o string_box.o
gfortran   -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4  -c wclosest.f -o wclosest.o
gcc -std=gnu99 -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o Hmisc.so Hmisc.o cidxcn.o cidxcp.o hoeffd.o jacklins.o largrec.o mChoice.o maxempr.o nstr.o ranksort.o rcorr.o string_box.o wclosest.o -lgfortran -lm -lquadmath -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/Hmisc/libs
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
OpenBLAS : Your OS does not support AVX instructions. OpenBLAS is using Nehalem kernels as a fallback, which may give poorer performance.
* DONE (Hmisc)

The downloaded source packages are in
    ‘/tmp/RtmpVfRKYi/downloaded_packages’

> sessionInfo()
R version 3.2.1 (2015-06-18)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.2 LTS

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=en_US.UTF-8          
 [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

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

other attached packages:
[1] rj_2.0.4-2

loaded via a namespace (and not attached):
[1] tools_3.2.1   rj.gd_2.0.0-1

What would be the problem here? How can I make this work again?

Edit per request in comments section:

sessionInfo() R version 3.2.1 (2015-06-18) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 14.04.2 LTS

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=en_US.UTF-8          
 [9] LC_ADDRESS=en_US.UTF-8        LC_TELEPHONE=en_US.UTF-8     
[11] LC_MEASUREMENT=en_US.UTF-8    LC_IDENTIFICATION=en_US.UTF-8

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

other attached packages:
[1] rj_2.0.4-2

loaded via a namespace (and not attached):
[1] tools_3.2.1   rj.gd_2.0.0-1

> library(Hmisc)
Loading required package: grid
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: ‘Hmisc’

The following objects are masked from ‘package:base’:

    format.pval, round.POSIXt, trunc.POSIXt, units
Samo
  • 2,065
  • 20
  • 41
  • 1
    where is the first `install.packages` tried? is it rstudio? have you upgraded rstudio? – Alex Jul 08 '15 at 05:52
  • 1
    StatET (http://www.walware.de/goto/statet). This install.packeges works in RStudio and in R console in ubuntu terminal. It fails in R console in StatET/Eclipse with the above error. I suspect rJava or rj or whatever package connected to Java is the cause of this... – Samo Jul 08 '15 at 08:39
  • 1
    Have you updated rJava and rj after upgrading R? – Peter Humburg Jul 09 '15 at 09:31
  • 1
    Yes. Did just now once again. Doesn't help. I have no idea why in case of runing R in StatET picks up different paths than R run in terminal or RStudio... – Samo Jul 09 '15 at 14:29
  • 1
    What does the `sessionInfo()` from StatET look like? Could you also confirm whether you can load `Hmisc` in StatET once it has been installed via the R console? – Peter Humburg Jul 09 '15 at 21:14
  • I have edited original question and added information on sessionInfo() and library(Hmisc) output. Loading f Hmisc is successful in StatET... – Samo Jul 10 '15 at 14:47
  • That all looks as expected I think. Is it possible that your `LD_LIBRARY_PATH` is modified by StatET? You could check that `Sys.getenv("LD_LIBRARY_PATH")` returns the same value when called from the R console and StatET. If all else fails you could resort to installing packages through the R console (as you have done for Hmisc) but clearly that isn't ideal. – Peter Humburg Jul 13 '15 at 13:17
  • Yes. You are right. In StatET: > Sys.getenv("LD_LIBRARY_PATH") [1] "/usr/lib/R/lib:" and in R consol in terminal > Sys.getenv("LD_LIBRARY_PATH") [1] "/usr/lib/R/lib:/usr/lib/x86_64-linux-gnu:/usr/lib" But I have no idea how this can happen... I have to use StatET due to outstanding development environemnt an debugging capabilities. – Samo Jul 13 '15 at 20:25

3 Answers3

5

Based on the information given in the question and comments it seems that the issue is that for some reason the LD_LIBRARY_PATH is incorrect when using StatET. I don't know why that is and there may be a better solution to this problem but you should be able to work around it at least. Add a line to .Rprofile or Rprofile.site that uses Sys.setenv() to set your LD_LIBRARY_PATH to something sensible. Based on the information given above that might look something like this:

Sys.setenv(LD_LIBRARY_PATH="/usr/lib/R/lib:/usr/lib/x86_64-linux-gnu:/usr/lib")
Peter Humburg
  • 550
  • 5
  • 15
  • Thanks for the answer. When I add the call to Sys.setenv(LD_LIBRARY_PATH="/usr... before running anything network related (like the above install.packages) the problem still persists: internet routines cannot be loaded (unable to load shared object '/usr/lib/R/modules//internet.so') . Any other hints/ideas? – Samo Jul 30 '15 at 17:32
3

If it is indeed a problem with the variable LD_LIBRARY_PATH then you can set it in eclipse for your specified R configuration via Run->Run configurations->Environment tab.

Environment tab in statet

you may also need to check the settings for your R environment.

Other tab in statet

Jeff
  • 718
  • 8
  • 20
  • Unfortunately this does not solve the problem. Now internet routines get loaded correctly, but, still, if it does not work: > library(PerformanceAnalytics) ... Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/usr/local/lib/R/site-library/PerformanceAnalytics/libs/PerformanceAnalytics.so': /usr/local/lib/R/site-library/PerformanceAnalytics/libs/PerformanceAnalytics.so: undefined symbol: dgemm_ Error: package or namespace load failed for ‘PerformanceAnalytics’ – Samo Aug 01 '15 at 07:16
  • Are the settings in Window->Preferences->StatET->R Environments->Edit button correct? – Jeff Aug 01 '15 at 12:19
  • > Sys.getenv("LD_LIBRARY_PATH") [1] "/usr/lib/R/lib:/usr/lib/x86_64-linux-gnu:/usr/local/lib/R/site-library:/usr/lib" – Samo Aug 02 '15 at 09:31
  • Check the 2nd picture in my answer – Jeff Aug 02 '15 at 09:33
  • They look correct to me. :) What should I pay attention to? – Samo Aug 02 '15 at 09:33
  • In that case I would reinstall R – Jeff Aug 02 '15 at 09:36
  • It looks like on your screenshots. Why would re-installing R help? R work in a correct way when started from Ubuntu terminal or when used using RStudio... I somehow assume this is related to R and JAVA integration or how StatET starts R... – Samo Aug 03 '15 at 10:59
  • If you run `sessionInfo()` in R started from StatET and directly from the terminal, do you get the same version? I think maybe StatET is pointed towards an older R version. – Jeff Aug 03 '15 at 11:11
  • R in terminal: > sessionInfo() R version 3.2.1 (2015-06-18) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 14.04.2 LTS R in StatET: > sessionInfo() R version 3.2.1 (2015-06-18) Platform: x86_64-pc-linux-gnu (64-bit) Running under: Ubuntu 14.04.2 LTS – Samo Aug 03 '15 at 12:36
  • The only notable difference is that in StatET I also have following packages loaded (besides the standard ones in R in terminal): other attached packages: [1] rj_2.0.4-2 loaded via a namespace (and not attached): [1] tools_3.2.1 rj.gd_2.0.0-1 – Samo Aug 03 '15 at 12:43
  • Those packages need to be loaded for StatET to work. In that case I am not sure what the solution is - I found this link which may be of use, however http://r.789695.n4.nabble.com/Unable-to-install-packages-internet-routines-cannot-be-loaded-td4709240.html – Jeff Aug 03 '15 at 15:30
  • Issues with internet "routines cannot be loaded " were resolved. The problem persists with for example > library(PerformanceAnalytics) ... Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/usr/local/lib/R/site-library/PerformanceAnalytics/libs/PerformanceAnalytics.so‌​': /usr/local/lib/R/site-library/PerformanceAnalytics/libs/PerformanceAnalytics.so: undefined symbol: dgemm_ Error: package or namespace load failed for ‘PerformanceAnalytics’ Although I have just built it from source (without any errors) once more. When I try to load it it fails... – Samo Aug 03 '15 at 15:50
0

Check this suggestion too...

"Fixed ! I just added the following command to my .bash_profile, and the problem was resolved. export LD_LIBRARY_PATH=$TOOLS/curl-7.43.0/lib:$LD_LIBRARY_PATH"

or these ones

Estatistics
  • 874
  • 9
  • 24