@bgoodri I was able to change the nature of the error by correcting the lack of “/” between “bin” and “g++” as you had pointed out.
I removed the binary version of “rstan” and tried to install from source, following the implementation recommended by @paul.buerkner of specifying “no multi-arch”. However as you can see from below, “BH” and “StanHeaders” libraries are throwing exceptions. See my output below: (My Rtools is working correctly since I could compile and install BH and StanHeaders from source)
install.packages(“rstan”, type = “source”, INSTALL_opts = “–no-multiarch”)
Installing package into ‘C:/Users/DattaS/R/R-Library’
(as ‘lib’ is unspecified)
trying URL ‘http://cran.cnr.berkeley.edu/src/contrib/rstan_2.19.2.tar.gz’
Content type ‘application/x-gzip’ length 909934 bytes (888 KB)
downloaded 888 KB
- installing source package ‘rstan’ …
** package ‘rstan’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
C:\Rtools\mingw_64\bin\g++ -O2 -march=native -mtune=native -I"C:/Users/DattaS/R/R-36~1.1/include" -DNDEBUG -I"…/inst/include" -I"." -I"C:/Users/DattaS/R/R-Library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -I"C:/Users/DattaS/R/R-Library/Rcpp/include" -I"C:/Users/DattaS/R/R-Library/RcppEigen/include" -I"C:/Users/DattaS/R/R-Library/BH/include" -I"C:/Users/DattaS/R/R-Library/StanHeaders/include" -O3 -march=native -mtune=native -c sparse_extractors.cpp -o sparse_extractors.o
C:\Rtools\mingw_64\bin\g++ -O2 -march=native -mtune=native -I"C:/Users/DattaS/R/R-36~1.1/include" -DNDEBUG -I"…/inst/include" -I"." -I"C:/Users/DattaS/R/R-Library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -I"C:/Users/DattaS/R/R-Library/Rcpp/include" -I"C:/Users/DattaS/R/R-Library/RcppEigen/include" -I"C:/Users/DattaS/R/R-Library/BH/include" -I"C:/Users/DattaS/R/R-Library/StanHeaders/include" -O3 -march=native -mtune=native -c misc.cpp -o misc.o
C:\Rtools\mingw_64\bin\g++ -O2 -march=native -mtune=native -I"C:/Users/DattaS/R/R-36~1.1/include" -DNDEBUG -I"…/inst/include" -I"." -I"C:/Users/DattaS/R/R-Library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -I"C:/Users/DattaS/R/R-Library/Rcpp/include" -I"C:/Users/DattaS/R/R-Library/RcppEigen/include" -I"C:/Users/DattaS/R/R-Library/BH/include" -I"C:/Users/DattaS/R/R-Library/StanHeaders/include" -O3 -march=native -mtune=native -c stanc.cpp -o stanc.o
In file included from C:/Users/DattaS/R/R-Library/BH/include/boost/spirit/include/phoenix_limits.hpp:11:0,
from C:/Users/DattaS/R/R-Library/BH/include/boost/spirit/home/support/meta_compiler.hpp:16,
from C:/Users/DattaS/R/R-Library/BH/include/boost/spirit/home/qi/meta_compiler.hpp:14,
from C:/Users/DattaS/R/R-Library/BH/include/boost/spirit/home/qi/action/action.hpp:14,
from C:/Users/DattaS/R/R-Library/BH/include/boost/spirit/home/qi/action.hpp:14,
from C:/Users/DattaS/R/R-Library/BH/include/boost/spirit/home/qi.hpp:14,
from C:/Users/DattaS/R/R-Library/BH/include/boost/spirit/include/qi.hpp:16,
from ./stan/lang/grammars/whitespace_grammar.hpp:4,
from ./stan/lang/grammars/program_grammar.hpp:6,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/parser.hpp:5,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/compiler.hpp:7,
from stanc.cpp:22:
C:/Users/DattaS/R/R-Library/BH/include/boost/phoenix/core/limits.hpp:44:0: warning: “BOOST_PHOENIX_NO_VARIADIC_EXPRESSION” redefined
define BOOST_PHOENIX_NO_VARIADIC_EXPRESSION
^
:0:0: note: this is the location of the previous definition
In file included from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/ast/type/block_array_type.hpp:5:0,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/ast.hpp:11,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/compiler.hpp:5,
from stanc.cpp:22:
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/ast/type/block_var_type.hpp:54:48: error: ‘>>’ should be ‘> >’ within a nested template argument list
boost::recursive_wrapper<block_array_type>>
^
In file included from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_constructor.hpp:11:0,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator.hpp:43,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/compiler.hpp:6,
from stanc.cpp:22:
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_set_param_ranges.hpp: In function ‘void stan::lang::generate_set_param_ranges(const std::vectorstan::lang::block_var_decl&, int, std::ostream&)’:
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_set_param_ranges.hpp:53:39: warning: name lookup of ‘i’ changed
generate_expression(var_decls[i].type().params_total(),
^
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_set_param_ranges.hpp:36:19: warning: matches this ‘i’ under ISO standard rules
for (size_t i = 0; i < var_decls.size(); ++i) {
^
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_set_param_ranges.hpp:48:21: warning: matches this ‘i’ under old rules
for (size_t i = 0; i < ar_lens.size(); ++i)
^
In file included from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_cpp.hpp:26:0,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator.hpp:44,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/compiler.hpp:6,
from stanc.cpp:22:
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_register_mpi.hpp: In function ‘void stan::lang::generate_register_mpi(const string&, std::ostream&)’:
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_register_mpi.hpp:15:13: error: ‘a’ does not name a type
for (auto a : map_rect::registered_calls()) {
^
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_register_mpi.hpp:22:1: error: expected ‘;’ before ‘}’ token
}
^
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_register_mpi.hpp:22:1: error: expected primary-expression before ‘}’ token
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_register_mpi.hpp:22:1: error: expected ‘;’ before ‘}’ token
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_register_mpi.hpp:22:1: error: expected primary-expression before ‘}’ token
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_register_mpi.hpp:22:1: error: expected ‘)’ before ‘}’ token
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_register_mpi.hpp:22:1: error: expected primary-expression before ‘}’ token
In file included from ./stan/lang/grammars/expression07_grammar.hpp:8:0,
from ./stan/lang/grammars/expression_grammar.hpp:5,
from ./stan/lang/grammars/program_grammar.hpp:7,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/parser.hpp:5,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/compiler.hpp:7,
from stanc.cpp:22:
./stan/lang/grammars/semantic_actions.hpp: At global scope:
./stan/lang/grammars/semantic_actions.hpp:26:61: error: ‘>>’ should be ‘> >’ within a nested template argument list
int num_dimss(std::vector<std::vectorstan::lang::expression> &dimss);
^
./stan/lang/grammars/semantic_actions.hpp:256:66: error: ‘>>’ should be ‘> >’ within a nested template argument list
std::set<std::pair<std::string, function_signature_t>> &declared,
^
./stan/lang/grammars/semantic_actions.hpp:257:66: error: ‘>>’ should be ‘> >’ within a nested template argument list
std::set<std::pair<std::string, function_signature_t>> &defined,
^
./stan/lang/grammars/semantic_actions.hpp:266:59: error: ‘>>’ should be ‘> >’ within a nested template argument list
std::set<std::pair<std::string, function_signature_t>>
^
./stan/lang/grammars/semantic_actions.hpp:268:59: error: ‘>>’ should be ‘> >’ within a nested template argument list
std::set<std::pair<std::string, function_signature_t>> &functions_defined,
^
./stan/lang/grammars/semantic_actions.hpp:748:65: error: ‘>>’ should be ‘> >’ within a nested template argument list
std::vector<std::vectorstan::lang::expression> &dimss,
^
In file included from ./stan/lang/grammars/program_grammar.hpp:8:0,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/parser.hpp:5,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/compiler.hpp:7,
from stanc.cpp:22:
./stan/lang/grammars/block_var_decls_grammar.hpp:22:61: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar> {
^
./stan/lang/grammars/block_var_decls_grammar.hpp:30:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:34:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:38:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:42:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:46:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:50:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:54:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:58:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:62:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:66:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:70:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:74:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:78:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:82:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:86:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:90:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:94:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:98:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:102:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:106:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:110:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:114:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:117:79: error: ‘>>’ should be ‘> >’ within a nested template argument list
boost::spirit::qi::rule<Iterator, std::string(), whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:120:79: error: ‘>>’ should be ‘> >’ within a nested template argument list
boost::spirit::qi::rule<Iterator, std::string(), whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:124:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:128:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:131:78: error: ‘>>’ should be ‘> >’ within a nested template argument list
boost::spirit::qi::rule<Iterator, range(scope), whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:134:78: error: ‘>>’ should be ‘> >’ within a nested template argument list
boost::spirit::qi::rule<Iterator, range(scope), whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:138:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:142:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:145:78: error: ‘>>’ should be ‘> >’ within a nested template argument list
boost::spirit::qi::rule<Iterator, range(scope), whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:149:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:153:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
./stan/lang/grammars/block_var_decls_grammar.hpp:157:54: error: ‘>>’ should be ‘> >’ within a nested template argument list
whitespace_grammar>
^
In file included from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_function_instantiation.hpp:6:0,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_function_instantiations.hpp:5,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_standalone_functions.hpp:7,
from C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/compile_functions.hpp:4,
from stanc.cpp:23:
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_function_instantiation_body.hpp: In function ‘void stan::lang::generate_function_instantiation_body(const stan::lang::function_decl_def&, const std::vector<std::basic_string >&, bool, bool, bool, const string&, std::ostream&)’:
C:/Users/DattaS/R/R-Library/StanHeaders/include/src/stan/lang/generator/generate_function_instantiation_body.hpp:44:45: error: range-based ‘for’ loops are not allowed in C++98 mode
for (const std::string& namespace_i : namespaces) {
^
make: *** [C:/Users/DattaS/R/R-36~1.1/etc/x64/Makeconf:216: stanc.o] Error 1
ERROR: compilation failed for package ‘rstan’
- removing ‘C:/Users/DattaS/R/R-Library/rstan’
The downloaded source packages are in
‘C:\Users\DattaS\AppData\Local\Temp\2\RtmpIfjJ7H\downloaded_packages’
Warning message:
In install.packages(“rstan”, type = “source”, INSTALL_opts = “–no-multiarch”) :
installation of package ‘rstan’ had non-zero exit status