Error when verifying installation of RStan

Hi!

I am trying to verify the installation of RStan but keep getting the same error message.
(Windows 10 OS, R Version 4.1.2).

When I run this to verify…

example(stan_model, package = "rstan", run.dontrun = TRUE)

I get this error message…

Loading required package: StanHeaders
Loading required package: ggplot2
Error: package or namespace load failed for ‘rstan’ in namespaceExport(ns, exports):
 undefined exports: compute_bytes, pretty_bytes, pretty_dt, pretty_ms, pretty_sec, time_ago, vague_dt

Any ideas? I have tried running update.packages() but am still getting the same result.

Thanks in advance!

Can you try reinstalling rstan and StanHeaders from source?

1 Like

Yeah I have done that, then restarted R. Am still getting the same error message when I try to verify it :/

It looks like those exports come from the prettyunits package, can you try running:

install.packages("prettyunits")

This is my output when I install prettyunits…

Installing package into ‘C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1’ (as ‘lib’ is unspecified)
trying URL ‘https://cran.rstudio.com/bin/windows/contrib/4.1/prettyunits_1.1.1.zip
Content type ‘application/zip’ length 37799 bytes (36 KB)
downloaded 36 KB

package ‘prettyunits’ successfully unpacked and MD5 sums checked
Warning in install.packages :
cannot delete reparse point ‘C:\Users\hrh210\OneDrive - University of Exeter\Documents\R\win-library\4.1/prettyunits/R’, reason ‘There is a mismatch between the tag specified in the request and the tag present in the reparse point’
Warning in install.packages :
cannot remove prior installation of package ‘prettyunits’
Warning in install.packages :
cannot delete reparse point ‘C:\Users\hrh210\OneDrive - University of Exeter\Documents\R\win-library\4.1/prettyunits/R’, reason ‘There is a mismatch between the tag specified in the request and the tag present in the reparse point’
Warning in install.packages :
restored ‘prettyunits’

Can you pause the onedrive sync and try again?

Ok have done that and get this when verifying…

Error: Unable to establish connection with R session when executing ‘console_input’

I didn’t think about the fact that everything I’ve been downloading has been syncing to onedrive all along, this could be the problem

That error occurs when RStudio has an issue communicating with the R session. Are R and/or RStudio also installed in a onedrive folder?

Rstudio is installed on the computer. But it looks like .RData and a few other R folders are installed in both the onedrive folder and PC folder. Should I make sure everything is installed to the computer rather than onedrive and try again?

As a first step I’d try (with onedrive paused) restarting R and reinstalling rstan from source

So I reinstalled from source, got this at the end

ERROR: compilation failed for package ‘rstan’

  • removing ‘C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/rstan’
    Warning in install.packages :
    installation of package ‘rstan’ had non-zero exit status

The this when verifying…
Error in find.package(package, lib.loc, verbose = verbose) :
there is no package called ‘rstan’

Above the section:

ERROR: compilation failed for package ‘rstan’

    removing ‘C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/rstan’
    Warning in install.packages :
    installation of package ‘rstan’ had non-zero exit status

Can you post the section of the output that starts with error:?

This section?

         ^~~~~~~~~~~~~~~~~~~~~

"C:/rtools40/mingw32/bin/"ar -rs …/inst/lib//i386/libStanServices.a stan_fit.o stan_fit_base.o
C:\rtools40\mingw32\bin\ar.exe: creating …/inst/lib//i386/libStanServices.a
no DLL was created
ERROR: compilation failed for package ‘rstan’

  • removing ‘C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/rstan’
    Warning in install.packages :
    installation of package ‘rstan’ had non-zero exit status

Can you post more of the text above that? The error isn’t there unfortunately

Above this there’s hundreds of lines of output, none that I can see start with error :/ Do you want a section of it to see? :)

If you can post as much of the output as you can copy, the error should be in there somewhere

This is as much as I can get :)

