Rstanarm - failed installation from github: object 'm' not found

Hello,

I tried to install rstanarm as suggested here

https://cran.r-project.org/web/packages/rstantools/vignettes/developer-guidelines.html

And I got the error you see

> library(devtools)
> install_github("stan-dev/rstanarm", args = "--preclean", build_vignettes = FALSE)
Downloading GitHub repo stan-dev/rstanarm@master
from URL https://api.github.com/repos/stan-dev/rstanarm/zipball/master
Installation failed: Could not find build tools necessary to build rstanarm
> options(buildtools.check = function(action) TRUE)
> install_github("stan-dev/rstanarm", args = "--preclean", build_vignettes = FALSE)
Downloading GitHub repo stan-dev/rstanarm@master
from URL https://api.github.com/repos/stan-dev/rstanarm/zipball/master
Installing rstanarm
trying URL 'https://cran.rstudio.com/src/contrib/bayesplot_1.2.0.tar.gz'
Content type 'application/x-gzip' length 4198517 bytes (4.0 MB)
==================================================
downloaded 4.0 MB

Installing bayesplot
'/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet  \
  CMD INSTALL '/tmp/RtmpRc17Mm/devtools16dc35a1342b1/bayesplot'  \
  --library='/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3' --install-tests 

* installing *source* package ‘bayesplot’ ...
** package ‘bayesplot’ successfully unpacked and MD5 sums checked
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (bayesplot)
trying URL 'https://cran.rstudio.com/src/contrib/lme4_1.1-13.tar.gz'
Content type 'application/x-gzip' length 3624472 bytes (3.5 MB)
==================================================
downloaded 3.5 MB

Installing lme4
trying URL 'https://cran.rstudio.com/src/contrib/RcppEigen_0.3.3.3.0.tar.gz'
Content type 'application/x-gzip' length 1634023 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

Installing RcppEigen
'/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet  \
  CMD INSTALL '/tmp/RtmpRc17Mm/devtools16dc36bac8976/RcppEigen'  \
  --library='/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3' --install-tests 

* installing *source* package ‘RcppEigen’ ...
** package ‘RcppEigen’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG  -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include"  -I../inst/include -fpic  -g -O2  -c RcppEigen.cpp -o RcppEigen.o
g++ -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG  -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include"  -I../inst/include -fpic  -g -O2  -c RcppExports.cpp -o RcppExports.o
g++ -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG  -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include"  -I../inst/include -fpic  -g -O2  -c fastLm.cpp -o fastLm.o
/usr/bin/gcc -std=gnu99 -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG  -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include"   -fpic  -g -O2  -c init.c -o init.o
g++ -shared -L/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/lib -L/usr/local/lib64 -o RcppEigen.so RcppEigen.o RcppExports.o fastLm.o init.o -L/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/lib -lRlapack -L/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/lib -lRblas -lgfortran -lm -L/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/lib -lR
installing to /wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/RcppEigen/libs
** R
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (RcppEigen)
'/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet  \
  CMD INSTALL '/tmp/RtmpRc17Mm/devtools16dc37141298f/lme4'  \
  --library='/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3' --install-tests 

* installing *source* package ‘lme4’ ...
** package ‘lme4’ successfully unpacked and MD5 sums checked
** libs
g++ -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG  -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/RcppEigen/include"  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -g -O2  -c external.cpp -o external.o
g++ -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG  -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/RcppEigen/include"  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -g -O2  -c glmFamily.cpp -o glmFamily.o
g++ -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG  -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/RcppEigen/include"  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -g -O2  -c mcmcsamp.cpp -o mcmcsamp.o
g++ -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG  -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/RcppEigen/include"  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -g -O2  -c optimizer.cpp -o optimizer.o
g++ -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG  -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/RcppEigen/include"  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -g -O2  -c predModule.cpp -o predModule.o
g++ -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG  -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/RcppEigen/include"  -DNDEBUG -DEIGEN_DONT_VECTORIZE -fpic  -g -O2  -c respModule.cpp -o respModule.o
g++ -shared -L/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/lib -L/usr/local/lib64 -o lme4.so external.o glmFamily.o mcmcsamp.o optimizer.o predModule.o respModule.o -L/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/lib -lR
installing to /wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/lme4/libs
** R
** data
*** moving datasets to lazyload DB
** inst
** tests
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (lme4)
Skipping install of 'RcppEigen' from a cran remote, the SHA1 (0.3.3.3.) has not changed since last install.
  Use `force = TRUE` to force installation
