Compilation error on windows


#1

I’m having some problems compiling a stan model on windows. I’ve followed the instructions for installing on windows but am still experiencing the following error. Any thoughts?

Error in compileCode(f, code, language = language, verbose = verbose) :
  Compilation ERROR, function(s)/method(s) not created! make: sh.exe: Comman
d not found
make: *** [file1a045b1c4b2.o] Error 127
Warning message:
running command 'make -f "C:/Users/jcarey/DOCUME~1/R/R-33~1.1/etc/x64/Makeco
nf" -f "C:/Users/jcarey/DOCUME~1/R/R-33~1.1/share/make/winshlib.mk" -f "C:\U
sers\jcarey/.R/Makevars" SHLIB_LDFLAGS='$(SHLIB_CXXLDFLAGS)' SHLIB_LD='$(SHL
IB_CXXLD)' SHLIB="file1a045b1c4b2.dll" WIN=64 TCLBIN=64 OBJECTS="file1a045b1
c4b2.o"' had status 2
In addition: Warning message:
running command 'C:/Users/jcarey/Documents/R/R-3.3.1/bin/x64/R CMD SHLIB fil
e1a045b1c4b2.cpp 2> file1a045b1c4b2.cpp.err.txt' had status 1

#2

Error 127 means it could not find the C++ compiler. The most common cause of that problem is not checking the box that says to save changes to the PATH when installing RTools. The second most common cause is omitting or otherwise messing up the BINPREF line in .Rprofile. The third most common cause is Windows doing something inexplicable.


#3

Thanks @bgoodri! I’m on a corporate computer and didn’t install Rtools, so I bet first issue you mentioned is the culprit - I’ll investigate further. Thanks!