When I tried to install Acumos package in R, I failed. It seems it is due to protobuf and most particulary common.h file. I use R version 3.5.1.
install.packages("acumos",,c("http://r.research.att.com","http://rforge.net"))
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
also installing the dependency ‘RProtoBuf’
trying URL 'http://r.research.att.com/src/contrib/RProtoBuf_0.4.12.tar.gz'
Content type 'application/x-gzip' length 1263377 bytes (1.2 MB)
==================================================
downloaded 1.2 MB
trying URL 'http://rforge.net/src/contrib/acumos_0.2-7.tar.gz'
Content type 'application/x-gzip' length 9383 bytes
==================================================
downloaded 9383 bytes
* installing *source* package ‘RProtoBuf’ ...
** package ‘RProtoBuf’ successfully unpacked and MD5 sums checked
- checking for g++... g++
- checking whether the C++ compiler works... yes
- checking for C++ compiler default output file name... a.out
- checking for suffix of executables...
- checking whether we are cross compiling... no
- checking for suffix of object files... o
- checking whether we are using the GNU C++ compiler... yes
- checking whether g++ accepts -g... yes
- checking how to run the C++ preprocessor... g++ -E
- checking for gcc... gcc
- checking whether we are using the GNU C compiler... yes
- checking whether gcc accepts -g... yes
- checking for gcc option to accept ISO C89... none needed
- checking whether we are using the GNU C++ compiler... (cached) yes
- checking whether g++ accepts -g... (cached) yes
- checking for pkg-config... no
- checking for protoc... yes
- checking for grep that handles long lines and -e... /bin/grep
- checking for egrep... /bin/grep -E
- checking for ANSI C header files... yes
- checking for sys/types.h... yes
- checking for sys/stat.h... yes
- checking for stdlib.h... yes
- checking for string.h... yes
- checking for memory.h... yes
- checking for strings.h... yes
- checking for inttypes.h... yes
- checking for stdint.h... yes
- checking for unistd.h... yes
- checking google/protobuf/stubs/common.h usability... no
- checking google/protobuf/stubs/common.h presence... no
- checking for google/protobuf/stubs/common.h... no
- configure: WARNING: Protobuf headers not found with default CXXFLAGS and
- CPPFLAGS, manually trying /usr/local/include
- configure: WARNING: Unsetting ac_cv_header_google_protobuf_stubs_common_h
- checking google/protobuf/stubs/common.h usability... no
- checking google/protobuf/stubs/common.h presence... no
- checking for google/protobuf/stubs/common.h... no
- configure: error: ERROR: ProtoBuf headers required; use '-Iincludedir' in
CXXFLAGS for unusual locations.
- ERROR: configuration failed for package ‘RProtoBuf’
* removing ‘/usr/local/lib/R/site-library/RProtoBuf’
- ERROR: dependency ‘RProtoBuf’ is not available for package ‘acumos’
* removing ‘/usr/local/lib/R/site-library/acumos’
- The downloaded source packages are in
‘/tmp/RtmpdARWMZ/downloaded_packages’
- Warning messages:
- 1: In install.packages("acumos", , c("http://r.research.att.com", "http://rforge.net")) :
- installation of package ‘RProtoBuf’ had non-zero exit status
- 2: In install.packages("acumos", , c("http://r.research.att.com", "http://rforge.net")) :
- installation of package ‘acumos’ had non-zero exit status
RProtoBuf maintainer here: the requirements (on a Debian/Ubuntu system) are enumerated clearly in this Dockerfile we now use for the Travis CI tests of that package:
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
r-cran-rcpp \
r-cran-rcurl \
r-cran-runit \
r-cran-rmarkdown \
r-cran-knitr \
protobuf-compiler \
protobuf-c-compiler \
libprotobuf-c-dev \
libprotobuf-dev \
libprotoc-dev \
&& install.r pinp
This combines the R and ProtocolBuffer requirements, so if you "just" want to build the package you need at least
protobuf-compiler protobuf-c-compiler libprotobuf-c-dev libprotobuf-dev libprotoc-dev
and you may get away without the compilers if you never want to compile .proto files.
I believe R is looking for the Google protocol-buffer header files that are in package libprotoc-dev, install that like this on Ubuntu:
sudo apt-get install libprotoc-dev
I pointed you to the command-line package previously, sorry about that.
If all else fails, use the force and download the source from https://github.com/protocolbuffers/protobuf
Related
I am trying to use the rize package to create a Dockerfile for ShinyApp. Starting the rize::shiny_dockerize() comand from the App dir. One of the packages which are required is the xlsx (Probably hier it is trying also to install rJava). I get the following error:
trying URL 'https://cran.rstudio.com/src/contrib/xlsxjars_0.6.1.tar.gz'
Content type 'application/x-gzip' length 9477071 bytes (9.0 MB)
==================================================
downloaded 9.0 MB
* installing *source* package ‘rJava’ ...
** package ‘rJava’ successfully unpacked and MD5 sums checked
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for string.h... (cached) yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether time.h and sys/time.h may both be included... yes
configure: checking whether gcc supports static inline...
yes
checking whether setjmp.h is POSIX.1 compatible... yes
checking whether sigsetjmp is declared... yes
checking whether siglongjmp is declared... yes
checking Java support in R... present:
interpreter : '/usr/bin/java'
archiver : '/usr/bin/jar'
compiler : '/usr/bin/javac'
header prep.: '/usr/bin/javah'
cpp flags : '-I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include -I/usr/lib/jvm/java-8-openjdk-amd64/jre/../include/linux'
java libs : '-L/usr/lib/jvm/java-8-openjdk-amd64/jre/lib/amd64/server -ljvm'
checking whether Java run-time works... ./configure: line 3766: /usr/bin/java: No such file or directory
no
configure: error: Java interpreter '/usr/bin/java' does not work
ERROR: configuration failed for package ‘rJava’
* removing ‘/usr/local/lib/R/site-library/rJava’
Error in i.p(...) :
(converted from warning) installation of package ‘rJava’ had non-zero exit status
Calls: <Anonymous> ... with_rprofile_user -> with_envvar -> force -> force -> i.p
Execution halted
The command '/bin/sh -c R -e "setwd('/srv/shiny-server/app'); automagic::automagic()"' returned a non-zero code: 1
Error in rize::shiny_dockerize() : object 'view_app' not found
does anyone how I can bring this to work in the rize package?
It looks like you have issues with setting proper location of Java. Note that making R happy with Java might be a little bit of struggle.
Take a look here: http://www.owsiak.org/r-java-11-and-making-sure-you-can-load-rjava/ for a sample. It is macOS based, but still, it should work fine.
Basically, what you want to do is to set your JAVA_HOME such way it points at Java installation. Once it's done, you can run R cmd javareconf like this
> sudo R CMD javareconf \
JAVA_HOME=${JAVA_HOME} \
JAVA=${JAVA_HOME}/bin/java \
JAVAC=${JAVA_HOME}/bin/javac \
JAVAH=${JAVA_HOME}/bin/javah \
JAR=${JAVA_HOME}/bin/jar
Make sure you have gcc installed and that you can compile simple C code.
rJava takes some time to install and is uaully a package which gives me a lot of issues. Here is what has generally worked for me in the past.
Install the JAVA JDK from: https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
In the command line run : sudo R CMD javareconf
if rJava library is not installed, (this particular version works for me but you could try installing the latest version)
devtools::install_version("rJava", version = "0.9-9", repos = "http://cran.us.r-project.org")
Restart R and attempt to reload the xlsx package
Caution: A lot of stackoverflow questions on this topic have advised people to alter environment variables. This has not been nessasary for me personally.
sudo R CMD javareconf should take care of this.
I'm trying to install udunits2 in R in order to satisfy the dependency for the ggforce package. However, the installer keeps failing on the check for udunits2. I have tried the instructions in this (udunits 2 devel is installed as shown here.)
and this thread, which produces the same result as trying to install.packages('udunits2').
I was able to get it working on my Mint machine by just installing udunits2-dev, however I'm quite new to Fedora, and am not sure what is causing this.
System info:
Fedora 28, R-3.4.4
EDIT
Error output when trying to install using install.packages("udunits2", configure.args = "--with-udunits2-lib=/usr/bin/udunits2"):
* installing *source* package ‘udunits2’ ...
** package ‘udunits2’ successfully unpacked and MD5 sums checked
checking for gcc... gcc -m64
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -m64 accepts -g... yes
checking for gcc -m64 option to accept ISO C89... none needed
checking for XML_ParserCreate in -lexpat... yes
checking how to run the C preprocessor... gcc -m64 -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking udunits2.h usability... no
checking udunits2.h presence... no
checking for udunits2.h... no
checking for ut_read_xml in -ludunits2... yes
-----Error: udunits2.h not found-----
If the udunits2 library is installed in a non-standard location,
use --configure-args='--with-udunits2-lib=/usr/local/lib' for example,
or --configure-args='--with-udunits2-include=/usr/include/udunits2'
replacing paths with appropriate values for your installation.
You can alternatively use the UDUNITS2_INCLUDE and UDUNITS2_LIB
environment variables.
If udunits2 is not installed, please install it.
It is required for this package.
On Fedora the header file is installed in /usr/include/udunits2, c.f. this Github issue. Solution provided there:
sudo yum install udunits2-devel
Followed by:
install.packages("udunits2",configure.args='--with-udunits2-include=/usr/include/udunits2/')
Get the source code for udunits2 from the website: ftp://ftp.unidata.ucar.edu/pub/udunits
Download, compile, and install udunits2:
# Download the library
wget ftp://ftp.unidata.ucar.edu/pub/udunits/udunits-2.2.26.tar.gz
# Decompress the archive
tar xf udunits-2.2.26.tar.gz
# Navigate to the archive
cd ./udunits-2.2.26
# Configure the build for your system
./configure prefix=$HOME/.local
# Use 4 jobs to build quickly
make -j 4
# Install to our prefix
make install
Start a new R session and install the udunits2 R package:
(Make sure to change $HOME to your actual home path)
install.packages(
"udunits2",
configure.args = '--with-udunits2-include=$HOME/.local/include/'
)
Tested on this system:
R version 3.4.0 (2017-04-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.5 (Santiago)
As a supercomputer server user without permission of sudo yum, I found installing udunits2-devel quite diffcult. Alternatively, i found spack https://spack.readthedocs.io/en/latest/basic_usage.html
quite useful for installing udunits2&units R packages:
spack install r-udunits2
spack install r-units
Spack will automatically install dependent packages, and i don't have to install udunits2-devel by myself.
Since i installed units R package for ggforce R package, and ggforce can't be installed by spack, i need to load units before entering R and then install ggforce:
$source <(spack module tcl loads r-units)
$source <(spack module tcl loads r-udunits2)
$R
>install.packages("ggforce")
and everything worked well.
I have the typical nonzero exit status problem that I have seen a lot on this forum. However I have tried all of the fixes that one traditionally uses in order to fix this problem and none work. For the full code please see below. I am running Linux Mint OS 64 bit, which I recently installed to run MATLAB, and I suspect that my issue has something to do with that. I had Linux Mint OX 32 bit before and did not have these kind of problems.
A new problem occurred while trying to install plm. The below script comes out, including the error message at the bottom, and then R crashed, which never happened before:
* installing *source* package ‘nloptr’ ...
** package ‘nloptr’ successfully unpacked and MD5 sums checked
checking for g++... g++
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking how to run the C++ preprocessor... g++ -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ accepts -g... (cached) yes
checking for pkg-config... yes
configure: Now testing for NLopt header file.
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking nlopt.h usability... no
checking nlopt.h presence... no
checking for nlopt.h... no
configure: Need to download and build NLopt
trying URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
Error in download.file(url = "http://ab-initio.mit.edu/nlopt/nlopt- 2.4.2.tar.gz", :
cannot open URL 'http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz'
Execution halted
/bin/tar: This does not look like a tar archive
gzip: stdin: unexpected end of file
/bin/tar: Child returned status 1
/bin/tar: Error is not recoverable: exiting now
Warning message:
In untar(tarfile = "nlopt-2.4.2.tar.gz") :
'/bin/tar -xf 'nlopt-2.4.2.tar.gz'' returned error code 2
configure: Starting to install library to /tmp/RtmpKVJuVy/R.INSTALL129b11f84296/nloptr/nlopt-2.4.2
./configure: line 3325: cd: nlopt-2.4.2: No such file or directory
The reason is that package uses old location.
Do following, to see where this file was moved.
> curl "http://ab-initio.mit.edu/nlopt/nlopt-2.4.2.tar.gz" -o nlopt-2.4.2.tar.gz
> cat nlopt-2.4.2.tar.gz
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved here.</p>
<hr>
<address>Apache/2.4.10 (Debian) Server at ab-initio.mit.edu Port 80</address>
</body></html>
Then, try to download file: https://github.com/stevengj/nlopt/releases/download/nlopt-2.4.2/nlopt-2.4.2.tar.gz
And install this package using R
curl "https://github.com/stevengj/nlopt/releases/download/nlopt-2.4.2/nlopt-2.4.2.tar.gz" -o nlopt-2.4.2.tar.gz
R CMD INSTALL nlopt-2.4.2.tar.gz
I am trying to install package RODBC via CRAN on MacBook Air with OS 10.12.
I am receiving the below error:
Installing package into ‘/Users/aaron.samuels/Library/R/3.3/library’
(as ‘lib’ is unspecified)
Package which is only available in source form, and may need compilation of
C/C++/Fortran: ‘RODBC’
Do you want to attempt to install these from sources?
y/n: y
installing the source package ‘RODBC’
trying URL 'https://cran.rstudio.com/src/contrib/RODBC_1.3-14.tar.gz'
Content type 'application/x-gzip' length 1163799 bytes (1.1 MB)
==================================================
downloaded 1.1 MB
* installing *source* package ‘RODBC’ ...
** package ‘RODBC’ successfully unpacked and MD5 sums checked
checking for gcc... clang
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether clang accepts -g... yes
checking for clang option to accept ISO C89... none needed
checking how to run the C preprocessor... clang -E
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for ANSI C header files...
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sql.h usability... no
checking sql.h presence... no
checking for sql.h... no
checking sqlext.h usability... no
checking sqlext.h presence... no
checking for sqlext.h... no
configure: error: "ODBC headers sql.h and sqlext.h not found"
ERROR: configuration failed for package ‘RODBC’
* removing ‘/Users/aaron.samuels/Library/R/3.3/library/RODBC’
Warning in install.packages :
installation of package ‘RODBC’ had non-zero exit status
The downloaded source packages are in
/private/var/folders/3l/nrtzvm592736jz_qh_5l1wbmffq3bz/T/RtmpeuPUR0/downloaded_packages
Any suggestion on how I can easily install these headers and subsequently successfully install RODBC?
I found an official Microsoft Source that enable the ODBC driver.
You just need to run this lines on the Terminal
/usr/bin/ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
brew install --no-sandbox msodbcsql17 mssql-tools
Use the below command to get rid of error thrown while installing RODBC package in R.
sudo zypper install unixODBC-devel
Thanks #Rafa Barragan.
Following commands worked for me on my mac-os (Mojave version).
Run following commands in terminal -
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew tap microsoft/mssql-release https://github.com/Microsoft/homebrew-mssql-release
brew update
brew install msodbcsql17 mssql-tools
configure: error: "ODBC headers sql.h and sqlext.h not found" means that ODBC drivers are not installed on your mac.
I would install iODBC and make sure the header files are present in the path
I'm trying to install rgdal library in Rstudio (0.97.332), using Ubuntu 12.10 (quantal) and R 2.15.1 (Roasted Marshmallows).
I have the following installed regarding gdal in Ubuntu:
$ apt-cache search gdal
dans-gdal-scripts - GDAL contributed tools by Geographic Information Network of Alaska
gdal-bin - Geospatial Data Abstraction Library - Utility programs
libgdal-dev - Geospatial Data Abstraction Library - Development files
libgdal-doc - Documentation for the Geospatial Data Abstraction Library
libgdal-perl - Perl bindings to the Geospatial Data Abstraction Library
libgdal-ruby - Ruby bindings to the Geospatial Data Abstraction Library
libgdal-ruby1.8 - Ruby 1.8 bindings to the Geospatial Data Abstraction Library
libgdal1 - Geospatial Data Abstraction Library
libgdal1-1.9.0-grass - GRASS extension for the GDAL library
libgdal1-dev - Geospatial Data Abstraction Library - Development files
python-gdal - Python bindings to the Geospatial Data Abstraction Library
qlandkartegt - GPS mapping (GeoTiff and vector) and GPSr management
I also have proj installed:
$ apt-cache search proj-
libproj-dev - Cartographic projection library (development files)
proj-bin - Cartographic projection library (tools)
proj-data - Cartographic projection filter and library (datum package)
proj-ps-doc - PostScript docs for cartographic projection filters and library
$ apt-cache search proj.4
libgeo-proj4-perl - PROJ.4 library for cartographic projections
python-mpltoolkits.basemap - matplotlib toolkit to plot on map projections
python-mpltoolkits.basemap-data - matplotlib toolkit to plot on map projections (data package)
python-mpltoolkits.basemap-doc - matplotlib toolkit to plot on map projections (documentation)
python-pyproj - Python interface to PROJ.4 library
Now I start rstudio and run install.packages("rgdal",dependencies=TRUE) I get the following:
> install.packages("rgdal",dependencies=TRUE)
Installing package(s) into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'http://cran.rstudio.com/src/contrib/rgdal_0.8-5.tar.gz'
Content type 'application/x-gzip' length 1584889 bytes (1.5 Mb)
opened URL
==================================================
downloaded 1.5 Mb
* installing *source* package ‘rgdal’ ...
** package ‘rgdal’ successfully unpacked and MD5 sums checked
configure: rgdal: 0.8-4
checking for /usr/bin/svnversion... no
configure: svn revision: 449
configure: gdal-config: gdal-config
checking gdal-config usability... yes
configure: GDAL: 1.9.0
checking GDAL version >= 1.7.1... yes
checking for gcc... gcc -std=gnu99
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc -std=gnu99 accepts -g... yes
checking for gcc -std=gnu99 option to accept ISO C89... none needed
checking how to run the C preprocessor... gcc -std=gnu99 -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking gdal.h usability... yes
checking gdal.h presence... yes
checking for gdal.h... yes
checking gdal: linking with --libs only... no
checking gdal: linking with --libs and --dep-libs... no
./configure: line 3373: g++: command not found
./configure: line 3388: g++: command not found
configure: Install failure: compilation and/or linkage problems.
configure: error: GDALAllRegister not found in libgdal.
ERROR: configuration failed for package ‘rgdal’
* removing ‘/usr/local/lib/R/site-library/rgdal’
Warning in install.packages :
installation of package ‘rgdal’ had non-zero exit status
I do not know what is GDALAllRegister and what should be my next step.
check if you have c++ really installed. I suspect that you don't have it.
g++: command not found