Error while running R from commandlne ubuntu : error while loading shared libraries: libpcre.so.1: cannot open shared object file - r

Hi I am running R on Ubuntu : Getting this error:
/home/user/anaconda3/lib/R/bin/exec/R: error while loading shared libraries: libpcre.so.1: cannot open shared object file: No such file or directory
I have installed anaconda recently, I have tried
$echo $LD_LIBRARY_PATH
It shows nothing. I also tried
$sudo find / lib | grep libpcre.so.1
I want to run R on Ubuntu. It was running fine before; any hints?

Related

Unable to run make.exe on Windows 10(Mobaxterm)

I am unable to run make.exe on Windows 10 (Mobaxterm)
I'm getting the below error:
make --version
C:/Users/hp/DOCUME~1/MOBAXT~1/slash/bin/make.exe: error while loading shared libraries: cygguile-2.0-22.dll: cannot open shared object file: No such file or directory
Any guidance would be much appreciated

Ubuntu 16.04: fatal error: X11/Xlib.h: No such file or directory

I am trying to install Rgtk2 (dependency for rattle). I am using R thru Anaconda. I am getting the following error.
In file included from Rgtk.c:7:0:
/usr/include/gtk-2.0/gdk/gdkx.h:32:10: fatal error: X11/Xlib.h: No such file or directory
#include <X11/Xlib.h>
^~~~~~~~~~~~
I tried the following workarounds as found in StackOverflow and other blogs.
Installed libx11-dev, mesa-common-dev, libglu1-mesa-dev, libxrandr-dev, libxi-dev
Tried installing RGtk2_2.20.31 from source.
Every time I am getting the same error.
anaconda has its own environment, which by default usually lacks X11 headers(e.g libx11-dev, or whatever you call it). Try "conda install -c conda-forge xorg-libx11" . It worked for me when a certain R-package threw an error "X11/Xlib.h : No such file or directory".

RGDAL installation error: libnetcdf.so.6: cannot open shared object file: No such file or directory

I run RStudio Server on ubuntu 14.04. When trying to install the rgdal package I get the following error message:
Error in dyn.load(file, DLLpath = DLLpath, ...) :
unable to load shared object '/home/admin2/R/x86_64-pc-linux-gnu- library/2.14/rgdal/libs/rgdal.so':
libnetcdf.so.6: cannot open shared object file: No such file or directory
Error: loading failed
Execution halted
I upgraded RStudio Server, R-Core and all Ubuntu packages to their latest versions but no success. I also tried apt-get install lib32stdc++6 as suggested here, but also no changes. I think it is a problem specific to GDAL and the indexing of shared libraries in unix. Can anyone help please?
Ok I got it done removing Gdal completly, compiling it from source again and setting library paths correctly as described here. Later adding /usr/local/lib/ to /etc/ld.so.conf and run sudo ldconfig as described here.

Getting gputools and gmatrix in R to run smoothly on Linux

I am having trouble getting R to recognize gmatrix for R, running through Rstudio. My details are below.
Things that are accomplished and DONE:
install of openSuse Tumbleweed x86_64
install of NVIDIA graphics driver 361.42
install of CUDA 7.5 & symbolic link for /usr/local/cuda
set LD_LIBRARY_PATH & PATH
R 3.2.5
RStudio 0.98.501-1.62
patched /usr/local/cuda/include/host_config.h, line: 115 by increasing the "4"'s to "5"'s (this pertains to the gcc compiler)
install package gputools
~ partial install of package gmatrix
*I had to edit the host_config.h file because cuda is not supported for the gcc compiler that Tumbleweed ships with. I basically broke the evaluation that checks for version and set it to 5.9 instead of 4.9. Was this a supremely naive thing to do?
Things not Done, help required:
-I wasn't able to install gmatrix properly. I got R to install by manually adding the LD & PATH directories using the Sys.setenv()
> Sys.setenv("LD_LIBRARY_PATH"="/usr/lib64/R/lib:/lib:/usr/local/lib64:/usr/local/cuda/lib64")
> Sys.setenv("PATH"="/home/eamergent/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/local/cuda/bin")
However, I am unable to load the gmatrix package, yet gputools works fine:
> library(gputools) "no issues"
> library(gmatrix)
> Error in dyn.load(file, DLLpath = DLLpath, ...) : unable to load shared object '/home/eamergent/R/x86_64-suse-linux-gnu-library/3.2/gmatrix/libs/gmatrix.so':libcudart.so.7.5: cannot open shared object file: No such file or directory Error: package or namespace load failed for ‘gmatrix’
*The Error makes it seem that libcudart.so.7.5 is to blame
However,
/usr/local/cuda/lib64/libcudart.so.7.5 does in fact exist:
> eamergent#linux-pnx7: ls /usr/local/cuda/lib64/libcuda
libcudadevrt.a libcudart.so libcudart.so.7.5 libcudart.so.7.5.18 libcudart_static.a
*I used tab to get a shorter list. there are many more in lib64
Any ideas on how to get R to recognize the already installed gmatrix package? Or how to properly reinstall without using the R environment path fix that I used above?
I had the same issue on Ubuntu 14.04 where the system and R (Sys.setenv()) shared library paths were set properly, but R failed to load the CUDA shared library. What worked was to set the CUDA shared library path using ldconfig.
as root or prefix commands with sudo:
# echo "/usr/local/cuda/lib64/libcuda" > /etc/ld.so.conf.d/cuda.conf
# ldconfig
then
# R
> install.packages("gmatrix")
or if gmatrix is already installed
# R
> library(gmatrix)
> gtest()

Error installing shinyapps

I've been having trouble downloading the shinyapps package on my windows computer. I've updated my versions of R and studio, tried the devtools download devtools::install_github('rstudio/shinyapps') and I've also tried the manual download of the shinyapps-master.zip (github.com/rstudio/shinyapps/archive/master.zip) and using install_local() all to no avail.
Here is the error I get with each method:
Installing shinyapps
"C:/Program Files/R/R-3.1.1/bin/i386/R" --vanilla CMD INSTALL \
"C:\Users\MyName\AppData\Local\Temp\Rtmpma2fl1\devtools10cc1745fe7\shinyapps-master" \
--library="C:/Program Files/R/R-3.1.1/library" --install-tests
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
Error: Command failed (1)
After doing the excellent tutorial for shiny I would love to be able to use shinyapps.io but can't so far due to this. Any ideas? Much appreciated!
The app does not like the fact that R is installed in a directory that includes a space. I recommend reinstalling R to a location without a space, e.g. c:/R/.
I got a similar problem. I deleted the shinyapp folder first and then the file with that name. All my packages are saved in ~/Documents/R/win-library/3.1 folder on Windows 7 PC as I have not specified the lib folder. Then I installed the shinyapps package again using devtools::install_github('rstudio/shinyapps') command in R. HTH

Resources