HELP!Can someone help me find out why this error is reported?

Short summary of the problem
.stan is syntactically correct. however, when I run the code, the following error will be reported

Error in compileCode(f, code, language = language, verbose = verbose) :
from D:/Program Files/R/R-4.0.3/library/StanHeaders/include/src/stan/model/model_header.hpp:4, from file33386f2c4f6e.cpp:14:D:/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() { ^~~~~~~~~~~~~~~~~~~~~make: *** [D:/Program Files/R/R-4.0.3/etc/x64/Makeconf:229: file33386f2c4f6e.o] Error 1
Error in sink(type = “output”) : invalid connection

code_to_run_your_model(if_applicable)



If possible, add also code to simulate data or attach a (subset of) the dataset you work with.

Don't forget to add relevant tags to your topic (top right of this form) especially for application area. Delete this text before posting your question :-) Thx!

If your question relates to installation please provide the following information:

* Operating System
* RStan Version
* Output of `writeLines(readLines(file.path(Sys.getenv("HOME"), ".R/Makevars")))`
* Output of `devtools::session_info("rstan")`

If you are reporting a bug (thank you!) please use the issue tracker (github.com/stan-dev/rstan/issues) instead of the forums.

Looking forward to your topic!

This is an error that sometimes occurs with the current CRAN version rstan, try the preview of the next version:

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

Sir, I try the preview of the next version,but a similar error was reported:

Error in compileCode(f, code, language = language, verbose = verbose) : 
  D:/Program Files/R/R-4.0.5/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>]'D:/Program Files/R/R
Error in sink(type = "output") : invalid connection

Can you try closing and re-opening R, making sure that no packages or files get loaded, and then reinstall rstan and some of its dependencies:

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

You will likely see several compiler warnings during this process, but these are safe to ignore as long the packages install successfully.

Next, try the example model:

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

If that runs successfully then your installation is setup correctly and ready to be used, if it errors, then re-run with the verbose flag:

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

And post the output here, and I’ll see if I can spot the issue

Sir, I can not install the “rstan” by
install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")), type = "source")

Running the code will generate the following report:

`ERROR: compilation failed for package 'rstan'
* removing 'D:/Program Files/R/R-4.0.5/library/rstan'
Warning in install.packages :
  installation of package ‘rstan’ had non-zero exit status`

So I can not library rstan.
Then I run

install.packages("rstan",repos="https://cloud.r-project.org/",dependencies=TRUE) 

and library(rstan) successfully.

But when I run these two examples, a bomb pattern will be displayed and I will be told “R Session Aborted” and "R encounted a fatal error. The session was terminated“.

What are the compilation errors that are shown when you try to install rstan?

When I install rstan with the code you provided, it displays

> install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")), type = "source")
also installing the dependencies ‘StanHeaders’, ‘RcppEigen’

trying URL 'https://mc-stan.org/r-packages/src/contrib/StanHeaders_2.26.13.tar.gz'
Content type 'application/gzip' length 2323771 bytes (2.2 MB)
downloaded 2.2 MB

Warning in install.packages :
  downloaded length 2269184 != reported length 2323771
trying URL 'https://cran.rstudio.com/src/contrib/RcppEigen_0.3.3.9.2.tar.gz'
Content type 'application/x-gzip' length 1476004 bytes (1.4 MB)
downloaded 1.4 MB

trying URL 'https://mc-stan.org/r-packages/src/contrib/rstan_2.26.13.tar.gz'
Content type 'application/gzip' length 1041472 bytes (1017 KB)
downloaded 1017 KB

* installing *source* package 'RcppEigen' ...
** 成功将'RcppEigen'程序包解包并MD5和检查
** using staged installation
** libs

