unable to install stan 2.4

299 views
Skip to first unread message

R Erickson

unread,
Aug 19, 2014, 10:41:43 AM8/19/14
to stan-...@googlegroups.com
Hi,

I had Stan 2.3 installed and am trying to upgrade to 2.4. I am running 64-bit R version 3.1.1. I am running Windows 7. Also, I do not have admin privileges on my computer, but this has not been a problem before. Both R and Rtools are installed in a file path without any spaces. 

I used the code listed on the Quick start page:
source('http://mc-stan.org/rstan/install.R', echo = TRUE, max.deparse.length = 2000)
install_rstan()
And I get the following message:

---
> install_rstan()
Removing package from ‘C:/R/R-3.1.1/library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
Content type 'application/zip' length 80246 bytes (78 Kb)
opened URL
downloaded 78 Kb

Content type 'application/zip' length 10276637 bytes (9.8 Mb)
opened URL
downloaded 9.8 Mb

Content type 'application/zip' length 2165625 bytes (2.1 Mb)
opened URL
downloaded 2.1 Mb

package ‘inline’ successfully unpacked and MD5 sums checked
package ‘BH’ successfully unpacked and MD5 sums checked
package ‘RcppEigen’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
        C:\Users\rerickson\AppData\Local\Temp\1\RtmpuKhUNS\downloaded_packages
Content type 'application/x-gzip' length 2004313 bytes (1.9 Mb)
opened URL
downloaded 1.9 Mb

* installing *source* package 'Rcpp' ...
** package 'Rcpp' successfully unpacked and MD5 sums checked
** libs

*** arch - i386
g++ -m32 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Date.cpp -o Date.o
g++ -m32 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Module.cpp -o Module.o
g++ -m32 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Rcpp_init.cpp -o Rcpp_init.o
g++ -m32 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c api.cpp -o api.o
g++ -m32 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c attributes.cpp -o attributes.o
g++ -m32 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c barrier.cpp -o barrier.o
g++ -m32 -shared -s -static-libgcc -o Rcpp.dll tmp.def Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -Ld:/RCompile/CRANpkg/extralibs64/local/lib/i386 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/R/R-31~1.1/bin/i386 -lR
installing to C:/R/R-3.1.1/library/Rcpp/libs/i386

*** arch - x64
g++ -m64 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Date.cpp -o Date.o
g++ -m64 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Module.cpp -o Module.o
g++ -m64 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c Rcpp_init.cpp -o Rcpp_init.o
g++ -m64 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c api.cpp -o api.o
g++ -m64 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c attributes.cpp -o attributes.o
g++ -m64 -I"C:/R/R-31~1.1/include" -DNDEBUG -I../inst/include/    -I"d:/RCompile/CRANpkg/extralibs64/local/include"     -O2 -Wall  -mtune=core2 -c barrier.cpp -o barrier.o
g++ -m64 -shared -s -static-libgcc -o Rcpp.dll tmp.def Date.o Module.o Rcpp_init.o api.o attributes.o barrier.o -Ld:/RCompile/CRANpkg/extralibs64/local/lib/x64 -Ld:/RCompile/CRANpkg/extralibs64/local/lib -LC:/R/R-31~1.1/bin/x64 -lR
installing to C:/R/R-3.1.1/library/Rcpp/libs/x64
** R
** inst
** preparing package for lazy loading
** help
*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded
*** arch - i386
*** arch - x64
* DONE (Rcpp)

The downloaded source packages are in
        ‘C:\Users\rerickson\AppData\Local\Temp\1\RtmpuKhUNS\downloaded_packages’

Attaching package: ‘Rcpp’

The following object is masked from ‘package:inline’:

    registerPlugin

Warning: unable to access index for repository http://rstan.org/repo/src/contrib
Error in library(rstan) : there is no package called ‘rstan’
In addition: Warning message:
package ‘rstan’ is not available (for R version 3.1.1) 

------------------------------------------------------------------

