error installing shiny

bugman

Super Moderator
#1
I am trying to learn shiny, but cannot install it.

Error message below:

I have never seen the error " installation of package ‘shiny’ had non-zero exit status" before:

Is this an issue with versions? or is it a permissions issue (should I login as root)?


Code:
> install.packages("shiny")
Installing package into ‘/home/pt/R/x86_64-pc-linux-gnu-library/3.1’
(as ‘lib’ is unspecified)
also installing the dependencies ‘Rcpp’, ‘httpuv’, ‘caTools’, ‘RJSONIO’

trying URL 'http://cran.rstudio.com/src/contrib/Rcpp_0.11.2.tar.gz'
Content type 'application/x-gzip' length 2004313 bytes (1.9 Mb)
opened URL
==================================================
downloaded 1.9 Mb

trying URL 'http://cran.rstudio.com/src/contrib/httpuv_1.3.0.tar.gz'
Content type 'application/x-gzip' length 423739 bytes (413 Kb)
opened URL
==================================================
downloaded 413 Kb

trying URL 'http://cran.rstudio.com/src/contrib/caTools_1.17.tar.gz'
Content type 'application/x-gzip' length 63326 bytes (61 Kb)
opened URL
==================================================
downloaded 61 Kb

trying URL 'http://cran.rstudio.com/src/contrib/RJSONIO_1.3-0.tar.gz'
Content type 'application/x-gzip' length 1148375 bytes (1.1 Mb)
opened URL
==================================================
downloaded 1.1 Mb

trying URL 'http://cran.rstudio.com/src/contrib/shiny_0.10.1.tar.gz'
Content type 'application/x-gzip' length 978367 bytes (955 Kb)
opened URL
==================================================
downloaded 955 Kb

* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/share/R/include -DNDEBUG -I../inst/include/     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c Date.cpp -o Date.o
/bin/bash: g++: command not found
make: *** [Date.o] Error 127
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/home/pt/R/x86_64-pc-linux-gnu-library/3.1/Rcpp’
Warning in install.packages :
  installation of package ‘Rcpp’ had non-zero exit status
* installing *source* package ‘caTools’ ...
** package ‘caTools’ successfully unpacked and MD5 sums checked
** libs
g++ -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 Gif2R.cpp -o Gif2R.o
/bin/bash: g++: command not found
make: *** [Gif2R.o] Error 127
ERROR: compilation failed for package ‘caTools’
* removing ‘/home/pt/R/x86_64-pc-linux-gnu-library/3.1/caTools’
Warning in install.packages :
  installation of package ‘caTools’ had non-zero exit status
* installing *source* package ‘RJSONIO’ ...
** package ‘RJSONIO’ successfully unpacked and MD5 sums checked
Trying to find libjson.h header file
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
USE_LOCAL = ""
Minor Version: 6
Using local libjson code. Copying files from src/libjson/Source
/tmp/Rtmpy0i9O9/R.INSTALL1110695ad22a/RJSONIO
JSONAllocator.cpp
JSONChildren.cpp
JSONDebug.cpp
JSONIterators.cpp
JSONMemory.cpp
JSONNode.cpp
JSONNode_Mutex.cpp
JSONPreparse.cpp
JSONStream.cpp
JSONValidator.cpp
JSONWorker.cpp
JSONWriter.cpp
internalJSONNode.cpp
libjson.cpp
configure: creating ./config.status
config.status: creating src/Makevars
config.status: creating cleanup
** libs
gcc -std=gnu99 -I/usr/share/R/include -DNDEBUG -I. -Ilibjson -Ilibjson/Source -DNEW_JSON_NEW_STREAM -DNDEBUG=1 -DJSON_STREAM=1 -DJSON_VALIDATE -DJSON_READ_PRIORITY=1 -DJSON_LIBRARY=1  -DJSON_ISO_STRICT     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c ConvertUTF.c -o ConvertUTF.o
g++ -I/usr/share/R/include -DNDEBUG -I. -Ilibjson -Ilibjson/Source -DNEW_JSON_NEW_STREAM -DNDEBUG=1 -DJSON_STREAM=1 -DJSON_VALIDATE -DJSON_READ_PRIORITY=1 -DJSON_LIBRARY=1  -DJSON_ISO_STRICT     -fpic  -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -g  -c JSONAllocator.cpp -o JSONAllocator.o
/bin/bash: g++: command not found
make: *** [JSONAllocator.o] Error 127
ERROR: compilation failed for package ‘RJSONIO’
* removing ‘/home/pt/R/x86_64-pc-linux-gnu-library/3.1/RJSONIO’
Warning in install.packages :
  installation of package ‘RJSONIO’ had non-zero exit status
ERROR: dependency ‘Rcpp’ is not available for package ‘httpuv’
* removing ‘/home/pt/R/x86_64-pc-linux-gnu-library/3.1/httpuv’
Warning in install.packages :
  installation of package ‘httpuv’ had non-zero exit status
ERROR: dependencies ‘httpuv’, ‘caTools’, ‘RJSONIO’ are not available for package ‘shiny’
* removing ‘/home/pt/R/x86_64-pc-linux-gnu-library/3.1/shiny’
Warning in install.packages :
  installation of package ‘shiny’ had non-zero exit status

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

trinker

ggplot2orBust
#2
Can you install these packages that threw compilation errors (e.g., caTools) by themselves? (i.e., install.packages("caTools"))
 

bugman

Super Moderator
#4
trinker - same error "caTools has non-zero status"...

Dason - that make sense, but no I dont have one installed - which package do I need? (I mean, do i need to install something like g++ on my Linux desktop or do I need an R package inline? is it?)
 
Last edited:

Dason

Ambassador to the humans
#6
You need a compiler for c++ - not an R package. Which distro are you using?

On Ubuntu and the likes on the command line:
Code:
sudo apt-get install build-essential
On Arch
Code:
sudo pacman -S base-devel
those should pull in the relevant compilers.