C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/Redux.h:418:56: required from ‘typename Eigen::internal::traits::Scalar Eigen::DenseBase::redux(const Func&) const [with BinaryOp = Eigen::internal::scalar_sum_op<double, double>; Derived = Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::Transpose<const Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > >, Eigen::Matrix<double, -1, -1>, 0> >, const Eigen::Matrix<double, -1, 1> >; typename Eigen::internal::traits::Scalar = double]’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/Redux.h:453:73: required from ‘typename Eigen::internal::traits::Scalar Eigen::DenseBase::sum() const [with Derived = Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::Transpose<const Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > >, Eigen::Matrix<double, -1, -1>, 0> >, const Eigen::Matrix<double, -1, 1> >; typename Eigen::internal::traits::Scalar = double]’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:251:23: required from ‘static void Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 6>::evalTo(Dst&, const Lhs&, const Rhs&) [with Dst = Eigen::Matrix<double, 1, 1, 0, 1, 1>; Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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>]’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:124:75: required from ‘Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, Option>, ProductTag, LhsShape, RhsShape>::product_evaluator(const XprType&) [with Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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; int ProductTag = 6; LhsShape = Eigen::DenseShape; RhsShape = Eigen::DenseShape; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, Option>::Rhs>::Scalar = double; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, Option>::Lhs>::Scalar = double; Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, Option>, ProductTag, LhsShape, RhsShape>::XprType = Eigen::Product<Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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, 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, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:650:34: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits::type’ {aka ‘__vector(2) double’} [-Wignored-attributes]
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h: In instantiation of ‘class Eigen::DenseCoeffsBase<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, 0>’:
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:300:7: required from ‘class Eigen::DenseCoeffsBase<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, 1>’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:551:7: required from ‘class Eigen::DenseCoeffsBase<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, 3>’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseBase.h:41:34: required from ‘class Eigen::DenseBase<Eigen::Transpose<Eigen::Matrix<double, 1, -1> > >’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/MatrixBase.h:48:34: required from ‘class Eigen::MatrixBase<Eigen::Transpose<Eigen::Matrix<double, 1, -1> > >’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/Transpose.h:115:37: required from ‘class Eigen::TransposeImpl<Eigen::Matrix<double, 1, -1>, Eigen::Dense>’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/Transpose.h:52:37: [ skipping 16 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:251:23: required from ‘static void Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 6>::evalTo(Dst&, const Lhs&, const Rhs&) [with Dst = Eigen::Matrix<double, 1, 1, 0, 1, 1>; Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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>]’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:124:75: required from ‘Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, Option>, ProductTag, LhsShape, RhsShape>::product_evaluator(const XprType&) [with Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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; int ProductTag = 6; LhsShape = Eigen::DenseShape; RhsShape = Eigen::DenseShape; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, Option>::Rhs>::Scalar = double; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, Option>::Lhs>::Scalar = double; Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, Option>, ProductTag, LhsShape, RhsShape>::XprType = Eigen::Product<Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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, 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, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:55:30: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits::type’ {aka ‘__vector(2) double’} [-Wignored-attributes]
>::type PacketReturnType;
^~~~~~~~~~~~~~~~
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h: In instantiation of ‘class Eigen::DenseCoeffsBase<Eigen::Transpose<const Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > > >, 0>’:
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseBase.h:41:34: required from ‘class Eigen::DenseBase<Eigen::Transpose<const Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > > > >’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/MatrixBase.h:48:34: required from ‘class Eigen::MatrixBase<Eigen::Transpose<const Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > > > >’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/Transpose.h:115:37: required from ‘class Eigen::TransposeImpl<const Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > >, Eigen::Dense>’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/Transpose.h:52:37: required from ‘class Eigen::Transpose<const Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > > >’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/GeneralProduct.h:197:12: required from ‘static void Eigen::internal::gemv_dense_selector<1, StorageOrder, BlasCompatible>::run(const Lhs&, const Rhs&, Dest&, const typename Dest::Scalar&) [with Lhs = Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > >; Rhs = Eigen::Matrix<double, -1, -1>; Dest = Eigen::Matrix<double, 1, -1>; int StorageOrder = 0; bool BlasCompatible = true; typename Dest::Scalar = double]’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:383:34: [ skipping 14 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:251:23: required from ‘static void Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 6>::evalTo(Dst&, const Lhs&, const Rhs&) [with Dst = Eigen::Matrix<double, 1, 1, 0, 1, 1>; Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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>]’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:124:75: required from ‘Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, Option>, ProductTag, LhsShape, RhsShape>::product_evaluator(const XprType&) [with Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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; int ProductTag = 6; LhsShape = Eigen::DenseShape; RhsShape = Eigen::DenseShape; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, Option>::Rhs>::Scalar = double; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, Option>::Lhs>::Scalar = double; Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, Option>, ProductTag, LhsShape, RhsShape>::XprType = Eigen::Product<Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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, 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, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:55:30: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits::type’ {aka ‘__vector(2) double’} [-Wignored-attributes]
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h: In instantiation of ‘class Eigen::DenseCoeffsBase<Eigen::Transpose<const Eigen::Transpose<const Eigen::Matrix<double, -1, 1> > >, 0>’:
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:478:7: required from ‘class Eigen::DenseCoeffsBase<Eigen::Transpose<const Eigen::Transpose<const Eigen::Matrix<double, -1, 1> > >, 2>’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseBase.h:41:34: required from ‘class Eigen::DenseBase<Eigen::Transpose<const Eigen::Transpose<const Eigen::Matrix<double, -1, 1> > > >’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/MatrixBase.h:48:34: required from ‘class Eigen::MatrixBase<Eigen::Transpose<const Eigen::Transpose<const Eigen::Matrix<double, -1, 1> > > >’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/Transpose.h:115:37: required from ‘class Eigen::TransposeImpl<const Eigen::Transpose<const Eigen::Matrix<double, -1, 1> >, Eigen::Dense>’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/Transpose.h:52:37: required from ‘class Eigen::Transpose<const Eigen::Transpose<const Eigen::Matrix<double, -1, 1> > >’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/util/BlasUtil.h:464:13: [ skipping 17 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:251:23: required from ‘static void Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 6>::evalTo(Dst&, const Lhs&, const Rhs&) [with Dst = Eigen::Matrix<double, 1, 1, 0, 1, 1>; Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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>]’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:124:75: required from ‘Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, Option>, ProductTag, LhsShape, RhsShape>::product_evaluator(const XprType&) [with Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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; int ProductTag = 6; LhsShape = Eigen::DenseShape; RhsShape = Eigen::DenseShape; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, Option>::Rhs>::Scalar = double; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, Option>::Lhs>::Scalar = double; Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, Option>, ProductTag, LhsShape, RhsShape>::XprType = Eigen::Product<Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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, 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, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:55:30: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits::type’ {aka ‘__vector(2) double’} [-Wignored-attributes]
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h: In instantiation of ‘class Eigen::DenseCoeffsBase<Eigen::Block<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, -1, 1, true>, 0>’:
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:300:7: required from ‘class Eigen::DenseCoeffsBase<Eigen::Block<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, -1, 1, true>, 1>’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:551:7: required from ‘class Eigen::DenseCoeffsBase<Eigen::Block<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, -1, 1, true>, 3>’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseBase.h:41:34: required from ‘class Eigen::DenseBase<Eigen::Block<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, -1, 1, true> >’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/MatrixBase.h:48:34: required from ‘class Eigen::MatrixBase<Eigen::Block<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, -1, 1, true> >’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/MapBase.h:37:34: required from ‘class Eigen::MapBase<Eigen::Block<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, -1, 1, true>, 0>’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/MapBase.h:221:34: [ skipping 20 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:251:23: required from ‘static void Eigen::internal::generic_product_impl<Lhs, Rhs, Eigen::DenseShape, Eigen::DenseShape, 6>::evalTo(Dst&, const Lhs&, const Rhs&) [with Dst = Eigen::Matrix<double, 1, 1, 0, 1, 1>; Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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>]’
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:124:75: required from ‘Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, Option>, ProductTag, LhsShape, RhsShape>::product_evaluator(const XprType&) [with Lhs = Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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; int ProductTag = 6; LhsShape = Eigen::DenseShape; RhsShape = Eigen::DenseShape; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, Option>::Rhs>::Scalar = double; typename Eigen::internal::traits<typename Eigen::Product<Lhs, Rhs, Option>::Lhs>::Scalar = double; Eigen::internal::product_evaluator<Eigen::Product<Lhs, Rhs, Option>, ProductTag, LhsShape, RhsShape>::XprType = Eigen::Product<Eigen::Product<Eigen::CwiseBinaryOp<Eigen::internal::scalar_product_op<double, double>, const Eigen::CwiseNullaryOp<Eigen::internal::scalar_constant_op, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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, 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, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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, 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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:55:30: warning: ignoring attributes on template argument ‘Eigen::internal::packet_traits::type’ {aka ‘__vector(2) double’} [-Wignored-attributes]
In file included from C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/StanHeaders/include/stan/math/rev/core/set_zero_all_adjoints.hpp: At global scope:
C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/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/mingw32/bin/"ar -rs …/inst/lib//i386/libStanServices.a stan_fit.o stan_fit_base.o
C:\rtools40\mingw32\bin\ar.exe: creating …/inst/lib//i386/libStanServices.a
no DLL was created
ERROR: compilation failed for package ‘rstan’

  • removing ‘C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1/rstan’
    Warning in install.packages :
    installation of package ‘rstan’ had non-zero exit status

Hmm, no clear error there either. Can you try the preview of the next rstan version to see if that has a different result:

remove.packages(c("StanHeaders", "rstan"))
install.packages("StanHeaders", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))

Output from that is…

package ‘StanHeaders’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\hrh210\AppData\Local\Temp\RtmpO8PWg7\downloaded_packages
install.packages(“rstan”, repos = c(“Repository for distributing (some) stan-dev R packages | r-packages”, getOption(“repos”)))
Installing package into ‘C:/Users/hrh210/OneDrive - University of Exeter/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
trying URL ‘https://mc-stan.org/r-packages/bin/windows/contrib/4.1/rstan_2.26.4.zip
Content type ‘application/zip’ length 3394225 bytes (3.2 MB)
downloaded 3.2 MB
package ‘rstan’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\hrh210\AppData\Local\Temp\RtmpO8PWg7\downloaded_packages

Any difference in behaviour with the preview version?