I noticed Andrew had the same problem:

So I tried using
------------------------------------------------------------------

 options(repos = c(getOption("repos"),
            rstan = "http://rstan.org/repo/"))
 install.packages("rstan", type = 'source')
------------------------------------------------------------------

And get the same warning:
Warning: unable to access index for repository http://rstan.org/repo/src/contrib

Any suggestions? Is there another way to download the rstan package? It might be that I my employer's firewall is blocking the site. 

Richard Erickson



Ben Goodrich

unread,
Aug 19, 2014, 11:05:31 AM8/19/14
to stan-...@googlegroups.com
Try downloading https://github.com/stan-dev/rstan/releases/download/v2.4.0/rstan_2.4.0.tar.gz and then do

install.packages(file.path("path", "to", "that", "rstan_2.4.0.tar.gz"), repos = NULL)

Ben

R Erickson

unread,
Aug 19, 2014, 11:31:41 AM8/19/14
to stan-...@googlegroups.com
Ben,

Thanks! That was the pointer I needed. I now have rstan up and running. 

For completeness (i.e., other reading the thread), your directions will not work on Windows. You will need to compile the tar.gz file into a Zip file (Windows is Windows...uggg...also it needs to be complied not simply zipped) using the following command prompt line, which also installs the package:
R CMD INSTALL --build rstan_2.4.0.tar.gz