'/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/bin/R' --no-site-file --no-environ --no-save --no-restore --quiet  \
  CMD INSTALL '/tmp/RtmpRc17Mm/devtools16dc363cb3883/stan-dev-rstanarm-a34c75e'  \
  --library='/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3' --install-tests --preclean 

* installing *source* package ‘rstanarm’ ...
Warning: 'cleanup' exists but is not executable -- see the 'R Installation and Administration Manual'
** libs
g++ -I/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/include -DNDEBUG -I"`"/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/bin/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DEIGEN_NO_DEBUG -DBOOST_MATH_OVERFLOW_ERROR_POLICY=ignore_error -I/usr/local/include -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/StanHeaders/include" -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/rstan/include" -I"/wehisan/general/system/bioinf-software/bioinfsoftware/R/R-3.3.0/lib64/R/library/BH/include" -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/Rcpp/include" -I"/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/RcppEigen/include"   -fpic  -g -O2  -c init.cpp -o init.o
g++ -shared -L/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/lib -L/usr/local/lib64 -o rstanarm.so init.o -L/usr/local/bioinfsoftware/R/R-3.3.0/lib64/R/lib -lR
installing to /wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/rstanarm/libs
** R
** data
*** moving datasets to lazyload DB
** demo
** exec
** inst
** tests
** preparing package for lazy loading
starting worker pid=94435 on localhost:11879 at 22:38:35.913
starting worker pid=94447 on localhost:11879 at 22:38:37.185
starting worker pid=94457 on localhost:11879 at 22:38:38.401
starting worker pid=94467 on localhost:11879 at 22:38:39.633
starting worker pid=94477 on localhost:11879 at 22:38:40.816
starting worker pid=94487 on localhost:11879 at 22:38:41.951
** help
No man pages found in package  ‘rstanarm’ 
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
Error in .doLoadActions(where, attach) : 
  error in load action .__A__.1 for package rstanarm: is(module, "character"): object 'm' not found
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/rstanarm’
* restoring previous ‘/wehisan/home/allstaff/m/mangiola.s/R/x86_64-pc-linux-gnu-library/3.3/rstanarm’
Installation failed: Command failed (1)

sessionInfo()
R version 3.3.0 (2016-05-03)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.4 (Final)

locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C 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 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] parallel stats4 stats graphics grDevices utils datasets methods base

other attached packages:
[1] devtools_1.13.1 rstantools_1.2.0 AnnotationDbi_1.36.0 IRanges_2.8.1 S4Vectors_0.12.0
[6] Biobase_2.34.0 BiocGenerics_0.20.0

loaded via a namespace (and not attached):
[1] Rcpp_0.12.11 digest_0.6.12 withr_1.0.2 R6_2.2.1 DBI_0.6-1 git2r_0.18.0 RSQLite_1.1-2
[8] httr_1.2.1 curl_2.4 infotheo_1.2.0 tools_3.3.0 memoise_1.1.0 knitr_1.15.1

The reason that I want to install via github, is because I am building a github stan related package

For some reason, your system is refusing to execute Bash scripts without the executable bit. You can do

git clone https://github.com/stan-dev/rstanarm.git
cd rstanarm
chmod +x cleanup
..
R CMD build rstanarm
R CMD INSTALL rstanarm*.tar.gz

Thanks Ben,

I want to solve this with our IT for our servers, since :

  1. It is nice to install through R
  2. I need to publish a R/stan package myself, and I want myself and people to be able to do everything through R

Then you need to figure out why your server won’t execute non-executable Bash scripts. There is apparently no way to preserve the executable bit of files during a git clone.

Looking online (while waiting reply from our IT), appears that this is a common problem for many packages.

There is not the possibility for R stanarm team to build an installation “github_install” that overcomes this issue.

I think it is pretty common to not execute non-executable files

It is not common for Bash to not execute non-executable files. I think you have some security setting on your server that I don’t have on my laptop. For me, git clone maintains the executable bit. On Windows, it does not and so I get that warning but it executes it anyway.