Problems with crashing R session

Hi, @andrjohns .
No problem about the delay.
I followed your suggestion and removed all indicated packages plus rstantools.
I will give you several details of the operation and you consider whether it is relevant or not ok.

remove.packages(c(“StanHeaders”, “rstan”,“rstantools”))

Upon restarting the session after removing them, the following message was displayed:

Warning: namespace ‘rstan’ is not available and has been replaced
by .GlobalEnv when processing object ‘.__C__C++Object’

And then I installed it again.

install.packages(“StanHeaders”, repos = c(“Repository for distributing (some) stan-dev R packages | r-packages”, getOption(“repos”)))
install.packages(“rstan”, repos = c(“Repository for distributing (some) stan-dev R packages | r-packages”, getOption(“repos”)))
install.packages(“rstantools”, repos = c(“Repository for distributing (some) stan-dev R packages | r-packages”, getOption(“repos”)))

So I made the rstan package available:

library(rstan)

  • with output:

Carregando pacotes exigidos: StanHeaders
rstan (Version 2.26.1, GitRev: 2e1f913d3ca3)
For execution on a local, multicore CPU with excess RAM we recommend calling
options(mc.cores = parallel::detectCores()).
To avoid recompilation of unchanged Stan programs, we recommend calling
rstan_options(auto_write = TRUE)
For within-chain threading using reduce_sum() or map_rect() Stan functions,
change threads_per_chain option:
rstan_options(threads_per_chain = 1)

Do not specify ‘-march=native’ in ‘LOCAL_CPPFLAGS’ or a Makevars file

And now when specific, the model returns this to me:

model ← stan_model(model_name = “Morgan Mercer Flodin”, file = “Enviar forum/mod_MMF.stan”)

  • the output (white color):
    make cmd is
    make -f “C:/PROGRA~1/R/R-40~1.4/etc/x64/Makeconf” -f “C:/PROGRA~1/R/R-40~1.4/share/make/winshlib.mk” -f “D:/Users/Carlos Zarzar/Documents/.R/Makevars.win” CXX=‘(CXX14) (CXX14STD)’ CXXFLAGS=‘(CXX14FLAGS)' CXXPICFLAGS='(CXX14PICFLAGS)’ SHLIB_LDFLAGS=‘(SHLIB_CXX14LDFLAGS)' SHLIB_LD='(SHLIB_CXX14LD)’ SHLIB=“file328c111c5a5c.dll” WIN=64 TCLBIN=64 OBJECTS=“file328c111c5a5c.o”

make would use
if test “zfile328c111c5a5c.o” != “z”; then
if test -e “file328c111c5a5c-win.def”; then
echo “C:/rtools40/mingw64/bin/“g++ -shared -s -static-libgcc -o file328c111c5a5c.dll file328c111c5a5c-win.def file328c111c5a5c.o “D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a” -L"D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/StanHeaders/libs/x64” -lStanHeaders -L"D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/RcppParallel/lib/x64” -ltbb -LD:/Users/Carlos Zarzar/Documents/R/win-library/4.0/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"C:/PROGRA~1/R/R-40~1.4/bin/x64" -lR ;
“C:/rtools40/mingw64/bin/“g++ -shared -s -static-libgcc -o file328c111c5a5c.dll file328c111c5a5c-win.def file328c111c5a5c.o “D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a” -L"D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/StanHeaders/libs/x64” -lStanHeaders -L"D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/RcppParallel/lib/x64” -ltbb -LD:/Users/Carlos Zarzar/Documents/R/win-library/4.0/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"C:/PROGRA~1/R/R-40~1.4/bin/x64" -lR ;
else
echo EXPORTS > tmp.def;
“C:/rtools40/mingw64/bin/“nm file328c111c5a5c.o | sed -n ‘s/^.* [BCDRT] / /p’ | sed -e ‘/[.]refptr[.]/d’ -e ‘/[.]weak[.]/d’ | sed 's/[^ ][^ ]*/”&”/g’ >> tmp.def;
echo “C:/rtools40/mingw64/bin/“g++ -shared -s -static-libgcc -o file328c111c5a5c.dll tmp.def file328c111c5a5c.o “D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a” -L"D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/StanHeaders/libs/x64” -lStanHeaders -L"D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/RcppParallel/lib/x64” -ltbb -LD:/Users/Carlos Zarzar/Documents/R/win-library/4.0/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"C:/PROGRA~1/R/R-40~1.4/bin/x64" -lR ;
“C:/rtools40/mingw64/bin/“g++ -shared -s -static-libgcc -o file328c111c5a5c.dll tmp.def file328c111c5a5c.o “D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a” -L"D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/StanHeaders/libs/x64” -lStanHeaders -L"D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/RcppParallel/lib/x64” -ltbb -LD:/Users/Carlos Zarzar/Documents/R/win-library/4.0/RcppParallel/lib/x64 -ltbb -ltbbmalloc -L"C:/PROGRA~1/R/R-40~1.4/bin/x64" -lR ;
rm -f tmp.def;
fi
fi

  • and the ouput erro (red color):
    Error in compileCode(f, code, language = language, verbose = verbose) :
    D:/Users/Carlos Zarzar/Documents/R/win-library/4.0/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>]'D:/Us
    Além disso: Warning message:
    In readLines(file, warn = TRUE) :
    linha final incompleta encontrada em ‘D:\Users\Carlos Zarzar\Downloads\Stan_forum\Enviar forum\mod_MMF.stan’
    Error in sink(type = “output”) : conexão inválida

And so, now the .rds file is not generated