The following page that explains how to build R packages on Windows (not always an easy task, especially the first time...)
(Windows users also need to make sure the path is set for R or use the complete path to the R.exe, it's in the linked directions)

Richard 





--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Bob Carpenter

unread,
Aug 19, 2014, 11:35:14 AM8/19/14
to stan-...@googlegroups.com
Should these instructions go in the RStan install docs?

- Bob

R Erickson

unread,
Aug 19, 2014, 11:46:22 AM8/19/14
to stan-...@googlegroups.com
Bob,

I would find these directions to be helpful.

The downside is that Windows users will still need to build the package on their own. Posting both the rstan.tar.gz and rstan.zip file would help, but also open another can of worms (the zip files are sometimes R version specific). I have only built one R package and lack the expertise to offer guidance on this topic. 

I would be happy to take a first pass at writing up the direction. How should I send them to you on the list or in private? 

 

Ben Goodrich

unread,
Aug 19, 2014, 11:57:17 AM8/19/14
to stan-...@googlegroups.com
I forgot to say type = "source" as in

install.packages(file.path("path", "to", "that", "rstan_2.4.0.tar.gz"), repos = NULL, type = "source")

Then it should work without building a Windows binary package, I think.

Ben
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> For more options, visit https://groups.google.com/d/optout.
>
>
> --
> You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

> For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+unsubscribe@googlegroups.com.

Bill Harris

unread,
Aug 19, 2014, 12:33:27 PM8/19/14
to stan-...@googlegroups.com
I've got Rstan 2.4 working on a Debian Stable box at home, but I am struggling to install stan on a W7 box that has both Cygwin and Rtools at work.

I gave up trying Rstan on W7 and moved to CmdStan, as I had once gotten CmdStan 2.3 to work on this machine under W7.  (I had Rstan working nicely on XP, but we're now on W7.)

I installed it into c:/Users/me/cmdstan, cd'd to cmdstan, and made (make'd) libstan.a and stanc.exe.  Finally, I tried to build the bernoulli example:

admin@here /cygdrive/c/Users/wsharri/cmdstan
$ make bin/libstan.a
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/agrad/rev/var_stack.o stan/src/stan/agrad/rev/var_stack.cpp
ar -rs bin/libstan.a bin/stan/agrad/rev/var_stack.o
ar: creating bin/libstan.a

admin@here /cygdrive/c/Users/wsharri/cmdstan
$ make -j4 bin/stanc.exe
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/cmdstan/stanc.o src/cmdstan/stanc.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/bare_type_grammar_inst.o stan/src/stan/gm/grammars/bare_type_grammar_inst.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/expression07_grammar_inst.o stan/src/stan/gm/grammars/expression07_grammar_inst.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/expression_grammar_inst.o stan/src/stan/gm/grammars/expression_grammar_inst.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/functions_grammar_inst.o stan/src/stan/gm/grammars/functions_grammar_inst.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/program_grammar_inst.o stan/src/stan/gm/grammars/program_grammar_inst.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/statement_2_grammar_inst.o stan/src/stan/gm/grammars/statement_2_grammar_inst.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/statement_grammar_inst.o stan/src/stan/gm/grammars/statement_grammar_inst.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/term_grammar_inst.o stan/src/stan/gm/grammars/term_grammar_inst.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/var_decls_grammar_inst.o stan/src/stan/gm/grammars/var_decls_grammar_inst.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/whitespace_grammar_inst.o stan/src/stan/gm/grammars/whitespace_grammar_inst.cpp
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/ast_def.o stan/src/stan/gm/ast_def.cpp
stan/src/stan/gm/ast_def.cpp: In member function ‘int stan::gm::function_signatures::get_signature_matches(const string&, const std::vector<stan::gm::expr_type>&, stan::gm::function_signature_t&)’:
stan/src/stan/gm/ast_def.cpp:312:14: warning: variable ‘match_index’ set but not used [-Wunused-but-set-variable]
       size_t match_index = 0;
              ^
ar -rs bin/libstanc.a bin/stan/gm/grammars/bare_type_grammar_inst.o bin/stan/gm/grammars/expression07_grammar_inst.o bin/stan/gm/grammars/expression_grammar_inst.o bin/stan/gm/grammars/functions_grammar_inst.o bin/stan/gm/grammars/program_grammar_inst.o bin/stan/gm/grammars/statement_2_grammar_inst.o bin/stan/gm/grammars/statement_grammar_inst.o bin/stan/gm/grammars/term_grammar_inst.o bin/stan/gm/grammars/var_decls_grammar_inst.o bin/stan/gm/grammars/whitespace_grammar_inst.o bin/stan/gm/ast_def.o
ar: creating bin/libstanc.a
g++ -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -I src -I stan/src -isystem stan/lib/eigen_3.2.0 -isystem stan/lib/boost_1.54.0 -Wall -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized    -O3 -o bin/stanc.exe bin/cmdstan/stanc.o -Lbin -lstanc

admin@here /cygdrive/c/Users/wsharri/cmdstan
$ ls
bin  doc  LICENSE  make  makefile  README.md  src  stan

admin@here /cygdrive/c/Users/wsharri/cmdstan
$ cd stan/

admin@here /cygdrive/c/Users/wsharri/cmdstan/stan
$ make src/models/basic_estimators/bernoulli.exe
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/bare_type_grammar_inst.o src/stan/gm/grammars/bare_type_grammar_inst.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/expression07_grammar_inst.o src/stan/gm/grammars/expression07_grammar_inst.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/expression_grammar_inst.o src/stan/gm/grammars/expression_grammar_inst.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/functions_grammar_inst.o src/stan/gm/grammars/functions_grammar_inst.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/program_grammar_inst.o src/stan/gm/grammars/program_grammar_inst.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/statement_2_grammar_inst.o src/stan/gm/grammars/statement_2_grammar_inst.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/statement_grammar_inst.o src/stan/gm/grammars/statement_grammar_inst.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/term_grammar_inst.o src/stan/gm/grammars/term_grammar_inst.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/var_decls_grammar_inst.o src/stan/gm/grammars/var_decls_grammar_inst.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/grammars/whitespace_grammar_inst.o src/stan/gm/grammars/whitespace_grammar_inst.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o bin/stan/gm/ast_def.o src/stan/gm/ast_def.cpp
src/stan/gm/ast_def.cpp: In member function ‘int stan::gm::function_signatures::get_signature_matches(const string&, const std::vector<stan::gm::expr_type>&, stan::gm::function_signature_t&)’:
src/stan/gm/ast_def.cpp:312:14: warning: variable ‘match_index’ set but not used [-Wunused-but-set-variable]
       size_t match_index = 0;
              ^
ar -rs bin/libstanc.a bin/stan/gm/grammars/bare_type_grammar_inst.o bin/stan/gm/grammars/expression07_grammar_inst.o bin/stan/gm/grammars/expression_grammar_inst.o bin/stan/gm/grammars/functions_grammar_inst.o bin/stan/gm/grammars/program_grammar_inst.o bin/stan/gm/grammars/statement_2_grammar_inst.o bin/stan/gm/grammars/statement_grammar_inst.o bin/stan/gm/grammars/term_grammar_inst.o bin/stan/gm/grammars/var_decls_grammar_inst.o bin/stan/gm/grammars/whitespace_grammar_inst.o bin/stan/gm/ast_def.o
ar: creating bin/libstanc.a
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized    -O3 -o test/test-models/stanc.exe src/test/test-models/stanc.cpp -Lbin -lstanc

--- Translating Stan model to C++ code ---
test/test-models/stanc.exe src/models/basic_estimators/bernoulli.stan --o=src/models/basic_estimators/bernoulli.cpp
Model name=bernoulli_model
Input file=src/models/basic_estimators/bernoulli.stan
Output file=src/models/basic_estimators/bernoulli.cpp
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized   -c -O3 -o src/models/basic_estimators/bernoulli.o src/models/basic_estimators/bernoulli.cpp
In file included from src/stan/math/error_handling/matrix/check_cholesky_factor_corr.hpp:9:0,
                 from src/stan/math/matrix_error_handling.hpp:5,
                 from src/stan/prob/transform.hpp:18,
                 from src/stan/io/reader.hpp:5,
                 from src/stan/model/model_header.hpp:24,
                 from src/models/basic_estimators/bernoulli.cpp:3:
src/stan/math/error_handling/matrix/check_unit_vector.hpp: In function ‘bool stan::math::check_unit_vector(const char*, const Eigen::Matrix<Scalar, -1, 1>&, const char*, T_result*)’:
src/stan/math/error_handling/matrix/check_unit_vector.hpp:29:74: warning: typedef ‘size_t’ locally defined but not used [-Wunused-local-typedefs]
       typedef typename Eigen::Matrix<T_prob,Eigen::Dynamic,1>::size_type size_t;
                                                                          ^
In file included from src/stan/math/matrix_error_handling.hpp:17:0,
                 from src/stan/prob/transform.hpp:18,
                 from src/stan/io/reader.hpp:5,
                 from src/stan/model/model_header.hpp:24,
                 from src/models/basic_estimators/bernoulli.cpp:3:
src/stan/math/error_handling/matrix/check_pos_semidefinite.hpp: In function ‘bool stan::math::check_pos_semidefinite(const char*, const Eigen::Matrix<LhsScalar, -1, -1, 0>&, const char*, T_result*)’:
src/stan/math/error_handling/matrix/check_pos_semidefinite.hpp:32:9: warning: typedef ‘size_type’ locally defined but not used [-Wunused-local-typedefs]
         size_type;
         ^

--- Linking C++ model ---
g++ -I src -isystem lib/eigen_3.2.0 -isystem lib/boost_1.54.0 -Wall -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -pipe -DEIGEN_NO_DEBUG -m64 -Wno-unused-function -Wno-uninitialized    -O3 -o src/models/basic_estimators/bernoulli.exe src/models/basic_estimators/bernoulli.o -Lbin -lstan -static-libgcc -static-libstdc++
/usr/lib/gcc/x86_64-pc-cygwin/4.8.3/../../../../lib/libcygwin.a(libcmain.o): In function `main':
/usr/src/debug/cygwin-1.7.31-3/winsup/cygwin/lib/libcmain.c:39: undefined reference to `WinMain'
/usr/src/debug/cygwin-1.7.31-3/winsup/cygwin/lib/libcmain.c:39:(.text.startup+0x7e): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `WinMain'
collect2: error: ld returned 1 exit status
make/models:19: recipe for target 'src/models/basic_estimators/bernoulli.exe' failed
make: *** [src/models/basic_estimators/bernoulli.exe] Error 1

admin@here /cygdrive/c/Users/wsharri/cmdstan/stan/src/models/basic_estimators
$ ls -l bernoulli*
-rw-r--r-- 1 admin Domain Users  11095 Aug 19 09:17 bernoulli.cpp
-rw-r--r-- 1 admin Domain Users  31163 Aug 19 09:17 bernoulli.d
-rw-r--r-- 1 admin Domain Users     35 Jul 20 20:29 bernoulli.data.R
-rw-r--r-- 1 admin Domain Users 609418 Aug 19 09:18 bernoulli.o
-rw-r--r-- 1 admin Domain Users    184 Jul 20 20:29 bernoulli.stan

Does anyone see what I'm doing wrong?

Bill

Ben Goodrich

unread,
Aug 19, 2014, 12:51:06 PM8/19/14
to stan-...@googlegroups.com
On Tuesday, August 19, 2014 12:33:27 PM UTC-4, Bill Harris wrote:
I've got Rstan 2.4 working on a Debian Stable box at home, but I am struggling to install stan on a W7 box that has both Cygwin and Rtools at work.

I gave up trying Rstan on W7 and moved to CmdStan, as I had once gotten CmdStan 2.3 to work on this machine under W7.  (I had Rstan working nicely on XP, but we're now on W7.)

I'm not sure about cmdstan under Cygwin, but I don't think we were aware of any issues with RStan on Windows 7. Was there a thread about the RStan error(s)?

Ben


Bill Harris

unread,
Aug 19, 2014, 1:16:40 PM8/19/14
to stan-...@googlegroups.com
Ben,

I participated in a thread called "Can't install Rstan 2.3," and then I had to drop out because of the press of other priorities.  When 2.4 came out, I had much the same issues, I think, but I haven't posted new questions yet, because I was trying to organize the data.

It would be great to have clear, semi-comprehensive tests that could confirm (or disconfirm) that Rtools was installed properly, PATH was set correctly, Rcpp was working sufficiently, and the like.  It's likely my inexperience with the Windows development environment, C++, and anything but basic makefiles, but there's effort involved to be sure each of those stages is working, and it's not always clear to me when a succeeding step fails if my test of a prior step really was sufficient.

If I get a few minutes, I'll try to put something together about my challenges with Rstan 2.4.  This previously was simply preparatory; I didn't have a case where I needed Stan.  Now I'm getting to a point where I think I could use Stan for real work later this week if I have it working, but I don't know that I'll have much more time to debug my installation this week.

Thanks,

Bill

PS: Just curious: if I successfully install cmdstan and then want to install Rstan, do I have to install a complete Rstan including stan, or can / does Rstan call the existing cmdstan installation?

PPS: I note that you seem to run Debian Sid. FWIW, I don't seem to have problems running Rstan on Debian Stable, although I don't exercise it heavily.  One of these days, I'll get my courage up and move back to Sid--I just don't want to have to work around intermittent broken packages.

Daniel Lee

unread,
Aug 19, 2014, 1:30:12 PM8/19/14
to stan-...@googlegroups.com
Sorry, the directions for CmdStan are currently wrong.

You should be building the model from within the CmdStan directory, not the stan directory that's within in. Change the path to the model accordingly.

Concretely, from:
/cygdrive/c/Users/wsharri/cmdstan

you want to type:
make stan/src/models/basic_estimators/bernoulli.exe


--
You received this message because you are subscribed to the Google Groups "Stan users mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to stan-users+...@googlegroups.com.

Ben Goodrich

unread,
Aug 19, 2014, 1:33:40 PM8/19/14
to stan-...@googlegroups.com
On Tuesday, August 19, 2014 1:16:40 PM UTC-4, Bill Harris wrote:
It would be great to have clear, semi-comprehensive tests that could confirm (or disconfirm) that Rtools was installed properly, PATH was set correctly, Rcpp was working sufficiently, and the like.  It's likely my inexperience with the Windows development environment, C++, and anything but basic makefiles, but there's effort involved to be sure each of those stages is working, and it's not always clear to me when a succeeding step fails if my test of a prior step really was sufficient.

There is a find_rtools(TRUE) function in the devtools package
 
PS: Just curious: if I successfully install cmdstan and then want to install Rstan, do I have to install a complete Rstan including stan, or can / does Rstan call the existing cmdstan installation?

Yes, you have to install Rstan separately. All of the interfaces have somewhat different code.
 
PPS: I note that you seem to run Debian Sid. FWIW, I don't seem to have problems running Rstan on Debian Stable, although I don't exercise it heavily.  One of these days, I'll get my courage up and move back to Sid--I just don't want to have to work around intermittent broken packages.

All variants of Stan should work on all variants of Debian except maybe oldstable.

Ben

Bob Carpenter

unread,
Aug 19, 2014, 1:35:12 PM8/19/14
to stan-...@googlegroups.com

On Aug 19, 2014, at 1:16 PM, Bill Harris <bill_...@facilitatedsystems.com> wrote:

Sorry you're struggling with the install. We've been trying to tweak
the instructions from the get-go due to the complications of installing
C++ toolchain (like Rtools), Rcpp and Stan itself as an R package. It's
all made super complicated by the range of C++ options available on each platform
(Cygwin, MSVC, mingw) down to varying installations and path issues with tar.
Plus, the Windows versions of the C++ tools are a mess and we've had to hack
around them in both our basic code and with optimizations required for them to
not blow out memory when compiling.

> PS: Just curious: if I successfully install cmdstan and then want to install Rstan, do I have to install a complete Rstan including stan, or can / does Rstan call the existing cmdstan installation?

The installs are completely independent and I don't think there's a way to have
RStan use the Stan code from CmdStan.

- Bob

Jeremy

unread,
Aug 27, 2014, 7:58:03 AM8/27/14
to stan-...@googlegroups.com
I am also having trouble installing Rstan on my Mac. I am using Mavericks (10.9.4) with the most recently Xcode and R Version 3.1.1.

I was following the github instructions, and all went well until I started seeing messages like this in the R console:

The downloaded binary packages are in
/var/folders/zh/l1x9mh_n08d227ly1jn6fbnh0000gn/T//RtmpIMYCZP/downloaded_packages
Content type 'application/x-gzip' length 2004313 bytes (1.9 Mb)
opened URL
==================================================
downloaded 1.9 Mb

* installing *source* package ‘Rcpp’ ...
** package ‘Rcpp’ successfully unpacked and MD5 sums checked
** libs


Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.


ERROR: compilation failed for package ‘Rcpp’
* removing ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/3.1/Resources/library/Rcpp’

The downloaded source packages are in
‘/private/var/folders/zh/l1x9mh_n08d227ly1jn6fbnh0000gn/T/RtmpIMYCZP/downloaded_packages’

Attaching package: ‘Rcpp’

The following object is masked from ‘package:inline’:

    registerPlugin



Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.



ERROR(s) during compilation: source code errors or compiler configuration errors!

Program source:
  1: 
  2: // includes from the plugin
  3: 
  4: #include <Rcpp.h>
  5: 
  6: 
  7: #ifndef BEGIN_RCPP
  8: #define BEGIN_RCPP
  9: #endif
 10: 
 11: #ifndef END_RCPP
 12: #define END_RCPP
 13: #endif
 14: 
 15: using namespace Rcpp;
 16: 
 17: 
 18: // user includes
 19: 
 20: 
 21: // declarations
 22: extern "C" {
 23: SEXP file336715100eae( ) ;
 24: }
 25: 
 26: // definition
 27: 
 28: SEXP file336715100eae(  ){
 29: BEGIN_RCPP
 30:  
 31:     std::vector<std::string> s; 
 32:     s.push_back("hello");
 33:     s.push_back("world");
 34:     return Rcpp::wrap(s);
 35:   
 36: END_RCPP
 37: }
 38: 
 39: 
Error in compileCode(f, code, language = language, verbose = verbose) : 
  Compilation ERROR, function(s)/method(s) not created! 

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

In addition: Warning messages:
1: In install.packages("Rcpp", type = "source") :
  installation of package ‘Rcpp’ had non-zero exit status
2: running command '/Library/Frameworks/R.framework/Resources/bin/R CMD SHLIB file336715100eae.cpp 2> file336715100eae.cpp.err.txt' had status 1 


>>>>> It's not clear if the problem stems from Xcode or the Rcpp package or something else. Any advice?

Jeremy

unread,
Aug 27, 2014, 8:12:20 AM8/27/14
to stan-...@googlegroups.com
Never mind, folks. Sorry about the false alarm. It was apparently a problem with Xcode. I was double-checking on Xcode and was prompted for an update, which solved the problem with the Rstan install.

John Hall

unread,
Sep 5, 2014, 1:52:49 PM9/5/14
to
I had previously had issues for RStan 2.1 due to being behind a corporate firewall. I had resolved them (with some help from the mailing list) by a solution similar to what has been described here. However, as a result of getting a new computer, I had to do a fresh install and what I did before doesn't seem to be working now. After setwding to the correct folder, I ran the

install.packages("rstan_2.4.0.tar.gz", repos = NULL, type = "source")

and get a message about RCpp, inline, RCppEigen, and BH not being available. This is in spite of them all loading successfully on their own. However, I realized that I was using the lib.loc feature when loading them. I had used the packages from a location different from what RStan is used to. So then I installed them all to the default locations and re-ran the install rstan command, and now it works.

These dependencies are no longer noted in the Getting Started RStan page (and I only was aware of RCpp and inline from before, I think RCppEigen and BH are new, I had downloaded and re-tried without getting them to work).
> package 'inline' successfully unpacked and MD5 sums checked
> package 'BH' successfully unpacked and MD5 sums checked
> package 'RcppEigen' successfully unpacked and MD5 sums checked

>
> The downloaded binary packages are in
>         C:\Users\rerickson\AppData\Local\Temp\1\RtmpuKhUNS\downloaded_packages
> trying URL 'http://cran.revolutionanalytics.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
>
> * installing *source* package 'Rcpp' ...
> ** package 'Rcpp' successfully unpacked and MD5 sums checked
> ** libs
>
> The downloaded source packages are in
>         'C:\Users\rerickson\AppData\Local\Temp\1\RtmpuKhUNS\downloaded_packages'

>
> Attaching package: 'Rcpp'
>
> The following object is masked from 'package:inline':
>
>     registerPlugin
>
> Warning: unable to access index for repository http://rstan.org/repo/src/contrib
> Error in library(rstan) : there is no package called 'rstan'
> In addition: Warning message:
> package 'rstan' is not available (for R version 3.1.1)
>
> ------------------------------------------------------------------
>
> I noticed Andrew had the same problem:
> https://groups.google.com/forum/#!topic/stan-users/5x4AY65RyHs
>
> So I tried using
> ------------------------------------------------------------------
>
>  options(repos = c(getOption("repos"),
>             rstan = "http://rstan.org/repo/"))
>  install.packages("rstan", type = 'source')
> ------------------------------------------------------------------
>
> And get the same warning:
> Warning: unable to access index for repository http://rstan.org/repo/src/contrib
>
> Any suggestions? Is there another way to download the rstan package? It might be that I my employer's firewall is blocking the site.
>
> Richard Erickson
>
>
>
>
Reply all
Reply to author
Forward
0 new messages