How to install RcppArmadillo in AWS EMR version 5.29 - r

I am trying to install RcppArmadillo using sparkR shell in AWS EMR version 5.29.
Here is my sessionInfo() -
R version 3.4.1 (2017-06-30)
Platform: x86_64-redhat-linux-gnu (64-bit)
Running under: Amazon Linux AMI 2018.03
Matrix products: default
BLAS/LAPACK: /usr/lib64/R/lib/libRblas.so
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C
[3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8
[7] LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] SparkR_2.4.4
loaded via a namespace (and not attached):
[1] compiler_3.4.1 tools_3.4.1
Here is my code to install this package -
package_path <- "/home/sma/"
install.packages('RcppArmadillo',repos = "http://cran.us.r-project.org",lib=package_path, dependencies = TRUE)
Here is the failure that I get when I execute the install.packages() statement -
SparkSession available as 'spark'.
* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
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++ -m64 accepts -g... yes
checking how to run the C++ preprocessor... g++ -m64 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether g++ -m64 accepts -g... (cached) yes
checking whether we have a suitable tempdir... /tmp
checking whether R CMD SHLIB can already compile programs using OpenMP... no
checking whether g++ version is sufficient... yes, with OpenMP as version 7.2.1
checking for macOS... no
checking LAPACK_LIBS... R-supplied partial LAPACK found
configure: WARNING: Some complex-valued LAPACK functions may not be available
checking for OpenMP... found and suitable
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
g++ -m64 -std=gnu++11 -I/usr/include/R -DNDEBUG -I"/home/sma/Rcpp/include" -I/usr/local/include -I../inst/include -fopenmp -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c RcppArmadillo.cpp -o RcppArmadillo.o
In file included from ../inst/include/RcppArmadilloForward.h:49:0,
from ../inst/include/RcppArmadillo.h:31,
from RcppArmadillo.cpp:22:
../inst/include/armadillo:70:12: fatal error: omp.h: No such file or directory
#include <omp.h>
^~~~~~~
compilation terminated.
make: *** [RcppArmadillo.o] Error 1
ERROR: compilation failed for package ‘RcppArmadillo’
* removing ‘/home/sma/RcppArmadillo’
The downloaded source packages are in
‘/mnt/tmp/RtmpQmFZ4n/downloaded_packages’
Warning messages:
1: In install.packages("RcppArmadillo", repos = "http://cran.us.r-project.org", :
installation of package ‘slam’ had non-zero exit status
2: In install.packages("RcppArmadillo", repos = "http://cran.us.r-project.org", :
installation of package ‘RcppArmadillo’ had non-zero exit status

You are running 'R version 3.4.1 (2017-06-30)' so I would suggest you pick a version of RcppArmadillo of a similar vintage. The archive directory at CRAN, sorted by date suggests that version RcppArmadillo_0.7.960.1.0 came out in on 2017-08-17, or shortly after the (ancient) R release you have here.
You could of course join in the present rather than pastm but for that I recommend the current R 4.0.3 as well as a current, as opposed to several years old, OS release.

Related

R package BH not found for Bioconductor package RBGL

I have had difficulties installing RBGL (Bioconductor Boost library) after upgrading. The error is encountered when R CMD build tries to build the (source) package. Running ./configure from the package root works fine; unfortunately, R CMD build cleans the package before running configure again.
Exact error is:
checking R package BH ... no
configure: error: R package BH not found.
ERROR: configuration failed for package ‘RBGL’
Running ./configure manually I get:
checking R package BH ... yes
configure: creating ./config.status
config.status: creating src/Makevars
In particular, the error arises from this line: AX_R_PACKAGE([BH],,[${R}]). Notably, if I remove this line from the configure script, the package builds and installs just fine.
fwiw:
> sessionInfo()
R version 3.6.1 (2019-07-05)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.3 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/openblas/libblas.so.3
LAPACK: /usr/lib/x86_64-linux-gnu/libopenblasp-r0.2.20.so
locale:
[1] LC_CTYPE=en_GB.UTF-8 LC_NUMERIC=C LC_TIME=en_GB.UTF-8
[4] LC_COLLATE=en_GB.UTF-8 LC_MONETARY=en_GB.UTF-8 LC_MESSAGES=en_GB.UTF-8
[7] LC_PAPER=en_GB.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] BH_1.69.0-1
loaded via a namespace (and not attached):
[1] BiocManager_1.30.4 compiler_3.6.1 tools_3.6.1 parallel_3.6.1
Few quick things:
You need to show us the error
I am one of the BH authors and its maintainers, and I develop on Ubuntu; please trust me when I say it works.
When I try right now (using R 3.6.1 like you) I get an error from BioCManager as shown below.
You could try BioConductor devel for RBGL as per this page
Error Message
R> BiocManager::install("RBGL")
Error: Bioconductor version '3.8' requires R version '3.5'; \
see https://bioconductor.org/install
R>
Edit: Looking further into this all it took was two manual wget downloads from the package pages and an installation:
edd#rob:~$ cd /tmp
edd#rob:/tmp$ wget -q https://bioconductor.org/packages/release/bioc/src/contrib/RBGL_1.60.0.tar.gz
edd#rob:/tmp$ wget -q https://bioconductor.org/packages/release/bioc/src/contrib/graph_1.62.0.tar.gz
edd#rob:/tmp$ install.r graph_1.62.0.tar.gz RBGL_1.60.0.tar.gz # helper from littler
* installing *source* package ‘graph’ ...
** using staged installation
** libs
ccache gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -pedantic -std=gnu99 -c graph.c -o graph.o
ccache gcc -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o graph.so graph.o -L/usr/lib/R/lib -lR
mv graph.so BioC_graph.so
installing to /usr/local/lib/R/site-library/00LOCK-graph/00new/graph/libs
** R
[... few lines removd ***]
** testing if installed package keeps a record of temporary installation path
* DONE (graph)
* installing *source* package ‘RBGL’ ...
** using staged installation
checking R package BH ... yes
configure: creating ./config.status
config.status: creating src/Makevars
** libs
ccache g++ -I"/usr/share/R/include" -DNDEBUG -I/usr/local/lib/R/site-library/BH/include -I"/usr/local/lib/R/site-library/BH/include" -fpic -g -O3 -Wall -pipe -pedantic -c bbc.cpp -o bbc.o
[... lots of output omitted ...]
** testing if installed package keeps a record of temporary installation path
* DONE (RBGL)
edd#rob:/tmp$
Edit 2: As you mention the issue with configure, I re-ran this by hand after unpacking the tarball. And, unsurprisingly given that the build worked for me, it finds it.
edd#rob:/tmp/RBGL$ ./configure
checking R package BH ... yes
configure: creating ./config.status
config.status: creating src/Makevars
edd#rob:/tmp/RBGL$
Where is your BH package installed, and why might your session find it but configire does not? Did you run one as root and one as you?

r package installation error "unknown type name ‘R_CallMethodDef’"

I'm trying to install r package "sparsesvd" using install.packages(), but got error during compilation. Any help is highly appreciated!
"unknown type name ‘R_CallMethodDef’"
I also tried conda install -c r r-sparsesvd; but got error.
Solving environment: failed
PackagesNotFoundError: The following packages are not available from
current channels:
r-sparsesvd
Current channels:
https://conda.anaconda.org/r/linux-64
https://conda.anaconda.org/r/noarch
https://conda.anaconda.org/bioconda/linux-64
https://conda.anaconda.org/bioconda/noarch
https://conda.anaconda.org/conda-forge/linux-64
https://conda.anaconda.org/conda-forge/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
...
I tried
conda skeleton cran --recursive r-sparsesvd
conda build r-sparsesvd.
While the 1st step was successful, the build failed.
Execution halted
Tests failed for r-sparsesvd-0.1_4-r341h96ca727_0.tar.bz2
Here is the sessionInfo. Due to project reason, I have to use R3.3
R version 3.3.2 (2016-10-31) Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 7 (Core)
locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3]
LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5]
LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7]
LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C
LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages: [1] stats graphics grDevices utils
datasets methods base
loaded via a namespace (and not attached): [1] tools_3.3.2
This (once again) is not a problem with R, CRAN or its packages ...but apparently with Conda. On my system there is strictly no problem with this small package with very few dependencies:
R> install.packages("sparsesvd")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/sparsesvd_0.1-4.tar.gz'
Content type 'application/x-gzip' length 29729 bytes (29 KB)
==================================================
downloaded 29 KB
* installing *source* package ‘sparsesvd’ ...
** package ‘sparsesvd’ successfully unpacked and MD5 sums checked
** libs
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c las2.c -o las2.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c main.c -o main.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c svdlib.c -o svdlib.o
gcc -I"/usr/share/R/include" -DNDEBUG -fpic -g -O3 -Wall -pipe -std=gnu99 -march=native -c svdutil.c -o svdutil.o
svdutil.c: In function ‘svd_readBinFloat’:
svdutil.c:265:5: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
y = *((float *) &x);
^
svdutil.c: In function ‘svd_writeBinFloat’:
svdutil.c:290:3: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
int y = htonl(*((int *) &r));
^~~
gcc -Wl,-S -shared -L/usr/lib/R/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -o sparsesvd.so las2.o main.o svdlib.o svdutil.o -L/usr/lib/R/lib -lR
installing to /usr/local/lib/R/site-library/sparsesvd/libs
** R
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (sparsesvd)
The downloaded source packages are in
‘/tmp/RtmpI3TPWj/downloaded_packages’
R>