*** arch - i386
"D:/rtools40/mingw32/bin/"g++ -std=gnu++11  -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG   -I"D:/Program Files/R/R-4.0.5/library/Rcpp/include/"  -I"D:/Program Files/R/R-4.0.5/library/RcppEigen/include/"  -I"D:/Program Files/R/R-4.0.5/library/RcppEigen/include/unsupported"  -I"D:/Program Files/R/R-4.0.5/library/BH/include" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/"  -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/"  -I"D:/Program Files/R/R-4.0.5/library/RcppParallel/include/"  -I"D:/Program Files/R/R-4.0.5/library/rstan/include" -DEIGEN_NO_DEBUG  -DBOOST_DISABLE_ASSERTS  -DBOOST_PENDING_INTEGER_LOG2_HPP  -DSTAN_THREADS  -DBOOST_NO_AUTO_PTR  -include "D:/Program Files/R/R-4.0.5/library/StanHeaders/include/stan/math/prim/fun/Eigen.hpp"  -std=c++1y -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include'     -I../inst/include   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -c RcppEigen.cpp -o RcppEigen.o
cc1plus.exe: fatal error: D:/Program Files/R/R-4.0.5/library/StanHeaders/include/stan/math/prim/fun/Eigen.hpp: No such file or directory
compilation terminated.
make: *** [D:/Program Files/R/R-4.0.5/etc/i386/Makeconf:229: RcppEigen.o] Error 1
ERROR: compilation failed for package 'RcppEigen'
* removing 'D:/Program Files/R/R-4.0.5/library/RcppEigen'
Warning in install.packages :
  installation of package ‘RcppEigen’ had non-zero exit status
Error in untar2(tarfile, files, list, exdir, restore_times) : 
  incomplete block on file
Warning in install.packages :
  installation of package ‘StanHeaders’ had non-zero exit status
ERROR: dependencies 'StanHeaders', 'RcppEigen' are not available for package 'rstan'
* removing 'D:/Program Files/R/R-4.0.5/library/rstan'
Warning in install.packages :
  installation of package ‘rstan’ had non-zero exit status

So I installed the packages that it reported failed, then I have successfully installed rstan and run two examples. When I run my own code, it will display

make cmd is
  make -f "D:/Program Files/R/R-4.0.5/etc/x64/Makeconf" -f "D:/Program Files/R/R-4.0.5/share/make/winshlib.mk" -f "C:/Users/asus/Documents/.R/Makevars.win" CXX='$(CXX14) $(CXX14STD)' CXXFLAGS='$(CXX14FLAGS)' CXXPICFLAGS='$(CXX14PICFLAGS)' SHLIB_LDFLAGS='$(SHLIB_CXX14LDFLAGS)' SHLIB_LD='$(SHLIB_CXX14LD)' SHLIB="file2a7063736899.dll" WIN=64 TCLBIN=64 OBJECTS="file2a7063736899.o"

make would use
"D:/rtools40/mingw64/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG   -I"D:/Program Files/R/R-4.0.5/library/Rcpp/include/"  -I"D:/Program Files/R/R-4.0.5/library/RcppEigen/include/"  -I"D:/Program Files/R/R-4.0.5/library/RcppEigen/include/unsupported"  -I"D:/Program Files/R/R-4.0.5/library/BH/include" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/"  -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/"  -I"D:/Program Files/R/R-4.0.5/library/RcppParallel/include/"  -I"D:/Program Files/R/R-4.0.5/library/rstan/include" -DEIGEN_NO_DEBUG  -DBOOST_DISABLE_ASSERTS  -DBOOST_PENDING_INTEGER_LOG2_HPP  -DSTAN_THREADS  -DBOOST_NO_AUTO_PTR  -include "D:/Program Files/R/R-4.0.5/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp"  -std=c++1y         -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -c file2a7063736899.cpp -o file2a7063736899.o
if test "zfile2a7063736899.o" != "z"; then \
  if test -e "file2a7063736899-win.def"; then \
    echo "D:/rtools40/mingw64/bin/"g++  -shared -s -static-libgcc -o file2a7063736899.dll file2a7063736899-win.def file2a7063736899.o   "D:/Program Files/R/R-4.0.5/library/rstan/lib/x64/libStanServices.a" -L"D:/Program Files/R/R-4.0.5/library/StanHeaders/libs/x64" -lStanHeaders -L"D:/Program Files/R/R-4.0.5/library/RcppParallel/lib/x64" -ltbb  -L"D:/Program Files/R/R-4.0.5/bin/x64" -lR ; \
    "D:/rtools40/mingw64/bin/"g++  -shared -s -static-libgcc -o file2a7063736899.dll file2a7063736899-win.def file2a7063736899.o   "D:/Program Files/R/R-4.0.5/library/rstan/lib/x64/libStanServices.a" -L"D:/Program Files/R/R-4.0.5/library/StanHeaders/libs/x64" -lStanHeaders -L"D:/Program Files/R/R-4.0.5/library/RcppParallel/lib/x64" -ltbb  -L"D:/Program Files/R/R-4.0.5/bin/x64" -lR ; \
  else \
    echo EXPORTS > tmp.def; \
    "D:/rtools40/mingw64/bin/"nm file2a7063736899.o | sed -n 's/^.* [BCDRT] / /p' | sed -e '/[.]refptr[.]/d' -e '/[.]weak[.]/d' | sed 's/[^ ][^ ]*/"&"/g'  >> tmp.def; \
    echo "D:/rtools40/mingw64/bin/"g++  -shared -s -static-libgcc -o file2a7063736899.dll tmp.def file2a7063736899.o   "D:/Program Files/R/R-4.0.5/library/rstan/lib/x64/libStanServices.a" -L"D:/Program Files/R/R-4.0.5/library/StanHeaders/libs/x64" -lStanHeaders -L"D:/Program Files/R/R-4.0.5/library/RcppParallel/lib/x64" -ltbb  -L"D:/Program Files/R/R-4.0.5/bin/x64" -lR ; \
    "D:/rtools40/mingw64/bin/"g++  -shared -s -static-libgcc -o file2a7063736899.dll tmp.def file2a7063736899.o   "D:/Program Files/R/R-4.0.5/library/rstan/lib/x64/libStanServices.a" -L"D:/Program Files/R/R-4.0.5/library/StanHeaders/libs/x64" -lStanHeaders -L"D:/Program Files/R/R-4.0.5/library/RcppParallel/lib/x64" -ltbb  -L"D:/Program Files/R/R-4.0.5/bin/x64" -lR ; \
    rm -f tmp.def; \
  fi \
