Start with a short summary of your inquiry.
Hi, I am new to Rstan but I cannot install Rstan. I referred to these two page.
Installing Rstan - Interfaces - The Stan Forums (mc-stan.org)
After trying to update brms cannot run model - Interfaces - The Stan Forums (mc-stan.org)
Thanks to these two article, I could install StanHeaders but, there is a issue in rstan complication.
I guess This might caused by gcc. I want your help. My environment is as follows
- Windows 10
- R 4.0.3
- gcc version 8.3.0 (Built by Jeroen for the R-project)
- StanHeader 2.21.0-7
I run
install.packages("rstan", type = "source")
and it failed with this long code
stan_fit.cpp:633:75: required from here
C:/Program Files/R/R-4.0.3/library/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:55:30: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits<double>::type' {aka '__vector(2) double'} [-Wignored-attributes]
In file included from C:/Program Files/R/R-4.0.3/library/RcppEigen/include/Eigen/Core:440,
from C:/Program Files/R/R-4.0.3/library/RcppEigen/include/Eigen/Dense:1,
from C:/Program Files/R/R-4.0.3/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp:13,
from ../inst/include/rstan_next/stan_fit_base.hpp:5,
from ../inst/include/rstan_next/stan_fit.hpp:5,
from stan_fit.cpp:1:
-shortend-
C:/Program Files/R/R-4.0.3/library/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:35:90: required from 'Eigen::internal::evaluator<Eigen::Product<Lhs, Rhs, Option> >::evaluator(const XprType&) [with Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > >, Eigen::Matrix<double, -1, -1>, 0>; Rhs = Eigen::Matrix<double, -1, 1>; int Options = 0; Eigen::internal::evaluator<Eigen::Product<Lhs, Rhs, Option> >::XprType = Eigen::Product<Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > >, Eigen::Matrix<double, -1, -1>, 0>, Eigen::Matrix<double, -1, 1>, 0>]'
C:/Program Files/R/R-4.0.3/library/RcppEigen/include/Eigen/src/Core/Product.h:132:22: required from 'Eigen::internal::dense_product_base<Lhs, Rhs, Option, 6>::operator const Scalar() const [with Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op<double>, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > >, Eigen::Matrix<double, -1, -1>, 0>; Rhs = Eigen::Matrix<double, -1, 1>; int Option = 0; Eigen::internal::dense_product_base<Lhs, Rhs, Option, 6>::Scalar = double]'
./stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:23:56: required from 'double stan::mcmc::dense_e_metric<Model, BaseRNG>::T(stan::mcmc::dense_e_point&) [with Model = stan::model::model_base; BaseRNG = boost::random::additive_combine_engine<boost::random::linear_congruential_engine<unsigned int, 40014, 0, 2147483563>, boost::random::linear_congruential_engine<unsigned int, 40692, 0, 2147483399> >]'
./stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:22:10: required from here
C:/Program Files/R/R-4.0.3/library/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:55:30: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits<double>::type' {aka '__vector(2) double'} [-Wignored-attributes]
In file included from C:/Program Files/R/R-4.0.3/library/StanHeaders/include/stan/math/rev/core.hpp:46,
from ./stan/model/model_base.hpp:5,
from ../inst/include/rstan_next/stan_fit.hpp:7,
from stan_fit.cpp:1:
C:/Program Files/R/R-4.0.3/library/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp: At global scope:
C:/Program Files/R/R-4.0.3/library/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp:14:13: warning: 'void stan::math::set_zero_all_adjoints()' defined but not used [-Wunused-function]
static void set_zero_all_adjoints() {
^~~~~~~~~~~~~~~~~~~~~
"c:/rtools40/mingw64/bin/"ar -rs ../inst/lib//x64/libStanServices.a stan_fit.o stan_fit_base.o
C:\rtools40\mingw64\bin\ar.exe: ../inst/lib//x64/libStanServices.a γδ½ζγγ¦γγΎγ(generating)
DLLγ―ηζγγγΎγγγ§γγ (not generated)
ERROR: compilation failed for package 'rstan'
* removing 'C:/Program Files/R/R-4.0.3/library/rstan'
Warning in install.packages :
installation of package βrstanβ had non-zero exit status