Rfast installation: /usr/lib/R/etc/Makeconf:168: recipe for target 'Norm.o' failed

I am trying to install Rfast package. It gives me the following error,
/usr/lib/R/etc/Makeconf:168: recipe for target 'Norm.o' failed
make: *** [Norm.o] Error 1
Full error message is this,
> install.packages("Rfast", dependencies = TRUE)
* installing *source* package 'Rfast' ...
** package 'Rfast' successfully unpacked and MD5 sums checked
** libs
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I"/home/haseeb/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/haseeb/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include" -fopenmp -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Diag.cpp -o Diag.o
g++ -std=gnu++11 -I/usr/share/R/include -DNDEBUG -I"/home/haseeb/R/x86_64-pc-linux-gnu-library/3.4/Rcpp/include" -I"/home/haseeb/R/x86_64-pc-linux-gnu-library/3.4/RcppArmadillo/include" -fopenmp -fpic -g -O2 -fdebug-prefix-map=/build/r-base-AitvI6/r-base-3.4.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g -c Norm.cpp -o Norm.o
In file included from Norm.cpp:4:0:
templates.h: In function 'SEXPREC* eachrow_helper(SEXP, SEXP)':
templates.h:904:15: error: there are no arguments to 'DATAPTR' that depend on a template parameter, so a declaration of 'DATAPTR' must be available [-fpermissive]
T *xx=(T *) DATAPTR(x),*xend=xx+ncol*nrow,*yy=(T *) DATAPTR(y),yvalue,*x3;
^~~~~~~
templates.h:904:15: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
templates.h:904:55: error: there are no arguments to 'DATAPTR' that depend on a template parameter, so a declaration of 'DATAPTR' must be available [-fpermissive]
T *xx=(T *) DATAPTR(x),*xend=xx+ncol*nrow,*yy=(T *) DATAPTR(y),yvalue,*x3;
^~~~~~~
templates.h:905:32: error: there are no arguments to 'DATAPTR' that depend on a template parameter, so a declaration of 'DATAPTR' must be available [-fpermissive]
RETURN_TYPE *m=(RETURN_TYPE*)DATAPTR(mat);
^~~~~~~
/usr/lib/R/etc/Makeconf:168: recipe for target 'Norm.o' failed
make: *** [Norm.o] Error 1
ERROR: compilation failed for package 'Rfast'
My sessioninfo is as follows,
> sessionInfo()
R version 3.4.4 (2018-03-15)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.1 LTS
Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1
locale:
[1] LC_CTYPE=C LC_NUMERIC=C LC_TIME=de_DE.UTF-8
[4] LC_COLLATE=C LC_MONETARY=de_DE.UTF-8 LC_MESSAGES=C
[7] LC_PAPER=de_DE.UTF-8 LC_NAME=C LC_ADDRESS=C
[10] LC_TELEPHONE=C LC_MEASUREMENT=de_DE.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
loaded via a namespace (and not attached):
[1] compiler_3.4.4 tools_3.4.4 yaml_2.2.0
Is there anyone who can help me fixing this issue?
I believe the problem is that I have forget to add
#include <Rinlinedfuns.h>
but I can not use this file. DATAPTR is declared in this file.
I have been getting the exact same error on my desktop and laptop running Ubuntu 16.04 and am at a loss how to fix this.
To me, it seems like a bad coding practice (use of the DATAPTR(x) function without prior declaration). I tried to find a declaration for DATAPTR in the header files but there is none to be found.
DATAPTR(x) is defined in /usr/share/R/include/Rinternals.h, which is not explicitly included in Norm.cpp, whereas it is included in Diag.cpp, the latter compiling without an error.
I don't know why this compiles in other machines and it fails only in ours. The g++ version is:
g++ (Ubuntu 5.4.0-6ubuntu1~16.04.10) 5.4.0 20160609
I would expect if Rinternals.h is not explicitly included wherever DATAPTR is needed then it should fail across all installations, unless somehow there is a way to instruct the compiler to include Rinternals.h by default?

