R-Package tmap/protolite installation failed: - r

I am working on Ubuntu 16.04 with R-version 3.4.2.
I want to install the R-Package "protolite" (more precisely, I want to install "tmap" where protolite is a prerequisite). I have libprotocol version 2.6.1 installed:
$ protoc --version
returns libprotoc 2.6.1.
When I type install.packages "protolite" , R gives me the warning:
Package protobuf was not found in the pkg-config search path.
Perhaps you should add the directory containing 'protobuf.pc'
to the PKG_CONFIG_PATH environment variable
No package 'protobuf' found
Later the installation fails with
/usr/bin/ld: cannot find -lprotobuf
collect2: error: ld returned 1 exit status
Since libprotocoll is installed, I searched for the pc file by
apt-file search protobuf.pc
which returned
libprotobuf-dev: /usr/lib/x86_64-linux-gnu/pkgconfig/protobuf.pc
So I added
export PKG_CONFIG_PATH=/usr/lib/x86_64-linux-gnu/pkgconfig
however, this did not resolve the issue. Can somebody help me out?
Note: I spent hours trying to install "tmap" by now, at first my problem was that I had installed libprotocol 3.2, which I had to delete to install tmap/protolite because the installation required libprotocol 2.6.1. So maybe this deletion/new installation brought some things in disorder on my computer.

Using
sudo apt-get install -y libprotobuf-dev protobuf-compiler
worked for me.

For anyone having the same problem. I checked with the Synaptic Package manager and found that not all libprotobuf versions were installed. In fact, just a lite version had been installed. Installing all "libprotobuf-dev 2.6.1-1.3 made it work.

Related

Package ‘stringr’ was installed before R 4.0.0: please re-install it BiocManager Installation path not writeable, unable to update packages