fi
Error in compileCode(f, code, language = language, verbose = verbose) : 
                   from D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/model/model_header.hpp:4,                 from file2a7063736899.cpp:14:D:/Program Files/R/R-4.0.5/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() {             ^~~~~~~~~~~~~~~~~~~~~make: *** [D:/Program Files/R/R-4.0.5/etc/x64/Makeconf:229: file2a7063736899.o] Error 1
Error in sink(type = "output") : invalid connection

It looks like you still had rstan loaded when you were trying to install the packages. Can you run:

remove.packages(c("BH","RcppEigen","rstan","StanHeaders"))

Then restart your R session, and run:

install.packages(c("BH","RcppEigen"), type = "source")

Does that complete without errors?

Yes, sir. Then what should I do?

Great! Can you now try running:

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

Does that finish successfully?

T.T ,sir, it would show:

ERROR: compilation failed for package 'rstan'
* removing 'D:/Program Files/R/R-4.0.5/library/rstan'
Warning in install.packages :
  installation of package ‘rstan’ had non-zero exit status

I need to see the full error output, there should be additional errors above that which show why it failed

Sir, There are too many messages in the panel. I can’t reply to you. Maybe I can contact you via email? Can you tell me your email address?

You can just post as much of the end of the output that you can copy, that should contain the error

D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/diag_e_metric.hpp:20:10:   required from here
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:650:34: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits<double>::type' {aka '__vector(2) double'} [-Wignored-attributes]
   return internal::first_aligned<int(unpacket_traits<DefaultPacketType>::alignment),Derived>(m);
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h: In instantiation of 'Eigen::Index Eigen::internal::first_default_aligned(const Eigen::DenseBase<Derived>&) [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<double>, 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> >; Eigen::Index = int]':
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/Redux.h:225:63:   required from 'static Eigen::internal::redux_impl<Func, Derived, 3, 0>::Scalar Eigen::internal::redux_impl<Func, Derived, 3, 0>::run(const Derived&, const Func&) [with Func = Eigen::internal::scalar_sum_op<double, double>; Derived = Eigen::internal::redux_evaluator<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<double>, 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> > >; Eigen::internal::redux_impl<Func, Derived, 3, 0>::Scalar = double]'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/Redux.h:418:56:   required from 'typename Eigen::internal::traits<T>::Scalar Eigen::DenseBase<Derived>::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<double>, 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<T>::Scalar = double]'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/Redux.h:453:73:   required from 'typename Eigen::internal::traits<T>::Scalar Eigen::DenseBase<Derived>::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<double>, 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<T>::Scalar = double]'
D:/Program Files/R/R-4.0.5/library/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<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>]'
D:/Program Files/R/R-4.0.5/library/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<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; 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<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>]'
D:/Program Files/R/R-4.0.5/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>]'
D:/Program Files/R/R-4.0.5/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]'
D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:22: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> >]'
D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:21:10:   required from here
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:650:34: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits<double>::type' {aka '__vector(2) double'} [-Wignored-attributes]
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h: In instantiation of 'class Eigen::DenseCoeffsBase<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, 0>':
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:300:7:   required from 'class Eigen::DenseCoeffsBase<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, 1>'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:551:7:   required from 'class Eigen::DenseCoeffsBase<Eigen::Transpose<Eigen::Matrix<double, 1, -1> >, 3>'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/DenseBase.h:41:34:   required from 'class Eigen::DenseBase<Eigen::Transpose<Eigen::Matrix<double, 1, -1> > >'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/MatrixBase.h:48:34:   required from 'class Eigen::MatrixBase<Eigen::Transpose<Eigen::Matrix<double, 1, -1> > >'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/Transpose.h:115:37:   required from 'class Eigen::TransposeImpl<Eigen::Matrix<double, 1, -1>, Eigen::Dense>'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/Transpose.h:52:37:   [ skipping 16 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
D:/Program Files/R/R-4.0.5/library/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<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>]'
D:/Program Files/R/R-4.0.5/library/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<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; 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<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>]'
D:/Program Files/R/R-4.0.5/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>]'
D:/Program Files/R/R-4.0.5/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]'
D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:22: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> >]'
D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:21:10:   required from here
D:/Program Files/R/R-4.0.5/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]
                      >::type PacketReturnType;
                              ^~~~~~~~~~~~~~~~
