Hello, I have try to compile the example “schools.stan” but I always have the following error:
fit ← stan(file = ‘schools.stan’, data = schools_dat)
make cmd is
make -f “C:/PROGRA~1/R/R-40~1.5/etc/x64/Makeconf” -f “C:/PROGRA~1/R/R-40~1.5/share/make/winshlib.mk” -f “C:\Users\Eduardo Sánchez Ayra\Documents/.R/Makevars.win” CXX=‘(CXX14) (CXX14STD)’ CXXFLAGS=‘(CXX14FLAGS)' CXXPICFLAGS='(CXX14PICFLAGS)’ SHLIB_LDFLAGS=‘(SHLIB_CXX14LDFLAGS)' SHLIB_LD='(SHLIB_CXX14LD)’ SHLIB=“file2c24291c414b.dll” WIN=64 TCLBIN=64 OBJECTS=“file2c24291c414b.o”
make would use
make: “C:\Users\Eduardo Sánchez Ayra\Documents/.R/Makevars.win”: No such file or directory
make: *** No rule to make target ‘“C:\Users\Eduardo Sánchez Ayra\Documents/.R/Makevars.win”’. Stop.
Error in compileCode(f, code, language = language, verbose = verbose) :
make: “C:\Users\Eduardo Sánchez Ayra\Documents/.R/Makevars.win”: No such file or directorymake: *** No rule to make target ‘“C:\Users\Eduardo Sánchez Ayra\Documents/.R/Makevars.win”’. Stop.
Además: Warning message:
In system(paste(CXX, ARGS), ignore.stdout = TRUE, ignore.stderr = TRUE) :
‘C:/rtools40/usr/mingw_/bin/g++’ not found
Error in sink(type = “output”) : conexión inválida
At a guess, it looks like there’s an issue with how its parsing your name in the file path.
Based on what you posted, the file path should be:
C:\Users\Eduardo Sánchez Ayra
But the error message in the first post show the path as:
C:\Users\Eduardo Sánchez Ayra\
I’m not entirely sure how to fix this one, to be honest. As a first step, I’ll get you to try installing the preview of the next RStan release to see if it’s already been fixed. To install, restart R (making sure that rstan doesn’t get loaded) and run:
fit ← stan(file = ‘schools.stan’, data = schools_dat)
make cmd is
make -f “C:/PROGRA~1/R/R-40~1.5/etc/x64/Makeconf” -f “C:/PROGRA~1/R/R-40~1.5/share/make/winshlib.mk” -f “C:\Users\Eduardo Sánchez Ayra\Documents/.R/Makevars.win” CXX=‘(CXX14) (CXX14STD)’ CXXFLAGS=‘(CXX14FLAGS)' CXXPICFLAGS='(CXX14PICFLAGS)’ SHLIB_LDFLAGS=‘(SHLIB_CXX14LDFLAGS)' SHLIB_LD='(SHLIB_CXX14LD)’ SHLIB=“file233474225237.dll” WIN=64 TCLBIN=64 OBJECTS=“file233474225237.o”
make would use
make: “C:\Users\Eduardo Sánchez Ayra\Documents/.R/Makevars.win”: No such file or directory
make: *** No rule to make target ‘“C:\Users\Eduardo Sánchez Ayra\Documents/.R/Makevars.win”’. Stop.
Error in compileCode(f, code, language = language, verbose = verbose) :
make: “C:\Users\Eduardo Sánchez Ayra\Documents/.R/Makevars.win”: No such file or directorymake: *** No rule to make target ‘“C:\Users\Eduardo Sánchez Ayra\Documents/.R/Makevars.win”’. Stop.
Error in sink(type = “output”) : conexión inválida
Hi,
I have create a new user account (Windowws 10) without “á” just for R + rstan and it is working fine. I prefer to do it that way to concentrate in modelling with Stan rather to install cmdstanR.
I think the problem it is the spanish character “á”, so may be you can debugging this issue in next version.
Anyway, thanks for your support, it was very hepfull.
@andrjohns Sorry for the very late reply! Character encoding is a historical problem in R + C/POSIX standards, especially on Windows. We could encode the paths using functions like enc2native() or enc2utf8(). But, this would fix the local path wrapped by those functions and may easily fail in a later step, when passed to an external function that doesn’t support the current locale.