I am trying to install the package RSymphony using RStudio in my MAC (to afterwards be able to install the package fPortfolio). After accepting with "Y" to install the package from the source, I get the message:
> package 'Rsymphony' successfully unpacked and MD5 sums checked
> Cannot find SYMPHONY libraries and headers.
> See <https://projects.coin-or.org/SYMPHONY>.
> ERROR: configuration failed for package 'Rsymphony'
> removing '/Library/Frameworks/R.framework/Versions/3.3/Resources/library/Rsymphony'
> Warning in install.packages:
> installation of package 'Rsymphony' had non-zero exit status
I tried all the suggestions from other answers in this blog (e.g. using Homebrew, installing Xcode, etc.):
> brew tap coin-or-tools/coinor
> brew install symphony
> brew install pkg-config
But I still get the same ERROR message. The one way I was successful was installing the same package in a Windows environment (via Parallels).
Thank you.
I got lots of help from the folks at https://github.com/coin-or-tools/homebrew-coinor, specifically Ted Ralphs. Here's what he figured out:
OK, I got RSymphony to install, but it involved some hacking. For now, first grab and unpack the source with
wget https://cran.revolutionanalytics.com/src/contrib/Rsymphony_0.1-25.tar.gz
tar -xzvf Rsymphony_0.1-25.tar.gz
Now edit Rsymphony/configure and comment out the test for finding SYMPHONY libraries and headers, which is broken (not sure yet how to fix it).
#if test ${status} -ne 0; then
# echo "Cannot find SYMPHONY libraries and headers."
# echo "See <https://projects.coin-or.org/SYMPHONY>."
# exit 1
#fi
Next edit Rsymphony/R_symphony.cc and change
#include <coin/symphony.h>
to
#include <symphony.h>
Finally, do
r CMD install Rsymphony
It worked for me, but if there are any additional errors they should be easy to fix. I'll try to report this to the Rsymphony guys and see if we can get it fixed.
In addition, I had to fix my fortran. These links helped with that:
http://thecoatlessprofessor.com/programming/rcpp-rcpparmadillo-and-os-x-mavericks-lgfortran-and-lquadmath-error/
OSX Installing Rsymphony - linking headers and libs
The above suggestion worked great for me with the edits of:
brew install wget
wget https://cran.revolutionanalytics.com/src/contrib/Rsymphony_0.1-28.tar.gz
tar -xzvf Rsymphony_0.1-28.tar.gz
And I found the /R_symphony.cc in the src folder. Thanks!!!
By installing the package in R using the following command:
install.packages('FILE_PATH', repos=NULL, type = "source")
I got the following error:
Installing package into ‘/home/p/R/x86_64-pc-linux-gnu-library/3.0’
(as ‘lib’ is unspecified)
Errore in rawToChar(block[seq_len(ns)]) :
embedded nul in string: 'PK\003\004\024\0\002\0\b\0]\xadVCr\xcb\xea\xfcR\0\0\0\xa7\0\0\0\027\0\0\0bivpois-Rcode/.Rhistory+\xce/-JN\xd5PO\xca,+\xc8\xcf,\xd6+IL\xcaI\xd5\vR\xd7\xe4\xe5*\x86J\xe5\xe4\xea%\025`\b\xa5d\xa2\v楖\xe7%\xe6'
Warning message:
In install.packages("/home/p/Research/14_bivpois-Rcode.zip", repos = NULL, :
installation of package ‘/home/p/Research/14_bivpois-Rcode.zip’ had non-zero exit status
The R version is the 3.0.2 (2013-09-25) -- "Frisbee Sailing" and the OS is Linux Mint (UNIX).
Why Do I get that error and what does it mean:
installation of package ‘/home/p/Research/14_bivpois-Rcode.zip’ had non-zero exit status
in R?
You can find the package here and the file 14_bivpois-Rcode.zip is the source.
I tried to install that locally and the path is the correct one.
Any suggestion to install that package in UNIX?
Simple install following libs on your linux.
curl: sudo apt-get install curl
libssl-dev: sudo apt-get install libssl-dev
libcurl: sudo apt-get install libcurl4-openssl-dev
xml2: sudo apt-get install libxml2-dev
The .zip file provided by the authors is not a valid R package, and they do state that the source is for "direct use" in R (by which I assume they mean it's necessary to load the included functions manually). The non-zero exit status simply indicates that there was an error during the installation of the "package".
You can extract the archive manually and then load the functions therein with, e.g., source('bivpois.table.R'), or you can download the .RData file they provide and load that into the workspace with load('.RData'). This does not install the functions as part of a package; rather, it loads the functions into your global environment, making them temporarily available.
You can download, extract, and load the .RData from R as follows:
download.file('http://stat-athens.aueb.gr/~jbn/papers/files/14/14_bivpois_RDATA.zip',
f <- tempfile())
unzip(f, exdir=tempdir())
load(file.path(tempdir(), '.RData'))
If you want the .RData file to be available in the current working directory, to be loaded in the future, you could use the following instead:
download.file('http://stat-athens.aueb.gr/~jbn/papers/files/14/14_bivpois_RDATA.zip',
f <- tempfile())
unzip(f, exdir=tempdir())
file.copy(file.path(tempdir(), '.RData'), 'bivpois.RData')
# the above copies the .RData file to a file called bivpois.RData in your current
# working directory.
load('bivpois.RData')
In future R sessions, you can just call load('bivpois.RData').
You can try using command : install.packages('*package_name', dependencies = TRUE)
For example is you have to install 'caret' package in your R machine in linux : install.packages('caret', dependencies = TRUE)
Doing so, all the dependencies for the package will also be downloaded.
For those of you who are using MacOS and like me perhaps have been circling the internet as to why some R packages do not install here is a possible help.
If you get a non-zero exit status first check to ensure all dependencies are installed as well. Read through the messaging. If that is checked off, then look for indications such as gfortran: No such a file or directory. That might be due to Apple OS compiler issues that some packages will not install unless you use their binary version. Look for binary zip file in the package cran.r-project.org page, download it and use the following command to get the package installed:
install.packages("/PATH/zip file ", repos = NULL, type="source")
Did you check the gsl package in your system. Try with this:
ldconfig-p | grep gsl
If gsl is installed, it will display the configuration path. If it is not in the standard path /usr/lib/ then you need to do the following in bash:
export PATH=$PATH:/your/path/to/gsl-config
If gsl is not installed, simply do
sudo apt-get install libgsl0ldbl
sudo apt-get install gsl-bin libgsl0-dev
I had a problem with the mvabund package and this fixed the error
Cheers!
I was having a similar problem trying to install a package called AED. I tried using the install.packages() command:
install.packages('FILE_PATH', repos=NULL, type = "source")
but kept getting the following warning message:
Warning message:
In install.packages("/Users/blahblah/R-2.14.0/AED", :
installation of package ‘/Users/blahblah/R-2.14.0/AED’ had
non-zero exit status
It turned out the folder 'AED' had another folder inside of it that hadn't been uncompressed. I just uncompressed it and tried installing the package again and it worked.
Try use this:
apt-get install r-base-dev
It will be help. After then I could makeinstall.packages('//package_name')
I have had the same problem with a specific package in R and the solution was I should install in the ubuntu terminal libcurl.
Look at the information that appears above explaining to us that curl package has error installation.
I knew this about the message:
Configuration failed because libcurl was not found. Try installing:
* deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
* rpm: libcurl-devel (Fedora, CentOS, RHEL)
* csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
To install it I used the net command:
sudo apt-get install libcurl4-openssl-dev
Sometimes we can not install a specific package in R because we have problems with packages that must be installed previously as curl package. To know if we should install it we should check the warning errors such as: installation of package ‘curl’ had non-zero exit status.
I hope I have been helpful
I had the same problem, but the answer from #little_chemist helped me sorting it out. When installing packages from a file in a unix OS (Ubuntu 18.04 for me), the file can not be zipped. You are using:
install.packages("/home/p/Research/14_bivpois-Rcode.zip", repos = NULL, type="source")
I noticed the solution was as simple as unzipping the package. Additionally, unzip all (installation related?) packages inside, as #little_chemist points out. Then use install.packages:
install.packages("/home/p/Research/14_bivpois-Rcode", repos = NULL, type="source")
Hope it helps!
Trying to use Hadleys devtools package I am getting a certification error:
install_github("devtools")
Installing github repo(s) devtools/master from hadley
Installing devtools.zip from https://github.com/hadley/devtools/archive/master.zip
Error in function (type, msg, asError = TRUE) :
Peer certificate cannot be authenticated with given CA certificates
Google search tells me that this is a curl issue. I am no nearer.
Using "git" from the command line I can pick up anything I want from github, - I don't get this error. It only appears when I try to connect to github from R.
I am using ubuntu 12.10, libcurl 7.22.0 and R 3.0
Does anyone have an idea what to do to fix this?
Sincerely
H.
This issue is resolved. There was some mismatch between the version of RCurl and the curl library. Re-installing RCurl fixed the problem.
Try
$ git clone git://github.com/hadley/devtools.git
$ R CMD build devtools
$ R CMD install devtools_1.2.99.tar.gz
or just
$ git clone git://github.com/hadley/devtools.git
$ R CMD install devtools
both worked for me on Ubuntu 12.04. Someone else can weigh in on whether there's any difference in building first then installing from tarball or not. I would guess no, but I have no idea
edit:
trying this on os X
* installing to library ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library’
* installing *source* package ‘devtools’ ...
** libs
sh: make: command not found
ERROR: compilation failed for package ‘devtools’
* removing ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/devtools’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.0/Resources/library/devtools’
Sorry to be back so soon with a simple installation question, but my inability to solve it myself is seriously impairing my productivity. Anyway, I tried installing GenomicFeatures as suggested by the BC website.
> source("http://bioconductor.org/biocLite.R")
> biocLite("GenomicFeatures")
I received the following error messages (in addition to several warning messages)
ERROR: configuration failed for package ‘RCurl’
* removing ‘/home/tim/R/i686-pc-linux-gnu-library/2.15/RCurl’
ERROR: dependencies ‘XML’, ‘RCurl’ are not available for package ‘rtracklayer’
* removing ‘/home/tim/R/i686-pc-linux-gnu-library/2.15/rtracklayer’
ERROR: dependencies ‘XML’, ‘RCurl’ are not available for package ‘biomaRt’
* removing ‘/home/tim/R/i686-pc-linux-gnu-library/2.15/biomaRt’
ERROR: dependencies ‘rtracklayer’, ‘biomaRt’, ‘RCurl’ are not available for package ‘GenomicFeatures’
* removing ‘/home/tim/R/i686-pc-linux-gnu-library/2.15/GenomicFeatures’
So some problem with the dependencies I guess, but it seems strange that they would be automatically installed prior to GF. I am using version 2.15.0. Any clue as to what the problem might be? I'd be happy to provide more info as needed. Thanks.
Martin Morgan has a solution that I believe works in the comments. I'll elaborate on that a little bit.
The error messages are telling you that you need the RCurl and XML packages installed. Both of these packages require that your system has certain development packages on them. You appear to be running Linux. If you're using a Debian based system (Debian, Ubuntu, Mint, ...) then for RCurl to install you need to install libcurl4-openssl-dev and for XML to install you need to install libxml2-dev. You can accomplish this by relatively easily on the command line by typing
sudo apt-get install libcurl4-openssl-dev libxml2-dev
That should install the required packages and any dependencies. Then you should be able to install the RCurl and XML packages from within R.
install.packages("RCurl")
install.packages("XML")
At this point you have the required dependencies and should be able to install GenomicFeatures from Bioconductor.
source("http://bioconductor.org/biocLite.R")
biocLite("GenomicFeatures")
Just a note for those using Windows - getting RCurl and XML isn't necessarily easy, however, Dr. Brian Ripley provides binaries for these packages at his website and you can download them from there quite easily. Initially when I saw there was issues with RCurl and XML I thought it must be a windows user until I looked at the actual errors and realized it was a Linux user.
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.