Hi there, I’ve installed Stan and I get the following message when I run a test.
Error in compileCode(f, code, language = language, verbose = verbose) :
sh: line 1: C:/rtools40/usr/mingw_64/bin/g++: No such file or directorymake: *** [C:/PROGRA~1/R/R-40~1.5/etc/x64/Makeconf:229: file4a4c3d1a74e6.o] Error 127
In addition: 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") : invalid connection
I think I have RTools configured correctly and I am on a Windows 10 machine.
I got same problem, and cannot figure out using your method.
It shows the following errors:
Error in compileCode(f, code, language = language, verbose = verbose) :
C:/rtools40/mingw64/bin/…/lib/gcc/x86_64-w64-mingw32/8.3.0/…/…/…/…/x86_64-w64-mingw32/bin/ld.exe: C:/Users/wcao/Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a(stan_fit.o):stan_fit.cpp:(.rdata$_ZZN5boost4math6detail9bessel_j0IeEET_S3_E2P1[ZZN5boost4math6detail9bessel_j0IeEET_S3_E2P1]+0x0): multiple definition of boost::math::detail::bessel_j0<long double>(long double)::P1'; file2f044aa74e25.o:file2f044aa74e25.cpp:(.data$_ZZN5boost4math6detail9bessel_j0IeEET_S3_E2P1[_ZZN5boost4math6detail9bessel_j0IeEET_S3_E2P1]+0x0): first defined hereC:/rtools40/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Users/wcao/Documents/R/win-library/4.0/rstan/lib/x64/libStanServices.a(stan_fit.o):stan_fit.cpp:(.rdata$_ZZN5boost4math6detail9bessel_j0IeEET_S3_E2QC[_ZZN5boost4math6detail9bessel_j0IeEET_S3_E2QC]+0x0): multiple definition of boost::math::detail::bessel_j0(long double)::QC’; file2f044aa74e25.o:file2f044aa74e2
In addition: 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”) : invalid connection
Hopefully one of our Windows experts will reply (@andrjohns any ideas?), but you could also try out our other R interface to Stan and see if that works with your current setup:
I got the following error when I try to remove it:
remove.packages(c(“StanHeaders”,“rstan”))
Removing packages from ‘C:/Users/wtnic/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Error in .rs.recursiveWalk(parsed, function(node) { :
reached elapsed time limit
Error in .rs.recursiveWalk(_node[[i]], fn, …) :
reached elapsed time limit
Error in as.POSIXct(time2) : reached elapsed time limit
Error in .rs.recursiveWalk(parsed, function(node) { :
reached elapsed time limit
# Compile packages using all cores
Sys.setenv(MAKEFLAGS = paste0("-j",parallel::detectCores()))
install.packages(c("StanHeaders","rstan"),type="source")
ERROR: compilation failed for package ‘StanHeaders’
removing ‘C:/Users/wcao/Documents/R/win-library/4.0/StanHeaders’
Warning in install.packages :
installation of package ‘StanHeaders’ had non-zero exit status
ERROR: dependency ‘StanHeaders’ is not available for package ‘rstan’
removing ‘C:/Users/wcao/Documents/R/win-library/4.0/rstan’
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status
sh: line 1: C:/rtools40/usr/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.5/etc/i386/Makeconf:222: cvodes/cvodes_nls_stg1.o] Error 127
make: *** Waiting for unfinished jobs…
sh: line 1: C:/rtools40/usr/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.5/etc/i386/Makeconf:222: cvodes/cvodes_nls_sim.o] Error 127
sh: line 1: C:/rtools40/usr/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.5/etc/i386/Makeconf:222: cvodes/cvodes_ls.o] Error 127
sh: line 1: C:/rtools40/usr/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.5/etc/i386/Makeconf:222: cvodes/cvodea_io.o] Error 127
sh: line 1: C:/rtools40/usr/mingw_32/bin/gcc: No such file or directory
make: *** [C:/PROGRA~1/R/R-40~1.5/etc/i386/Makeconf:222: cvodes/cvodes_spils.o] Error 127
ERROR: compilation failed for package ‘StanHeaders’