Got the errors
Error : package ‘stringr’ was installed before R 4.0.0: please re-install it and BiocManager Installation path not writeable, unable to update packages:
and further down the road rstudio gave me
/usr/local/lib/R/lib/libR.so not found
I had a similar problem when upgrading from R 3.6 to 4.0 in my Linux box.
I am also answering this because this question is one of the first results google gives when looking for this problem.
It turns out that, even by removing R (apt purge) there is a folder that remains in the system creating a lot of problems for the future installation.
I want to link the GREAT answer that was given here and saved me:
https://askubuntu.com/questions/1219737/installing-ggplot2-for-r-3-6-on-ubuntu-18-04
In Linux systems you should look in:
$ ls /usr/local/lib/R/site-library
If the folder has a list of directories you should remove everything with:
sudo rm -Rf /usr/local/lib/R/site-library
Then reinstall R and all the libraries.
This is a long answer to how to fix these errors but I assume necessary and also tips and tricks included (e.g. don't install R 4.0.2 right now (Jul 25, 2020)). It caused me a lot of pain because there were many more errors that I ran into on the way.
Error : package ‘stringr’ was installed before R 4.0.0: please re-install it and BiocManager Installation path not writeable, unable to update packages:
I removed .RData in my home folder (invisible, use ls -la) This fixed my problem for the installed before R 4.0.0 error, but did not fix my bioconductor problems. I assume it might work if you only had the re-install error.
After many attempts at trying to get my packages to load but only getting these errors, I opted to reinstall R. In R, I ran .libpaths and deleted all the files in each of the directories. I then reinstalled R by downloading R from https://www.r-project.org/ and ran the general compile commands in the downloaded folder ./configure --enable-R-shlib --with-blas --with-lapack make sudo make install. The --enable-R-shlib is needed for rstudio to be able to use R, but the others aren't.
On Jul 25, 2020 I tried to install from apt on ubuntu, but rstudio was not able to find libR.so (error of /usr/local/lib/R/lib/libR.so not found). I tried to compile from source R 4.0.2 with the ./configure --enable-R-shlib which should make the libR.so but this returned an error.
I assume this to be an underlying problem as running ./configure --enable-R-shlib compile from source with R 4.0.0, I got the files and Rstudio opened up (please fix R 4.0.2 and subsequently apt).
I then ran the general
if (!requireNamespace("BiocManager", quietly = TRUE))
install.packages("BiocManager")
BiocManager::install(version = "3.11")
to install biocmanager and it finally worked.

On CentOS Linux 7.4, cannot install the R package "httpuv"

I am currently using CentOS Linux 7.4.1708 (Core). I have tried to install the package httpuv in R through various methods to no avail. It always ends with the error:
CC src/unix/libuv_la-procfs-exepath.lo
CC src/unix/libuv_la-proctitle.lo
CC src/unix/libuv_la-sysinfo-loadavg.lo
CC src/unix/libuv_la-sysinfo-memory.lo
CCLD libuv.la
libtool: error: require no space between '-L' and '-L/n/helmod/apps/centos7/Core/pcre/8.37-fasrc02/lib'
make[1]: *** [libuv.la] Error 1
make[1]: Leaving directory `/tmp/Rtmp5Dj7hL/R.INSTALL5c046d96dc92/httpuv/src/libuv'
make: *** [libuv/.libs/libuv.a] Error 2
ERROR: compilation failed for package ‘httpuv’
Does anyone have any thought as to what is going on here? Thanks.
The previous answer is partially correct in that it identifies libuv as the missing dependency.
In CentOS 7 you can add this with yum install libuv-devel, then attempt to install the package again with install.packages("httpuv") and provided that was your only issue, it should compile correctly.
The error says that there is a library error in libuv.la.
The cc and CCLD commands show that this is a compilation error - very likely from gcc thrown when trying to compile libuv.la.
In ubuntu linux, I would look in such cases:
$ apt search httpuv
# which gives:
# r-cran-httpuv
R packages with mostly need other system dependencies (libraries outside of R etc) mostly have a package in the apt repository.
Then you do simply:
$ sudo apt install r-cran-httpuv
And then every dependency problems are resolved (though it might be that R asks you to update/upgrade your package after the installation - which sometimes works but sometimes not).
I was looking if CentOS can use apt:
https://everyday-tech.com/apt-get-on-centos/
Another possibility for you would be to use conda which is great to solve such dependency problems. People have then similar to apt prepared for you conda-packages which provide all package dependencies.
$ conda install -c conda-forge r-httpuv
If you don't know conda, I highly recommend you this tutorial:
https://www.youtube.com/watch?v=YJC6ldI3hWk (from Corey Schafer who gives great - mainly Python - tutorials).

'curl_version_info_data' has no member named 'libssh_version'

I need to install plotly package for R(3.3.1) in a Redhat server 5.11. It requires curl to be installed first. I downloaded the package from https://cran.r-project.org/web/packages/curl/index.html.
When I try to install the package, it gives below error:
version.c: In function 'R_curl_version':
version.c:15: error: 'curl_version_info_data' has no member named 'libssh_version'
version.c:15: error: 'curl_version_info_data' has no member named 'libssh_version'
make: *** [version.o] Error 1
ERROR: compilation failed for package 'curl'
Has anyone had the same issue before?
Thanks in advance for any suggestion.
You need to install the development version of the curl library before installing the package. Try yum install curl-devel.
One note though - whenever you run into a similar error it is typically because a development version of a library is not installed on your redhat system.
Thanks Jim for your reply.
I found the solution is to use a lower version curl package which has not included the definition for "libssh_version" in the file version.c, e.g. curl_0.9.6.tar.gz with the command:
sudo R CMD INSTALL curl_0.9.6.tar.gz
I've also tried "yum install curl-devel", but it shows the message:
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
Package curl-devel-7.15.5-17.el5_9.x86_64 already installed and latest version
Package curl-devel-7.15.5-17.el5_9.i386 already installed and latest version
Nothing to do

R: Having trouble installing rpanel

I am trying to install the packages rpanel and tkrplot on RStudio. After downloading and installing there I got this message:
downloaded 686 Kb
* installing *source* package ‘rpanel’ ...
** package ‘rpanel’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
Error in structure(.External(.C_dotTcl, ...), class = "tclObj") :
[tcl] can't find package BWidget.
Error : unable to load R code in package ‘rpanel’
ERROR: lazy loading failed for package ‘rpanel’
* removing ‘..../R/i686-pc-linux-gnu-library/3.0/rpanel’
Warning in install.packages :
installation of package ‘rpanel’ had non-zero exit status
The downloaded source packages are in
‘/tmp/Rtmp1MdC0f/downloaded_packages’
I already installed BWidget on my own, but it didn't help.
Anyone any ideas about this problem and maybe can help me?
The system is Ubuntu 12.04.
Under windows 7 there is no problem and everything is working fine.
There are easier ways to install BWidgets. On my mac with Macports I did:
sudo port install BWidget
On Ubuntu you can probably install it with apt-get:
sudo apt-get install bwidget
"Stumbled across this while looking for an answer to the same question. Like an unfortunate number of library authors, the BWidgets people have assumed that the only people who need to use their libraries are planning to code with them. For those of us who've never used TCL, the installation instructions mean nothing.
From the a document called tuto-install-tkabber on the tkabber.jabber.ru website (irritating spam catcher won't let me post a URL), the answer is:
Install the BWidgets directory into the "lib" directory returned by:
whereis tcl
It should look something like: /usr/lib/tcl8.4"
from http://www.linuxquestions.org/questions/linux-software-2/where-to-install-bwidget-tcl-98583/ did the trick for me
Also I got BWidget from: http://sourceforge.net/projects/tcllib/files/BWidget/1.7.0/BWidget-1.7.0.zip/download
#Calimo's answer worked for me on Linux Mint 18.3 RStudio R 3.6.0. I would have commented in #Calimo's thread except for the stupid 50 reputation limit.
sudo apt-get install bwidget
Also works for Ubuntu 18 R 3.4.4 but if you get an X11 issue with rgl then this helped from #Ouistiti.
I had similar issues trying to get biotools working in Rstudio (on Ubuntu 16.04), where rpanel and tkrplot are required. Even after installing Bwidget per Calimo's answer, I got the error installation of package ‘tkrplot’ had non-zero exit status because tk.h: No such file or directory. If you look in the directory, this error is definitely correct. You need to get tk.h in there. I found out how to do so elsewhere on stackexchange:
Install tcl-dev package using apt or synaptic; tcl contains the
runtime, while tcl-devel contains header and development files. Do the
same with tk-dev
from:
https://stackoverflow.com/a/9649478/10405322
Thus,
sudo apt-get install tcl-dev
sudo apt-get install tk-dev
download BWidget from
http://sourceforge.net/project/showfiles.php?group_id=12883
once you get the archive BWidget-1.7.0.tar.gz move it to /usr/local/lib and install it with following code in terminal:
sudo mv /some_download_path/BWidget-1.7.0.tar.gz /usr/local/lib
cd /usr/loca/lib
sudo tar zxf BWidget-1.7.0.tar.gz
ok, done.

R installation for RHive and/or RStudio("--enable-R-shlib")

I suspect I am having a problem with my R installation, something that has to do with "--enable-R-shlib".
Can someone explain if this is something that I can fix using apt-get?
More specifically:
I am having trouble getting installing the RHive package.
I Installed R from scratch, following the instructions in (for example):
http://cran.ru.ac.za/bin/linux/ubuntu/
basically, just doing:
sudo apt-get update
sudo apt-get install r-base
sudo apt-get install r-base-dev
Next I opened R and installed rJava:
install.packages("rJava")
which worked fine.
Next I tried installing RHive:
install.packages("RHive")
at which point the installation fails with the following message:
* installing *source* package ‘Rserve’ ...
** package ‘Rserve’ successfully unpacked and MD5 sums checked
checking whether to compile the server... yes
configure: error: R was configured without --enable-R-shlib or --enable-R-static-lib
*** Rserve requires R (shared or static) library. ***
*** Please install R library or compile R with either --enable-R-shlib ***
*** or --enable-R-static-lib support ***
What Should I Do?
Also, I installed RStudio and this fails at startup with a related message:
"R shared library (/usr/local/lib64/R/lib/libR.so) not found. If this is a custom build of R, was it built with the --enable-R-shlib option"
All of which leads me to believe it is all related to the same problem. Weird thing is, I followed the same procedure on a different machine, and all seems to work fine...
I had the same problem.
In my case I changed R_HOME like this Sys.setenv(R_HOME="/usr/lib/R")
R, as well as r-cran-rjava and r-cran-rserve are available for Debian and Ubuntu as part of the basic distribution.
Can you not use those packages? They certainly work for me and many, many other people at least as far as RStudio is concerned -- I have not tried RHive myself.

Resources