D:/Program Files/R/R-4.0.5/library/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<double>, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > > >, 0>':
D:/Program Files/R/R-4.0.5/library/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<double>, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > > > >'
D:/Program Files/R/R-4.0.5/library/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<double>, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > > > >'
D:/Program Files/R/R-4.0.5/library/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<double>, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > >, Eigen::Dense>'
D:/Program Files/R/R-4.0.5/library/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<double>, const Eigen::Matrix<double, 1, -1> >, const Eigen::Transpose<Eigen::Matrix<double, -1, 1> > > >'
D:/Program Files/R/R-4.0.5/library/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<double>, 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]'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/ProductEvaluators.h:383:34:   [ skipping 14 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
D:/Program Files/R/R-4.0.5/library/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<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>]'
D:/Program Files/R/R-4.0.5/library/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<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; 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<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>]'
D:/Program Files/R/R-4.0.5/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>]'
D:/Program Files/R/R-4.0.5/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]'
D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:22: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> >]'
D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:21:10:   required from here
D:/Program Files/R/R-4.0.5/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]
D:/Program Files/R/R-4.0.5/library/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>':
D:/Program Files/R/R-4.0.5/library/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>'
D:/Program Files/R/R-4.0.5/library/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> > > >'
D:/Program Files/R/R-4.0.5/library/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> > > >'
D:/Program Files/R/R-4.0.5/library/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>'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/Transpose.h:52:37:   required from 'class Eigen::Transpose<const Eigen::Transpose<const Eigen::Matrix<double, -1, 1> > >'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/util/BlasUtil.h:464:13:   [ skipping 17 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
D:/Program Files/R/R-4.0.5/library/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<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>]'
D:/Program Files/R/R-4.0.5/library/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<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; 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<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>]'
D:/Program Files/R/R-4.0.5/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>]'
D:/Program Files/R/R-4.0.5/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]'
D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:22: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> >]'
D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:21:10:   required from here
D:/Program Files/R/R-4.0.5/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]
D:/Program Files/R/R-4.0.5/library/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>':
D:/Program Files/R/R-4.0.5/library/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>'
D:/Program Files/R/R-4.0.5/library/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>'
D:/Program Files/R/R-4.0.5/library/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> >'
D:/Program Files/R/R-4.0.5/library/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> >'
D:/Program Files/R/R-4.0.5/library/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>'
D:/Program Files/R/R-4.0.5/library/RcppEigen/include/Eigen/src/Core/MapBase.h:221:34:   [ skipping 20 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]
D:/Program Files/R/R-4.0.5/library/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<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>]'
D:/Program Files/R/R-4.0.5/library/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<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; 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<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>]'
D:/Program Files/R/R-4.0.5/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>]'
D:/Program Files/R/R-4.0.5/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]'
D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:22: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> >]'
D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src/stan/mcmc/hmc/hamiltonians/dense_e_metric.hpp:21:10:   required from here
D:/Program Files/R/R-4.0.5/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]
"D:/rtools40/mingw32/bin/"ar -rs ../inst/lib//i386/libStanServices.a stan_fit.o stan_fit_base.o
D:\rtools40\mingw32\bin\ar.exe: 正在创建 ../inst/lib//i386/libStanServices.a
no DLL was created
ERROR: compilation failed for package 'rstan'
* removing 'D:/Program Files/R/R-4.0.5/library/rstan'
Warning in install.packages :
  installation of package ‘rstan’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\asus\AppData\Local\Temp\RtmpYTaXGD\downloaded_packages’

