Very novice Stan user.
Updated to Big Sur. Using R 4.03 and RStudio 1.3.959.
Now get the following error. Any help understanding and managing it would be appreciated.
stn_mdR> mod ← stan_model(model_code = stancode, verbose = TRUE)
TRANSLATING MODEL ‘16a540c6086086816528e4524def24d9’ FROM Stan CODE TO C++ CODE NOW.
successful in parsing the Stan model ‘16a540c6086086816528e4524def24d9’.
sh: clang++ -mmacosx-version-min=10.13: command not found
error in running commandThe NEXT version of Stan will not be able to pre-process your Stan program.
Please open an issue at Issues · stan-dev/stanc3 · GitHub
if you can share or at least describe your Stan program. This will help ensure that Stan
continues to work on your Stan programs in the future. Thank you!
This message can be avoided by wrapping your function call inside suppressMessages().
cannot remove file ‘/var/folders/vz/g1j5pr8n7tg786zcwmv2dx8c0000gp/T//Rtmp9cB1Vc/file2c866fd6798b.stan’, reason 'No such file or directory’COMPILING THE C++ CODE FOR MODEL ‘16a540c6086086816528e4524def24d9’ NOW.
OS: x86_64, darwin17.0; rstan: 2.21.1; Rcpp: 1.0.5; inline: 0.3.16
So I’m not knowledgable enough to understand that error message. But it might be worth reinstalling all the relevant packages if you haven’t already done so. Worth a try anyhow!
There are binary versions available but the source versions are later:
binary source needs_compilation
ggraph 2.0.3 2.0.4 TRUE
RcppArmadillo 0.10.1.0.0 0.10.1.2.0 TRUE
rstan 2.21.1 2.21.2 TRUE
Do you want to install from sources the packages which need compilation? (Yes/no/cancel) ’
I answered yes but get several pages of errors and can’t find the log file.At the end of the file is
"clang: error: no such file or directory: ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/lib//libStanServices.a’
make: *** [rstan.so] Error 1
ERROR: compilation failed for package ‘rstan’
restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan’
Warning in install.packages :
installation of package ‘rstan’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/vz/g1j5pr8n7tg786zcwmv2dx8c0000gp/T/RtmpMt8rQ2/downloaded_packages’"
I changed my reply to no.
I have nothing in my .Renviron file
.Rprofile shows
"options(prompt="R> ", digits=4, show.signif.stars=FALSE)
## local creates a new, empty environment
## This avoids polluting the global environment with
## the object r
local({
r = getOption("repos")
r["CRAN"] = "https://cran.rstudio.com/"
options(repos = r)
})
## WORKAROUND: https://github.com/rstudio/rstudio/issues/6692 for rstan
## Revert to 'sequential' setup of PSOCK cluster in RStudio Console on macOS and R 4.0.0
if (Sys.getenv("RSTUDIO") == "1" && !nzchar(Sys.getenv("RSTUDIO_TERM")) &&
Sys.info()["sysname"] == "Darwin") {
parallel:::setDefaultClusterOptions(setup_strategy = "sequential")
}"
stn_mdR> mod ← stan_model(model_code = stancode, verbose = TRUE)
TRANSLATING MODEL ‘16a540c6086086816528e4524def24d9’ FROM Stan CODE TO C++ CODE NOW.
successful in parsing the Stan model ‘16a540c6086086816528e4524def24d9’.
sh: clang++ -mmacosx-version-min=10.13: command not found
error in running commandThe NEXT version of Stan will not be able to pre-process your Stan program.
Please open an issue at Issues · stan-dev/stanc3 · GitHub
if you can share or at least describe your Stan program. This will help ensure that Stan
continues to work on your Stan programs in the future. Thank you!
This message can be avoided by wrapping your function call inside suppressMessages().
cannot remove file ‘/var/folders/vz/g1j5pr8n7tg786zcwmv2dx8c0000gp/T//RtmpbtAKen/file6ee833dd4339.stan’, reason 'No such file or directory’COMPILING THE C++ CODE FOR MODEL ‘16a540c6086086816528e4524def24d9’ NOW.
OS: x86_64, darwin17.0; rstan: 2.21.1; Rcpp: 1.0.5; inline: 0.3.16
stn_mdR> mod ← stan_model(model_code = stancode, verbose = TRUE)
TRANSLATING MODEL ‘16a540c6086086816528e4524def24d9’ FROM Stan CODE TO C++ CODE NOW.
successful in parsing the Stan model ‘16a540c6086086816528e4524def24d9’.
sh: clang++ -mmacosx-version-min=10.13: command not found
The NEXT version of Stan will not be able to pre-process your Stan program.
Please open an issue at Issues · stan-dev/stanc3 · GitHub
if you can share or at least describe your Stan program. This will help ensure that Stan
continues to work on your Stan programs in the future. Thank you!
This message can be avoided by wrapping your function call inside suppressMessages().
stn_mdR> fit ← sampling(mod, data = list(y_mean = 0))
stn_mdR> fit2 ← sampling(mod, data = list(y_mean = 5))
Warning messages:
1: In system2(CXX, args = ARGS) : error in running command
2: In file.remove(c(unprocessed, processed)) :
cannot remove file ‘/var/folders/vz/g1j5pr8n7tg786zcwmv2dx8c0000gp/T//RtmpbtAKen/file6ee86bcb1a9d.stan’, reason ‘No such file or directory’
R> str(mod)
Formal class ‘stanmodel’ [package “rstan”] with 5 slots
…@ model_name : chr “16a540c6086086816528e4524def24d9”
…@ model_code : chr “data {real y_mean;} parameters {real y;} model {y ~ normal(y_mean,1);}”
… …- attr(*, “model_name2”)= chr “16a540c6086086816528e4524def24d9”
…@ model_cpp :List of 2
… … model_cppname: chr "model6ee84954e160_16a540c6086086816528e4524def24d9"
.. .. model_cppcode: chr “// Code generated by Stan version 2.21.0\n\n#include <stan/model/model_header.hpp>\n\nnamespace model6ee84954e1”| truncated
…@ mk_cppmodule:function (object)
…@ dso :Formal class ‘cxxdso’ [package “rstan”] with 7 slots
… … …@ sig :List of 1
… … … … file6ee83686dc9: chr(0)
.. .. ..@ dso_saved : logi TRUE
.. .. ..@ dso_filename: chr "file6ee83686dc9"
.. .. ..@ modulename : chr "stan_fit4model6ee84954e160_16a540c6086086816528e4524def24d9_mod"
.. .. ..@ system : chr "x86_64, darwin17.0"
.. .. ..@ cxxflags : chr "CXXFLAGS = -Wall -g -O2 (LTO)"
… … …@ .CXXDSOMISC :<environment: 0x7f9a2c0e11d0>
R>