So, to recap: I installed the latest Rtools with:
I set the binpref, so that:
Sys.getenv("BINPREF")  "C:/Rtools/mingw_$(WIN)/bin/"
My Makevars looks like this:
CXX14 = g++ -m$(WIN) -std=c++1y CXX14FLAGS = -O3 -Wno-unused-variable -Wno-unused-function
install.packages("rstan") still fails:
*** arch - x64 g++ -m64 -std=c++1y -I"C:/PROGRA~1/R/R-35~1.1/include" -DNDEBUG -I"../inst/include" -I"`"C:/PROGRA~1/R/R-35~1.1/bin/x64/Rscript" --vanilla -e "cat(system.file('include', 'src', package = 'StanHeaders'))"`" -DBOOST_DISABLE_ASSERTS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -I"C:/Users/win7/Documents/R/win-library/3.5/Rcpp/include" -I"C:/Users/win7/Documents/R/win-library/3.5/RcppEigen/include" -I"C:/Users/win7/Documents/R/win-library/3.5/BH/include" -I"C:/Users/win7/Documents/R/win-library/3.5/StanHeaders/include" -O3 -Wno-unused-variable -Wno-unused-function -c chains.cpp -o chains.o chains.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in // This file is part of RStan ^ make: *** [C:/PROGRA~1/R/R-35~1.1/etc/x64/Makeconf:215: chains.o] Error 1 ERROR: compilation failed for package 'rstan'
This also fails (similarly as above):
install.packages("rstan", type = "source", INSTALL_opts = "--no-multiarch")
Installing from https://win-builder.r-project.org/8Q3LUki5kcHs/rstan_2.18.1.zip works, but when I want to compile a Stan model it throws another error at me:
Error in compileCode(f, code, language = language, verbose = verbose) : Compilation ERROR, function(s)/method(s) not created! filea6040b6550a.cpp:1:0: sorry, unimplemented: 64-bit mode not compiled in ^ make: *** [C:/PROGRA~1/R/R-35~1.1/etc/x64/Makeconf:215: filea6040b6550a.o] Error 1 In addition: Warning message: In system(cmd, intern = !verbose) : running command 'C:/PROGRA~1/R/R-35~1.1/bin/x64/R CMD SHLIB filea6040b6550a.cpp 2> filea6040b6550a.cpp.err.txt' had status 1
I feel really stupid.