I’ve tried to install rstan and rstanHeaders from source. I’m working from an environment where I can’t reinstall R and Rtools (not installed in C: but in P:), but they are installed and should (?) work according to ICT. Unfortunately I am bound to this workspace. Tried a whole bunch of things, but I keep running into error 127.
When I run:
rstan_options(auto_write = TRUE)
example(stan_model, package = "rstan", run.dontrun = TRUE)
Error:
Error in compileCode(f, code, language = language, verbose = verbose) :
/bin/sh: line 1: P:/Rtools/mingw_64/bin/g++.exe: No such file or directorymake: *** [P:/R/R-4.2.1/etc/x64/Makeconf:260: file35ac5b705c5.o] Error 127
13.
stop(errmsg)
12.
compileCode(f, code, language = language, verbose = verbose)
11.
cxxfunction(sig = sig, body = body, plugin = plugin, includes = includes,
settings = settings, …, verbose = verbose)
10.
force(code)
9.
withr_with_path(rtools_path(), code)
8.
pkgbuild::with_build_tools(cxxfunction(sig = sig, body = body,
plugin = plugin, includes = includes, settings = settings,
…, verbose = verbose), required = rstan_options(“required”) &&
!identical(Sys.getenv(“WINDOWS”), “TRUE”) && !identical(Sys.getenv(“R_PACKAGE_SOURCE”), …
7.
cxxfunctionplus(signature(), body = paste(" return Rcpp::wrap("",
model_name, “");”, sep = “”), includes = inc, plugin = “rstan”,
save_dso = save_dso | auto_write, module_name = paste(“stan_fit4”,
model_cppname, “_mod”, sep = “”), verbose = verbose)
6.
stan_model(model_code = stancode, verbose = TRUE) at C:\Users\ME\AppData\Local\Temp\RtmpspabCA\Rex35ac54f17db8#9
5.
eval(ei, envir)
4.
eval(ei, envir)
3.
withVisible(eval(ei, envir))
2.
source(tf, local, echo = echo, prompt.echo = paste0(prompt.prefix,
getOption(“prompt”)), continue.echo = paste0(prompt.prefix,
getOption(“continue”)), verbose = verbose, max.deparse.length = Inf,
encoding = “UTF-8”, skip.echo = skips, keep.source = TRUE)
1.
example(stan_model, package = “rstan”, run.dontrun = TRUE)
- Operating System
- RStan Version
- Output of
writeLines(readLines(file.path(Sys.getenv("HOME"), ".R/Makevars")))
Error in file(con, “r”) : cannot open the connection
Relatedly running:
pkgbuild::check_build_tools(debug = TRUE)
pkgbuild::check_compiler(debug = TRUE)
Gives:
Scanning R CMD config CC…
cc_path: P:/Rtools/mingw_64/bin/gcc
‘P:/Rtools/mingw_64/bin/gcc’ does not exist
Scanning path…
ls: P:\rtools\usr\bin\ls.exe
gcc_path:
‘P:/rtools/usr/mingw_64/bin/gcc.exe’ does not exist
Scanning registry…
Found P:/rtools for 4.2
Your system is ready to build packages!
Trying to compile a simple C file
Running “P:/R/R-4.2.1/bin/x64/Rcmd.exe” SHLIB foo.c
/ME/My Documents/R/win-library/4.2/StanHeaders/include/stan/math/prim/fun/Eigen.hpp" -std=c++1y -I"c:/rtools42/x86_64-w64-mingw32.static.posix/include" -O2 -Wall -std=gnu99 -mfpmath=sse -msse2 -mstackrealign -c foo.c -o foo.onclude/" -I"\storage.WORK.nl/m/MyDocs/ME/My Documents/R/win-library/4.2/RcppEigen/include/unsupported" -I"\storage.WORK.nl/m/MyDocs/ME/My Documents/R/win-library/4.2/BH/include" -I"\storage.WORK.nl/m/MyDocs/ME/My Documents/R/win-library/4.2/StanHeaders/include/src/" -I"\storage.WORK.nl/m/MyDocs/ME/My Documents/R/win-library/4.2/StanHeaders/include/" -I"\storage.WORK.nl/m/MyDocs/ME/My Documents/R/win-library/4.2/RcppParallel/include/" -DRCPP_PARALLEL_USE_TBB=1 -I"P:/R/R-4.2.1/library/rstan/include" -DEIGEN_NO_DEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -DSTAN_THREADS -DUSE_STANC3 -DSTRICT_R_HEADERS -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION -DBOOST_NO_AUTO_PTR -include "\storage.WORK.nl/m/MyDocs
/bin/sh: line 1: P:/Rtools/mingw_64/bin/gcc: No such file or directory
make: *** [P:/R/R-4.2.1/etc/x64/Makeconf:253: foo.o] Error 127
Error: Failed to compile C code
2.
stop(“Failed to compile C code”, call. = FALSE)
1.
pkgbuild::check_compiler(debug = TRUE)
- Output of
devtools::session_info("rstan")
Session info ────────────────────────────────────────────────────────────────────────────────────────────────────────
setting value
version R version 4.2.1 (2022-06-23 ucrt)
os Windows 10 x64 (build 19045)
system x86_64, mingw32
ui RStudio
language (EN)
collate English_United States.utf8
ctype English_United States.utf8
tz Europe/Berlin
date 2023-10-06
rstudio 2022.07.2+576 Spotted Wakerobin (desktop)
pandoc NA
─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────
! package * version date (UTC) lib source
backports 1.4.1 2021-12-13 [1] CRAN (R 4.3.0)
BH 1.81.0-1 2023-01-22 [1] CRAN (R 4.3.0)
callr 3.7.3 2022-11-02 [1] CRAN (R 4.3.1)
checkmate 2.2.0 2023-04-27 [1] CRAN (R 4.3.1)
cli 3.6.1 2023-03-23 [1] CRAN (R 4.3.1)
colorspace 2.1-0 2023-01-23 [1] CRAN (R 4.3.1)
crayon 1.5.2 2022-09-29 [1] CRAN (R 4.3.1)
desc 1.4.2 2022-09-08 [1] CRAN (R 4.3.1)
fansi 1.0.4 2023-01-22 [1] CRAN (R 4.3.1)
farver 2.1.1 2022-07-06 [1] CRAN (R 4.3.1)
ggplot2 * 3.4.3 2023-08-14 [1] CRAN (R 4.3.1)
glue 1.6.2 2022-02-24 [1] CRAN (R 4.3.1)
gridExtra 2.3 2017-09-09 [1] CRAN (R 4.3.1)
gtable 0.3.4 2023-08-21 [1] CRAN (R 4.3.1)
inline 0.3.19 2021-05-31 [1] CRAN (R 4.3.1)
isoband 0.2.7 2022-12-20 [1] CRAN (R 4.3.1)
jsonlite 1.8.7 2023-06-29 [1] CRAN (R 4.3.1)
labeling 0.4.3 2023-08-29 [1] CRAN (R 4.3.1)
lattice 0.21-8 2023-04-05 [2] CRAN (R 4.2.3)
lifecycle 1.0.3 2022-10-07 [1] CRAN (R 4.3.1)
loo 2.6.0 2023-03-31 [1] CRAN (R 4.3.1)
magrittr 2.0.3 2022-03-30 [1] CRAN (R 4.3.1)
MASS 7.3-60 2023-05-04 [2] CRAN (R 4.2.3)
Matrix 1.5-4.1 2023-05-18 [2] CRAN (R 4.2.3)
matrixStats 1.0.0 2023-06-02 [1] CRAN (R 4.3.1)
mgcv 1.8-42 2023-03-02 [2] CRAN (R 4.2.3)
munsell 0.5.0 2018-06-12 [1] CRAN (R 4.3.1)
nlme 3.1-162 2023-01-31 [2] CRAN (R 4.2.3)
pillar 1.9.0 2023-03-22 [1] CRAN (R 4.3.1)
pkgbuild 1.4.2 2023-06-26 [1] CRAN (R 4.3.1)
pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.3.1)
prettyunits 1.2.0 2023-09-24 [1] CRAN (R 4.3.1)
processx 3.8.2 2023-06-30 [1] CRAN (R 4.3.1)
ps 1.7.5 2023-04-18 [1] CRAN (R 4.3.1)
QuickJSR 1.0.6 2023-09-12 [1] CRAN (R 4.3.1)
R6 2.5.1 2021-08-19 [1] CRAN (R 4.3.1)
RColorBrewer 1.1-3 2022-04-03 [1] CRAN (R 4.3.0)
Rcpp * 1.0.11 2023-07-06 [1] CRAN (R 4.3.1)
RcppEigen 0.3.3.9.3 2022-11-05 [1] CRAN (R 4.3.1)
D RcppParallel 5.1.7 2023-02-27 [1] CRAN (R 4.3.1)
rlang 1.1.1 2023-04-28 [1] CRAN (R 4.3.1)
rprojroot 2.0.3 2022-04-02 [1] CRAN (R 4.3.1)
rstan * 2.26.23 [2]
scales 1.2.1 2022-08-20 [1] CRAN (R 4.3.1)
StanHeaders * 2.26.28 2023-09-07 [1] CRAN (R 4.2.3)
tibble * 3.2.1 2023-03-20 [1] CRAN (R 4.3.1)
utf8 1.2.3 2023-01-31 [1] CRAN (R 4.3.1)
vctrs 0.6.3 2023-06-14 [1] CRAN (R 4.3.1)
viridisLite 0.4.2 2023-05-02 [1] CRAN (R 4.3.1)
withr 2.5.1 2023-09-26 [1] CRAN (R 4.3.1)
[1] \storage.WORK.nl/m/MyDocs/ME/My Documents/R/win-library/4.2
[2] P:/R/R-4.2.1/library
I censored my workplace. Everything runs absolutely fine on my own desktop where I can do clean installs, but I’m not allowed to access the data there… So now I’m stuck.
I know there’s lots of similar post, but I’ve just not been able to figure it out on my own. Any help would be very welcome.