We’ll try suppressing some of those warnings, so that the error will be clearer to see. Can you run:

dotR <- file.path(Sys.getenv("HOME"), ".R")
if (!file.exists(dotR)) dir.create(dotR)
M <- file.path(dotR, "Makevars.win")
if (!file.exists(M)) file.create(M)
cat("\n CXX14FLAGS += -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function",
    file = M, sep = "\n", append = TRUE)

And then retry the rstan install. There should be much less output, and a clearer error: message somewhere

Yes!sir. The output is reduced a lot

> install.packages("rstan", repos = c("https://mc-stan.org/r-packages/", getOption("repos")), type = "source")
trying URL 'https://mc-stan.org/r-packages/src/contrib/rstan_2.26.13.tar.gz'
Content type 'application/gzip' length 1041472 bytes (1017 KB)
downloaded 1017 KB

* installing *source* package 'rstan' ...
** using staged installation
** libs

*** arch - i386
"D:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DRCPP_PARALLEL_USE_TBB=1 -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include' -I'D:/Program Files/R/R-4.0.5/library/RcppEigen/include' -I'D:/Program Files/R/R-4.0.5/library/BH/include' -I'D:/Program Files/R/R-4.0.5/library/StanHeaders/include' -I'D:/Program Files/R/R-4.0.5/library/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -c Module.cpp -o Module.o
"D:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DRCPP_PARALLEL_USE_TBB=1 -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include' -I'D:/Program Files/R/R-4.0.5/library/RcppEigen/include' -I'D:/Program Files/R/R-4.0.5/library/BH/include' -I'D:/Program Files/R/R-4.0.5/library/StanHeaders/include' -I'D:/Program Files/R/R-4.0.5/library/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -c chains.cpp -o chains.o
"D:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DRCPP_PARALLEL_USE_TBB=1 -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include' -I'D:/Program Files/R/R-4.0.5/library/RcppEigen/include' -I'D:/Program Files/R/R-4.0.5/library/BH/include' -I'D:/Program Files/R/R-4.0.5/library/StanHeaders/include' -I'D:/Program Files/R/R-4.0.5/library/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -c init.cpp -o init.o
"D:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DRCPP_PARALLEL_USE_TBB=1 -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include' -I'D:/Program Files/R/R-4.0.5/library/RcppEigen/include' -I'D:/Program Files/R/R-4.0.5/library/BH/include' -I'D:/Program Files/R/R-4.0.5/library/StanHeaders/include' -I'D:/Program Files/R/R-4.0.5/library/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -c misc.cpp -o misc.o
"D:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DRCPP_PARALLEL_USE_TBB=1 -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include' -I'D:/Program Files/R/R-4.0.5/library/RcppEigen/include' -I'D:/Program Files/R/R-4.0.5/library/BH/include' -I'D:/Program Files/R/R-4.0.5/library/StanHeaders/include' -I'D:/Program Files/R/R-4.0.5/library/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -c pointer-tools.cpp -o pointer-tools.o
"D:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DRCPP_PARALLEL_USE_TBB=1 -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include' -I'D:/Program Files/R/R-4.0.5/library/RcppEigen/include' -I'D:/Program Files/R/R-4.0.5/library/BH/include' -I'D:/Program Files/R/R-4.0.5/library/StanHeaders/include' -I'D:/Program Files/R/R-4.0.5/library/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -c sparse_extractors.cpp -o sparse_extractors.o
"D:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DRCPP_PARALLEL_USE_TBB=1 -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include' -I'D:/Program Files/R/R-4.0.5/library/RcppEigen/include' -I'D:/Program Files/R/R-4.0.5/library/BH/include' -I'D:/Program Files/R/R-4.0.5/library/StanHeaders/include' -I'D:/Program Files/R/R-4.0.5/library/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -c stan_fit_base.cpp -o stan_fit_base.o
"D:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DRCPP_PARALLEL_USE_TBB=1 -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include' -I'D:/Program Files/R/R-4.0.5/library/RcppEigen/include' -I'D:/Program Files/R/R-4.0.5/library/BH/include' -I'D:/Program Files/R/R-4.0.5/library/StanHeaders/include' -I'D:/Program Files/R/R-4.0.5/library/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -c stan_fit_rccp.cpp -o stan_fit_rccp.o
"D:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DRCPP_PARALLEL_USE_TBB=1 -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include' -I'D:/Program Files/R/R-4.0.5/library/RcppEigen/include' -I'D:/Program Files/R/R-4.0.5/library/BH/include' -I'D:/Program Files/R/R-4.0.5/library/StanHeaders/include' -I'D:/Program Files/R/R-4.0.5/library/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -c version.cpp -o version.o
D:/rtools40/mingw32/bin/g++ -shared -s -static-libgcc -o rstan.dll tmp.def Module.o chains.o init.o misc.o pointer-tools.o sparse_extractors.o stan_fit_base.o stan_fit_rccp.o version.o -LD:/Program Files/R/R-4.0.5/library/RcppParallel/lib/i386 -ltbb -ltbbmalloc -LD:/Program Files/R/R-4.0.5/bin/i386 -lR
g++.exe: error: Files/R/R-4.0.5/library/RcppParallel/lib/i386: No such file or directory
"D:/rtools40/mingw32/bin/"g++  -std=gnu++14 -I"D:/Program Files/R/R-4.0.5/include" -DNDEBUG -I"../inst/include" -I"../inst/include/boost_not_in_BH" -I"D:/Program Files/R/R-4.0.5/library/StanHeaders/include/src" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -D_REENTRANT -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DRCPP_PARALLEL_USE_TBB=1 -I'D:/Program Files/R/R-4.0.5/library/Rcpp/include' -I'D:/Program Files/R/R-4.0.5/library/RcppEigen/include' -I'D:/Program Files/R/R-4.0.5/library/BH/include' -I'D:/Program Files/R/R-4.0.5/library/StanHeaders/include' -I'D:/Program Files/R/R-4.0.5/library/RcppParallel/include'     -DRCPP_PARALLEL_USE_TBB=1 -DSTRICT_R_HEADERS   -O2 -Wall  -mfpmath=sse -msse2 -mstackrealign -mtune=native -O3 -mmmx -msse -msse2 -msse3 -mssse3 -msse4.1 -msse4.2 -Wno-ignored-attributes -Wno-unused-local-typedefs -Wno-parentheses -Wno-attributes -Wno-deprecated-declarations -Wno-sign-compare -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unused-function -c stan_fit.cpp -o stan_fit.o
"D:/rtools40/mingw32/bin/"ar -rs ../inst/lib//i386/libStanServices.a stan_fit.o stan_fit_base.o
D:\rtools40\mingw32\bin\ar.exe: 正在创建 ../inst/lib//i386/libStanServices.a
no DLL was created
ERROR: compilation failed for package 'rstan'
* removing 'D:/Program Files/R/R-4.0.5/library/rstan'
Warning in install.packages :
  installation of package ‘rstan’ had non-zero exit status

The downloaded source packages are in
	‘C:\Users\asus\AppData\Local\Temp\RtmpYTaXGD\downloaded_packages’

Can you post the output from the following commands:

packageVersion("StanHeaders")
packageVersion("RcppParallel")
StanHeaders:::LdFlags()
RcppParallel::LdFlags()

Yes!

> packageVersion("StanHeaders")
[1] ‘2.26.13’
> packageVersion("RcppParallel")
[1] ‘5.1.5’
> StanHeaders:::LdFlags()
-L"D:/Program Files/R/R-4.0.5/library/RcppParallel/lib/x64" -Wl,-rpath,"D:/Program Files/R/R-4.0.5/library/RcppParallel/lib/x64" -ltbb -ltbbmalloc  
> RcppParallel::LdFlags()
-LD:/Program Files/R/R-4.0.5/library/RcppParallel/lib/x64 -ltbb -ltbbmalloc

So this is an error with the RcppParallel package not correctly handling spaces in filepaths for the RcppParallel::LdFlags() flag command, since that’s what rstan uses for installing.

You’ll need to open an issue on the RcppParallel github showing that RcppParallel::LdFlags() isn’t correctly handling spaces for you.

In the meantime, you would need to install your R packages in a directory with no spaces in the filepath to avoid this issue