/usr/bin/ld: cannot find -lgfortran when installing 'RcppArmadillo' in R

The primary goal is to use DiffBind (a R package) to analyze my ChIPseq data.
(I found another post which might be relevant to my issue, and tried to extract the solution from it, but I guess the content was too "advanced" for me... )
Following the suggestion that I might need to update my DiffBind
I tried to install a new version of it.
By the checking the dependency of DiffBind I guess that the previous installation automatically install an old version of DiffBind because my R did not meet the requirement of current version of DiffBind.
But I was using the R under the root directory, for which I could not do much about it. So I decided install a newer version of R under my own directory. and I managed to do that.
Then I tried to install the current version of DiffBind, I got the error
ERROR: compilation failed for package ‘RcppArmadillo’
It turned out the dependency lib "RcppArmadillo" require a more up-to-date compiler, again, I was using the gcc compiler under the root directory, so I install a new version of gcc under my own directory.
$ gcc --version
gcc (GCC) 6.1.0
Copyright (C) 2016 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
$ which gcc
/$HOME/Programme/gcc-6.1.0/bin//gcc
After that I tried to install the DiffBind (RcppArmadillo) again, but met another error:
* installing *source* package ‘RcppArmadillo’ ...
** package 'RcppArmadillo' successfully unpacked and MD5 sums checked
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 whether g++ version is sufficient... (6.1.0) yes
checking LAPACK_LIBS... fallback LAPACK from R 3.3.0 or later used
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloLapack.h
** libs
g++ -I/$HOME/Programme/R-3.3.1/lib64/R/include -DNDEBUG -I//$HOME/Programme/zlib-1.2.11/include -I//$HOME/Programme/bzip2-1.0.6/include -I//$HOME/Programme/xz-5.2.3/include -I//$HOME/Programme/pcre-8.40/include -I//$HOME/Programme/curl-7.52.1/include -I"/$HOME/Programme/R-3.3.1/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c RcppArmadillo.cpp -o RcppArmadillo.o
g++ -I/$HOME/Programme/R-3.3.1/lib64/R/include -DNDEBUG -I//$HOME/Programme/zlib-1.2.11/include -I//$HOME/Programme/bzip2-1.0.6/include -I//$HOME/Programme/xz-5.2.3/include -I//$HOME/Programme/pcre-8.40/include -I//$HOME/Programme/curl-7.52.1/include -I"/$HOME/Programme/R-3.3.1/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c RcppExports.cpp -o RcppExports.o
g++ -I/$HOME/Programme/R-3.3.1/lib64/R/include -DNDEBUG -I//$HOME/Programme/zlib-1.2.11/include -I//$HOME/Programme/bzip2-1.0.6/include -I//$HOME/Programme/xz-5.2.3/include -I//$HOME/Programme/pcre-8.40/include -I//$HOME/Programme/curl-7.52.1/include -I"/$HOME/Programme/R-3.3.1/lib64/R/library/Rcpp/include" -I../inst/include -fpic -g -O2 -c fastLm.cpp -o fastLm.o
g++ -shared -L/$HOME/Programme/R-3.3.1/lib64/R/lib -L//$HOME/Programme/zlib-1.2.11/lib -L//$HOME/Programme/bzip2-1.0.6/lib -L//$HOME/Programme/xz-5.2.3/lib -L//$HOME/Programme/pcre-8.40/lib -L//$HOME/Programme/curl-7.52.1/lib -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -L/$HOME/Programme/R-3.3.1/lib64/R/lib -lRlapack -L/$HOME/Programme/R-3.3.1/lib64/R/lib -lRblas -lgfortran -lm -L/$HOME/Programme/R-3.3.1/lib64/R/lib -lR
/usr/bin/ld: cannot find -lgfortran
collect2: error: ld returned 1 exit status**
it turned out that gfortran could not be found.
but when I checked existence of gfortran it exist:
$ which gfortran
/usr/bin/gfortran
$ gfortran --version
GNU Fortran (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)
Copyright (C) 2010 Free Software Foundation, Inc.
GNU Fortran comes with NO WARRANTY, to the extent permitted by law.
You may redistribute copies of GNU Fortran
under the terms of the GNU General Public License.
For more information about these matters, see the file named COPYING
So I assumed that gcc could not find gfortran, which is under the root directory.
how could I solve the problem?
Or could it be possible that the mismatch between the gcc and gfortran is the problem? if that is the case, what could be done to circumvent it?
My R version:
> sessionInfo()
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Red Hat Enterprise Linux Server release 6.7 (Santiago)
locale:
[1] LC_CTYPE=ja_JP.UTF-8 LC_NUMERIC=C
[3] LC_TIME=ja_JP.UTF-8 LC_COLLATE=ja_JP.UTF-8
[5] LC_MONETARY=ja_JP.UTF-8 LC_MESSAGES=ja_JP.UTF-8
[7] LC_PAPER=ja_JP.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C
[11] LC_MEASUREMENT=ja_JP.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
I think the issue mentioned here has been solved.
As VladimirF mentioned in the comments, when I installed the new version of gcc, I did not enable the Fortran, which is not a default setting, so the gfortran was not installed in my previous attempts.
I deleted my previous Gcc, and re compiled it as follows:
tar -xvf gcc-6.1.0.tar.gz
cd gcc-6.1.0
./contrib/download_prerequisites
mkdir build
cd build
../configure --prefix=$HOME/Programme/gcc-6.1.0 --enable-languages=c,c++,fortran --disable-multilib
make -j 8
make install
set path for new gcc and lib
it worked!

