Would appreciate any advice on fixing the following issue.
The following code to simulate some data work fine in a Windows 8.1 machine runnig R 3.5.3 but ran into compliation errors in a Windows 10 machine running R 3.5.1. In both machines, the rstan
and StanHeaders
installed are the same: 2.19.2 and 2.19.0, repsectively.
simu_fit <- stan(file = SimFile,
data=PREDdata,
iter=1,
chains=1,
algorithm="Fixed_param")
The following are the compilation errors:
Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! Warning message: In system(cmd) : 'make' not found
9.
stop(paste("Compilation ERROR, function(s)/method(s) not created!", paste(errmsg, collapse = "\n")))
8.
compileCode(f, code, language = language, verbose = verbose)
7.
cxxfunction(sig = sig, body = body, plugin = plugin, includes = includes, settings = settings, ..., verbose = verbose)
6.
force(code)
5.
withr::with_path(rtools_path(), code)
4.
pkgbuild::with_build_tools(cxxfunction(sig = sig, body = body, plugin = plugin, includes = includes, settings = settings, ..., verbose = verbose), required = rstan_options("required") && !identical(Sys.getenv("WINDOWS"), "TRUE") && !identical(Sys.getenv("R_PACKAGE_SOURCE"), ...
3.
cxxfunctionplus(signature(), body = paste(" return Rcpp::wrap(\"", model_name, "\");", sep = ""), includes = inc, plugin = "rstan", save_dso = save_dso | auto_write, module_name = paste("stan_fit4", model_cppname, "_mod", sep = ""), verbose = verbose)
2.
stan_model(file, model_name = model_name, model_code = model_code, stanc_ret = NULL, boost_lib = boost_lib, eigen_lib = eigen_lib, save_dso = save_dso, verbose = verbose)
1.
stan(file = SimFile, data = PREDdata, iter = 1, chains = 1, algorithm = "Fixed_param")
Also, a second error:
Error in sink(type = "output") : invalid connection
4.
sink(type = "output")
3.
cxxfunctionplus(signature(), body = paste(" return Rcpp::wrap(\"", model_name, "\");", sep = ""), includes = inc, plugin = "rstan", save_dso = save_dso | auto_write, module_name = paste("stan_fit4", model_cppname, "_mod", sep = ""), verbose = verbose)
2.
stan_model(file, model_name = model_name, model_code = model_code, stanc_ret = NULL, boost_lib = boost_lib, eigen_lib = eigen_lib, save_dso = save_dso, verbose = verbose)
1.
stan(file = SimFile, data = PREDdata, iter = 1, chains = 1, algorithm = "Fixed_param")
Because the first error above said: In system(cmd) : 'make' not found
, I reinstalled Rtools 3.5 but this does not fix the problem. The Makevars.win file is the same as on https://github.com/stan-dev/rstan/wiki/Installing-RStan-from-source-on-Windows . Also, tried the version below that works in the WIndows 8.1 machine but could not fix the issue:
CXX14FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
CXX14 = $(BINPREF)g++ -m$(WIN) -std=c++1y
CXX11FLAGS=-O3 -Wno-unused-variable -Wno-unused-function
Session info:
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 17134)
Matrix products: default
locale:
[1] LC_COLLATE=English_United Kingdom.1252 LC_CTYPE=English_United Kingdom.1252
[3] LC_MONETARY=English_United Kingdom.1252 LC_NUMERIC=C
[5] LC_TIME=English_United Kingdom.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] rstan_2.19.2 ggplot2_3.2.1 StanHeaders_2.19.0 bayesplot_1.7.0 qs_0.19.1
[6] stringr_1.4.0 magrittr_1.5 dplyr_0.8.3 here_0.1
loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 pillar_1.4.2 compiler_3.5.1 plyr_1.8.4 prettyunits_1.0.2
[6] tools_3.5.1 pkgbuild_1.0.6 packrat_0.5.0 tibble_2.1.3 gtable_0.3.0
[11] pkgconfig_2.0.3 rlang_0.4.1 cli_1.1.0 rstudioapi_0.10 parallel_3.5.1
[16] yaml_2.2.0 xfun_0.10 loo_2.1.0 gridExtra_2.3 withr_2.1.2
[21] knitr_1.25 stats4_3.5.1 rprojroot_1.3-2 grid_3.5.1 tidyselect_0.2.5
[26] glue_1.3.1 inline_0.3.15 RApiSerialize_0.1.0 R6_2.4.0 processx_3.4.1
[31] callr_3.3.2 purrr_0.3.3 matrixStats_0.55.0 ps_1.3.0 backports_1.1.5
[36] scales_1.0.0 ggridges_0.5.1 assertthat_0.2.1 colorspace_1.4-1 stringi_1.4.3
[41] lazyeval_0.2.2 munsell_0.5.0 crayon_1.3.4
[1] "Sat Nov 09 21:10:18 2019"