I am using R v.3.5.1, R studio v 1.3.1093 with Rtools 3.5 on windows 10.
I know that R tools have been successfully installed and the toolchain has been found, having followed https://github.com/stan-dev/rstan/wiki/Configuring-C---Toolchain-for-Windows and successfully installing:
install.packages("jsonlite",type="source").
However, when I try and install rstan from source using
pkgbuild::with_build_tools(install.packages("rstan", type = "source"))
I get the following error message:
sh: C:/Rtools/mingw_32/bin/: Is a directory
make: *** [C:/PROGRA~1/R/R-35~1.1/etc/i386/Makeconf:215: sparse_extractors.o] Error 126
ERROR: compilation failed for package 'rstan'
* removing 'C:/R/library/rstan'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status
Currently, my makevars.win file contains the following:
CXX14 = C:/Rtools/mingw_$(WIN)/bin/ g++ -std=c++1y
CXX14FLAGS = -O3 -Wno-unused-variable -Wno-unused-function
Although I have tried various different lines in the makevars file and all still bring up the error 126 message as above.
I can successfully install the binary versions of rstan/rstanarm/brms etc. But when I try and compile a model it fails. When I tried this and realised the binary versions were not working, I uninstalled rstan/rstanarm and brms before trying to install the source versions.
Any help fixing this error and successfully installing rstan would be greatly appreciated!