How to install R packages that use header files (RJSONIO, Rcpp)?

I'm unable to install several R packages because they always fail on the first include statement. This is the error I get for Rcpp:
install.packages("/Users/nacho/Downloads/Rcpp_0.10.3.tar.gz", repos=NULL, type="source")
Installing package(s) into ‘/Users/nacho/Library/R/2.15/library’
(as ‘lib’ is unspecified)
* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs
c++ -I/usr/local/Cellar/r/2.15.2/R.framework/Resources/include -DNDEBUG -fopenmp -I/usr/local/include -fopenmp -fPIC -g -O2 -c Date.cpp -o Date.o
clang: warning: argument unused during compilation: '-fopenmp'
clang: warning: argument unused during compilation: '-fopenmp'
Date.cpp:29:10: fatal error: 'Rcpp/Datetime.h' file not found
#include <Rcpp/Datetime.h>
^
1 error generated.
make: *** [Date.o] Error 1
ERROR: compilation failed for package ‘Rcpp’
* removing ‘/Users/nacho/Library/R/2.15/library/Rcpp’
Warning message:
In install.packages("/Users/nacho/Downloads/Rcpp_0.10.3.tar.gz", :
installation of package ‘/Users/nacho/Downloads/Rcpp_0.10.3.tar.gz’ had non-zero exit status
I get the same error for RJSONIO
install.packages("/Users/nacho/Downloads/RJSONIO_1.0-3.tar.gz", repos=NULL, type="source")
Installing package(s) into ‘/Users/nacho/Library/R/2.15/library’
(as ‘lib’ is unspecified)
* installing *source* package ‘RJSONIO’ ...
** package ‘RJSONIO’ successfully unpacked and MD5 sums checked
Trying to find libjson.h header file
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
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
/private/var/folders/tl/_8_djcq15pl01ht8z6hy9tww0000gn/T/RtmpMKCuPF/R.INSTALL116ed562675dc/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
cc -I/usr/local/Cellar/r/2.15.2/R.framework/Resources/include -DNDEBUG -fopenmp -I/usr/local/include -fopenmp -fPIC -g -O2 -c ConvertUTF.c -o ConvertUTF.o
clang: warning: argument unused during compilation: '-fopenmp'
clang: warning: argument unused during compilation: '-fopenmp'
c++ -I/usr/local/Cellar/r/2.15.2/R.framework/Resources/include -DNDEBUG -fopenmp -I/usr/local/include -fopenmp -fPIC -g -O2 -c JSONAllocator.cpp -o JSONAllocator.o
clang: warning: argument unused during compilation: '-fopenmp'
clang: warning: argument unused during compilation: '-fopenmp'
JSONAllocator.cpp:1:10: fatal error: 'JSONAllocator.h' file not found
#include "JSONAllocator.h"
^
1 error generated.
make: *** [JSONAllocator.o] Error 1
ERROR: compilation failed for package ‘RJSONIO’
* removing ‘/Users/nacho/Library/R/2.15/library/RJSONIO’
Warning message:
In install.packages("/Users/nacho/Downloads/RJSONIO_1.0-3.tar.gz", :
installation of package ‘/Users/nacho/Downloads/RJSONIO_1.0-3.tar.gz’ had non-zero exit status
My sessionInfo()
R version 2.15.2 (2012-10-26)
Platform: x86_64-apple-darwin11.4.2 (64-bit)
locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8
attached base packages:
[1] graphics grDevices utils datasets stats grid methods base
other attached packages:
[1] clickme_0.0.3 ggplot2_0.9.3.1 testthat_0.7.1 devtools_1.1
loaded via a namespace (and not attached):
[1] colorspace_1.2-1 dichromat_2.0-0 digest_0.6.3 evaluate_0.4.3 formatR_0.7 gtable_0.1.2
[7] httr_0.2 knitr_1.1 labeling_0.1 MASS_7.3-23 memoise_0.1 munsell_0.4
[13] parallel_2.15.2 plyr_1.8 proto_0.3-10 RColorBrewer_1.0-5 RCurl_1.95-4.1 reshape2_1.2.2
[19] scales_0.2.3 stringr_0.6.2 tools_2.15.2 whisker_0.1 yaml_2.1.7
What happens when you try
R CMD INSTALL Rcpp_0.10.3.tar.gz
instead? From the log you show:
c++ -I/usr/local/Cellar/r/2.15.2/R.framework/Resources/include -DNDEBUG \
-fopenmp -I/usr/local/include -fopenmp -fPIC -g -O2 -c Date.cpp -o Date.o
it is clear that you are missing something. On my Linux box (and you can ignore the
fact that I use the current SVN version)
edd#max:~/svn/rcpp/pkg$ R CMD INSTALL Rcpp_0.10.3.1.tar.gz
* installing to library ‘/usr/local/lib/R/site-library’
* installing *source* package ‘Rcpp’ ...
** libs
ccache g++-4.7 -I/usr/share/R/include -DNDEBUG -I../inst/include/ \
-fpic -g0 -O3 -Wall -pipe -Wno-variadic-macros -pedantic -c Date.cpp -o Date.o
Notice the -I../inst/include here? Maybe you overwrote CXXFLAGS or something...

Resources