rstan icon indicating copy to clipboard operation
rstan copied to clipboard

sh: clang++ -mmacosx-version-min=10.13: command not found

Open twitched opened this issue 4 years ago • 39 comments

Summary:

Received a warning when compiling with the latest version of the develop branch on R 4.0.x on MacOS that says "the NEXT version of Stan will not be able to pre-process your Stan program." This seems to be because R CMD config CXX14 returns clang++ -mmacosx-version-min=10.13 instead of just clang++

Description:

The warning says in full:

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
 https://github.com/stan-dev/stanc3/issues 
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().

Additional warning messages include:

Warning messages:
1: In system2(CXX, args = ARGS) : error in running command
2: In file.remove(c(unprocessed, processed)) :
  cannot remove file '/var/folders/rl/46xg9hmn34g8clr_dwqqn48m0000gp/T//RtmpurL17p/file9a1462472c1c.stan', reason 'No such file or directory'

After looking at the code, this is what I think may be the problem:

The offending line from Warning Message 1 is Line 123 of stanc.R, which calls system2. The first argument of system2 must, according to the docs, be a single command without arguments. However, get_CXX() returns the output of R CMD config CXX14. In the case of R 4.0.0 and greater on MacOS the result is clang++ -mmacosx-version-min=10.13, which does have an argument and causes the system2 call to fail.

Since all of this is in stanc_beta, it falls back to the older compiler and finishes correctly--until the next version, according to the warning.

I updated from R 4.0.0 to 4.0.1 today and the problem occurs with both versions.

Reproducible Steps:

  1. On MacOS open R >= 4.0.0 in terminal
  2. Install latest rstan remotes::install_github("stan-dev/rstan", ref = "develop", subdir = "rstan/rstan", build_opts = "")
  3. Run the example code in rstan's stan function:
    library(rstan)
    scode <- "
    parameters {
       real y[2]; 
    } 
    model {
      y[1] ~ normal(0, 1);
      y[2] ~ double_exponential(0, 2);
    } 
    "
    fit1 <- stan(model_code = scode, iter = 10, verbose = TRUE) 
    print(fit1)
    

Current Output:

Despite showing the warning above, it compiles correctly and the output is otherwise as expected

Expected Output:

The output without the warning

RStan Version:

2.21.1 (f083ce6)

R Version:

R version 4.0.1 (2020-06-06)

Operating System:

MacOS Catalina 10.15.5

twitched avatar Jun 10 '20 02:06 twitched

The first portion of this message

sh: clang++ -mmacosx-version-min=10.13: command not found

is also triggered in RStudio (1.3.1054) when opening or syntax checking a .stan file.

ssp3nc3r avatar Jul 07 '20 23:07 ssp3nc3r

Can the -mmacosx-version-min=10.13 thing be moved to CXX14FLAGS? Why is it even needed?

bgoodri avatar Jul 08 '20 17:07 bgoodri

I can confirm this with:

  • RStudio1.3.959
  • R 4.0.2
  • rstan 2.21.1
  • StanHeaders 2.21.0.5

using xcode-select --install, i.e.,

$ clang++ --version
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

torkar avatar Jul 09 '20 06:07 torkar

If people with Macs could try

remotes::install_github("stan-dev/rstan", ref = "develop", subdir = "rstan/rstan")

and report whether things work, I would appreciate it.

On Thu, Jul 9, 2020 at 2:47 AM Richard Torkar [email protected] wrote:

I can confirm this with:

  • RStudio1.3.959
  • R 4.0.2
  • rstan 2.21.1
  • StanHeaders 2.21.0.5

using xcode-select --install, i.e.,

$ clang++ --version Apple clang version 11.0.3 (clang-1103.0.32.62) Target: x86_64-apple-darwin19.5.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/774#issuecomment-655935549, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKQOBURHH2DKU4W62ZLR2VRYBANCNFSM4NZ6H4QA .

bgoodri avatar Jul 09 '20 19:07 bgoodri

That seems to have worked. The original error is now gone. There is, however, another error that is likely a separate issue.

The NEXT version of Stan will not be able to parse your Stan program.
Please open an issue at
 https://github.com/stan-dev/stanc3/issues 
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().

Semantic error in 'string', line 2, column 12 to column 13:

Integer literal cannot be larger than 2_147_483_647.

twitched avatar Jul 09 '20 20:07 twitched

Yes, this error was already reported and is a separate thing. We are looking into that.

rok-cesnovar avatar Jul 09 '20 20:07 rok-cesnovar

Simple script:

          install.packages("remotes")
          remotes::install_github("stan-dev/rstan", ref = "develop", subdir = "rstan/rstan")

also works on the Github Actions Catalina machines (both devel and release R version): https://github.com/rok-cesnovar/misc/runs/855482567?check_suite_focus=true

But those are obviously clean installs.

rok-cesnovar avatar Jul 09 '20 20:07 rok-cesnovar

Yes, this error was already reported and is a separate thing. We are looking into that.

Is it in another posted issue?

I got the same result as @twitched

ssp3nc3r avatar Jul 09 '20 20:07 ssp3nc3r

Yes, here: https://github.com/stan-dev/stanc3/issues/611

rok-cesnovar avatar Jul 09 '20 20:07 rok-cesnovar

Yeah, that is a duplicate of https://github.com/stan-dev/stanc3/issues/611

On Thu, Jul 9, 2020 at 4:07 PM Doug Twitchell [email protected] wrote:

That seems to have worked. The original error is now gone. There is, however, another error that is likely a separate issue.

The NEXT version of Stan will not be able to parse your Stan program. Please open an issue at https://github.com/stan-dev/stanc3/issues 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().

Semantic error in 'string', line 2, column 12 to column 13:

Integer literal cannot be larger than 2_147_483_647.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/774#issuecomment-656325700, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKVJD3YTQ6L52AGEESLR2YPPPANCNFSM4NZ6H4QA .

bgoodri avatar Jul 09 '20 21:07 bgoodri

What is rstan:::get_CXX() for you?

On Thu, Jul 9, 2020 at 8:21 PM Dan Ovando [email protected] wrote:

Was running into the same errors so ran the solution below, and it broke everything! Before I was only getting those warnings, but the script was still running. Now I get (MacOS Catalina 10.15.5, R v4.0.2).

library(rstan)#> Loading required package: StanHeaders#> Loading required package: ggplot2#> rstan (Version 2.21.2, GitRev: 2e1f913d3ca3)#> For execution on a local, multicore CPU with excess RAM we recommend calling#> options(mc.cores = parallel::detectCores()).#> To avoid recompilation of unchanged Stan programs, we recommend calling#> rstan_options(auto_write = TRUE)

stanmodelcode <- "data { int<lower=0> N; real y[N];} parameters { real mu;} model { target += normal_lpdf(mu | 0, 10); target += normal_lpdf(y | mu, 1);} " y <- rnorm(20) dat <- list(N = 20, y = y); fit <- stan(model_code = stanmodelcode, model_name = "example", data = dat, iter = 2012, chains = 3, verbose = TRUE) #> #> TRANSLATING MODEL 'example' FROM Stan CODE TO C++ CODE NOW.#> successful in parsing the Stan model 'example'.#> OS: x86_64, darwin17.0; rstan: 2.21.2; Rcpp: 1.0.5.1; inline: 0.3.15#> Error in (function (...) : wrong length for argument print(fit)#> Error in print(fit): object 'fit' not found

Created on 2020-07-09 by the reprex package https://reprex.tidyverse.org (v0.3.0)

Simple script:

      install.packages("remotes")
      remotes::install_github("stan-dev/rstan", ref = "develop", subdir = "rstan/rstan")

also works on the Github Actions Catalina machines (both devel and release R version): https://github.com/rok-cesnovar/misc/runs/855482567?check_suite_focus=true

But those are obviously clean installs.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/774#issuecomment-656413707, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKT2MW2XVRDDRGPWZ2TR2ZNHHANCNFSM4NZ6H4QA .

bgoodri avatar Jul 10 '20 00:07 bgoodri

rstan:::get_CXX() [1] "clang++ -mmacosx-version-min=10.13"

ssp3nc3r avatar Jul 10 '20 01:07 ssp3nc3r

Do you get errors using the GitHub version?

bgoodri avatar Jul 10 '20 01:07 bgoodri

Yes, Version 2.21.2, GitRev: 2e1f913d3ca3)

> fit1 <- stan(model_code = scode, iter = 10, verbose = FALSE) 
The NEXT version of Stan will not be able to parse your Stan program.
Please open an issue at
 https://github.com/stan-dev/stanc3/issues 
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().

Semantic error in 'string', line 2, column 9 to column 10:

Integer literal cannot be larger than 2_147_483_647.


Error in (function (...)  : wrong length for argument
Error in sink(type = "output") : invalid connection
> print(fit1)
Error in print(fit1) : object 'fit1' not found

ssp3nc3r avatar Jul 10 '20 01:07 ssp3nc3r

What is traceback() before you call print(fit1)?

On Thu, Jul 9, 2020 at 9:19 PM ssp3nc3r [email protected] wrote:

Yes,

fit1 <- stan(model_code = scode, iter = 10, verbose = FALSE) The NEXT version of Stan will not be able to parse your Stan program. Please open an issue at https://github.com/stan-dev/stanc3/issues 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().

Semantic error in 'string', line 2, column 9 to column 10:

Integer literal cannot be larger than 2_147_483_647.

Error in (function (...) : wrong length for argument Error in sink(type = "output") : invalid connection

print(fit1) Error in print(fit1) : object 'fit1' not found

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/774#issuecomment-656428501, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKW4AOJUP6GX76UYLJ3R2ZUCDANCNFSM4NZ6H4QA .

bgoodri avatar Jul 10 '20 01:07 bgoodri

> traceback()
4: sink(type = "output")
3: 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)
2: stan_model(file, model_name = model_name, model_code = model_code, 
       stanc_ret = NULL, boost_lib = boost_lib, eigen_lib = eigen_lib, 
       save_dso = save_dso, verbose = verbose)
1: stan(model_code = scode, iter = 10, verbose = FALSE)

ssp3nc3r avatar Jul 10 '20 01:07 ssp3nc3r

And with verbose = TRUE?

On Thu, Jul 9, 2020 at 9:43 PM ssp3nc3r [email protected] wrote:

traceback() 4: sink(type = "output") 3: 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) 2: stan_model(file, model_name = model_name, model_code = model_code, stanc_ret = NULL, boost_lib = boost_lib, eigen_lib = eigen_lib, save_dso = save_dso, verbose = verbose) 1: stan(model_code = scode, iter = 10, verbose = FALSE)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/774#issuecomment-656434408, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKTOLXAGSATGRCWAZG3R2ZW2TANCNFSM4NZ6H4QA .

bgoodri avatar Jul 10 '20 01:07 bgoodri

> fit1 <- stan(model_code = scode, iter = 10, verbose = TRUE) 

TRANSLATING MODEL 'a156e89b0e786acf24d10fa926f1686f' FROM Stan CODE TO C++ CODE NOW.
successful in parsing the Stan model 'a156e89b0e786acf24d10fa926f1686f'.
The NEXT version of Stan will not be able to parse your Stan program.
Please open an issue at
 https://github.com/stan-dev/stanc3/issues 
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().

Semantic error in 'string', line 2, column 9 to column 10:

Integer literal cannot be larger than 2_147_483_647.


COMPILING THE C++ CODE FOR MODEL 'a156e89b0e786acf24d10fa926f1686f' NOW.
OS: x86_64, darwin17.0; rstan: 2.21.2; Rcpp: 1.0.5; inline: 0.3.15 
Error in (function (...)  : wrong length for argument
> traceback()
7: (function (...) 
   {
       x <- list(...)
       nm <- names(x)
       if (is.null(nm) || "" %in% nm) 
           stop("all arguments must be named")
       .Internal(Sys.setenv(nm, as.character(unlist(x))))
   })(PKG_LIBS = " /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/lib//libStanServices.a -L'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/lib/' -lStanHeaders -L'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/lib/' -ltbb -ltbbmalloc -ltbbmalloc_proxy", 
       LOCAL_LIBS = NULL, PKG_CPPFLAGS = "  -I\"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/\"  -I\"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/\"  -I\"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/unsupported\"  -I\"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/BH/include\" -I\"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/src/\"  -I\"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/\"  -I\"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include/\"  -I\"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/include\" -DEIGEN_NO_DEBUG  -DBOOST_DISABLE_ASSERTS  -DBOOST_PENDING_INTEGER_LOG2_HPP  -DSTAN_THREADS  -DBOOST_NO_AUTO_PTR  -include '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp'  -D_REENTRANT -DRCPP_PARALLEL_USE_TBB=1 ")
6: do.call(Sys.setenv, env)
5: cxxfunction(sig = sig, body = body, plugin = plugin, includes = includes, 
       settings = settings, ..., verbose = verbose)
4: 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"), 
       ""))
3: 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)
2: stan_model(file, model_name = model_name, model_code = model_code, 
       stanc_ret = NULL, boost_lib = boost_lib, eigen_lib = eigen_lib, 
       save_dso = save_dso, verbose = verbose)
1: stan(model_code = scode, iter = 10, verbose = TRUE)

ssp3nc3r avatar Jul 10 '20 01:07 ssp3nc3r

Thanks. Try it again after installing the latest commit on GitHub.

On Thu, Jul 9, 2020 at 9:57 PM ssp3nc3r [email protected] wrote:

fit1 <- stan(model_code = scode, iter = 10, verbose = TRUE)

TRANSLATING MODEL 'a156e89b0e786acf24d10fa926f1686f' FROM Stan CODE TO C++ CODE NOW. successful in parsing the Stan model 'a156e89b0e786acf24d10fa926f1686f'. The NEXT version of Stan will not be able to parse your Stan program. Please open an issue at https://github.com/stan-dev/stanc3/issues 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().

Semantic error in 'string', line 2, column 9 to column 10:

Integer literal cannot be larger than 2_147_483_647.

COMPILING THE C++ CODE FOR MODEL 'a156e89b0e786acf24d10fa926f1686f' NOW. OS: x86_64, darwin17.0; rstan: 2.21.2; Rcpp: 1.0.5; inline: 0.3.15 Error in (function (...) : wrong length for argument

traceback() 7: (function (...) { x <- list(...) nm <- names(x) if (is.null(nm) || "" %in% nm) stop("all arguments must be named") .Internal(Sys.setenv(nm, as.character(unlist(x)))) })(PKG_LIBS = " /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/lib//libStanServices.a -L'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/lib/' -lStanHeaders -L'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/lib/' -ltbb -ltbbmalloc -ltbbmalloc_proxy", LOCAL_LIBS = NULL, PKG_CPPFLAGS = " -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include/" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppEigen/include/unsupported" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/BH/include" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/src/" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/include/" -I"/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/include" -DEIGEN_NO_DEBUG -DBOOST_DISABLE_ASSERTS -DBOOST_PENDING_INTEGER_LOG2_HPP -DSTAN_THREADS -DBOOST_NO_AUTO_PTR -include '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/include/stan/math/prim/mat/fun/Eigen.hpp' -D_REENTRANT -DRCPP_PARALLEL_USE_TBB=1 ") 6: do.call(Sys.setenv, env) 5: cxxfunction(sig = sig, body = body, plugin = plugin, includes = includes, settings = settings, ..., verbose = verbose) 4: 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"), "")) 3: 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) 2: stan_model(file, model_name = model_name, model_code = model_code, stanc_ret = NULL, boost_lib = boost_lib, eigen_lib = eigen_lib, save_dso = save_dso, verbose = verbose) 1: stan(model_code = scode, iter = 10, verbose = TRUE)

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/774#issuecomment-656437889, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKUL36ZY4GR4HG35TSLR2ZYR7ANCNFSM4NZ6H4QA .

bgoodri avatar Jul 10 '20 02:07 bgoodri

Works.

ssp3nc3r avatar Jul 10 '20 02:07 ssp3nc3r

When I run this model (from McElreath's Statistical Rethinking book), I get the following error: m12.5 <- map2stan( alist( pulled_left~dbinom(1,p), logit(p) <- a+a_actor[actor]+a_block[block_id]+ (bp+bpc*condition)*prosoc_left, a_actor[actor]~dnorm(0, sigma_actor), a_block[block_id]~dnorm(0, sigma_block), c(a,bp,bpc)~dnorm(0,10), sigma_actor~dcauchy(0,1), sigma_block~dcauchy(0,1) ), data=d, warmup=1000, iter=6000, chains=4, cores=3) 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 https://github.com/stan-dev/stanc3/issues 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().

These are the warnings and errors I receive after running: install.packages("remotes") remotes::install_github("stan-dev/rstan", ref = "develop", subdir = "rstan/rstan")

13 warnings generated. clang++ -mmacosx-version-min=10.13 -std=gnu++14 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/lib -o rstan.so Module.o chains.o init.o misc.o pointer-tools.o sparse_extractors.o stan_fit_base.o stan_fit_rccp.o stanc.o stan/lang/ast_def.o stan/lang/grammars/bare_type_grammar_inst.o stan/lang/grammars/block_var_decls_grammar_inst.o stan/lang/grammars/expression07_grammar_inst.o stan/lang/grammars/expression_grammar_inst.o stan/lang/grammars/functions_grammar_inst.o stan/lang/grammars/indexes_grammar_inst.o stan/lang/grammars/local_var_decls_grammar_inst.o stan/lang/grammars/program_grammar_inst.o stan/lang/grammars/semantic_actions_def.o stan/lang/grammars/statement_2_grammar_inst.o stan/lang/grammars/statement_grammar_inst.o stan/lang/grammars/term_grammar_inst.o stan/lang/grammars/whitespace_grammar_inst.o /Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan/lib//libStanServices.a -L/Library/Frameworks/R.framework/Versions/4.0/Resources/library/StanHeaders/lib/ -lStanHeaders -L/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppParallel/lib/ -ltbb -ltbbmalloc -ltbbmalloc_proxy -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation 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’

  • removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan’
  • restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rstan’ Error: Failed to install 'rstan' from GitHub: (converted from warning) installation of package ‘/var/folders/w_/rd1g_c915gn60lyx4_jddw080000gn/T//RtmpeweiLa/file1898bf854a3/rstan_2.21.2.tar.gz’ had non-zero exit status

4488bayes avatar Jul 14 '20 10:07 4488bayes

I ran

          install.packages("remotes")
          remotes::install_github("stan-dev/rstan", ref = "develop", subdir = "rstan/rstan")

but I am still getting sh: clang++ -mmacosx-version-min=10.13: command not found. @ssp3nc3r how did you get it to work? Help please

SpyderRivera avatar Jul 23 '20 14:07 SpyderRivera

@SpyderRivera sorry you're still getting an error. Which version of R do you have?

jgabry avatar Jul 23 '20 16:07 jgabry

Also, if you're in a bind and need to get a Stan model running from R and RStan won't work, then you could try our new CmdStanR interface, which should work:

http://mc-stan.org/cmdstanr/articles/cmdstanr.html

But we'll also try to help get your RStan working.

jgabry avatar Jul 23 '20 16:07 jgabry

Thank you for the quick response!

version.string R version 4.0.0 (2020-04-24)

SpyderRivera avatar Jul 23 '20 17:07 SpyderRivera

remotes::install_github("stan-dev/rstan", ref = "develop", subdir = "rstan/rstan")

should get it working

On Thu, Jul 23, 2020 at 1:03 PM Stephanie Rivera [email protected] wrote:

Thank you for the quick response!

version.string R version 4.0.0 (2020-04-24)

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/774#issuecomment-663122161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKU3CNTG3ELATUOVY7TR5BUPLANCNFSM4NZ6H4QA .

bgoodri avatar Jul 23 '20 17:07 bgoodri

@bgoodri It looks like @SpyderRivera already tried that (see https://github.com/stan-dev/rstan/issues/774#issuecomment-663044937), and I don't see any changes to the rstan repo since then, so running that again wouldn't change anything, right?

jgabry avatar Jul 23 '20 17:07 jgabry

Removing the old installation, restarting R, and then trying the GitHub install again worked for me. I apologize for not trying that first. Thank you for your help!

SpyderRivera avatar Jul 24 '20 17:07 SpyderRivera

Great, glad it's working for you now!

jgabry avatar Jul 24 '20 18:07 jgabry

Worked for me, too (MacOs High Sierra 10.13.6, R 4.0.2, RStudio 1.3.1056) Perhaps this solution should be part of https://github.com/stan-dev/rstan/wiki/RStan-Getting-Started? There seem to be a lot of posts about the sh: clang++ -mmacosx-version-min=10.13: command not found error.

FWIW I now get a few other messages about files not being found, but the model starts sampling (it didn't before):

clang: error: no such file or directory: 'Sync/_Papers/_Published/2020/XXX' clang: error: no such file or directory: 'phon/STEX' clang: error: cannot specify -o when generating multiple output files

─ Session info ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── setting value version R version 4.0.2 (2020-06-22) os macOS High Sierra 10.13.6 system x86_64, darwin17.0 ui RStudio language (EN) collate en_US.UTF-8 ctype en_US.UTF-8 tz America/New_York date 2020-07-26

─ Packages ────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── package * version date lib source abind 1.4-5 2016-07-21 [1] CRAN (R 4.0.2) assertthat 0.2.1 2019-03-21 [1] CRAN (R 4.0.2) backports 1.1.8 2020-06-17 [1] CRAN (R 4.0.2) base64enc 0.1-3 2015-07-28 [1] CRAN (R 4.0.2) bayesplot 1.7.2 2020-05-28 [1] CRAN (R 4.0.2) blob 1.2.1 2020-01-20 [1] CRAN (R 4.0.2) bridgesampling 1.0-0 2020-02-26 [1] CRAN (R 4.0.2) brms * 2.13.3 2020-07-13 [1] CRAN (R 4.0.2) Brobdingnag 1.2-6 2018-08-13 [1] CRAN (R 4.0.2) broom 0.7.0 2020-07-09 [1] CRAN (R 4.0.2) callr 3.4.3 2020-03-28 [1] CRAN (R 4.0.2) cellranger 1.1.0 2016-07-27 [1] CRAN (R 4.0.2) cli 2.0.2 2020-02-28 [1] CRAN (R 4.0.2) coda 0.19-3 2019-07-05 [1] CRAN (R 4.0.2) codetools 0.2-16 2018-12-24 [1] CRAN (R 4.0.2) colorspace 1.4-1 2019-03-18 [1] CRAN (R 4.0.2) colourpicker 1.0 2017-09-27 [1] CRAN (R 4.0.2) crayon 1.3.4 2017-09-16 [1] CRAN (R 4.0.2) crosstalk 1.1.0.1 2020-03-13 [1] CRAN (R 4.0.2) curl 4.3 2019-12-02 [1] CRAN (R 4.0.1) DBI 1.1.0 2019-12-15 [1] CRAN (R 4.0.2) dbplyr 1.4.4 2020-05-27 [1] CRAN (R 4.0.2) desc 1.2.0 2018-05-01 [1] CRAN (R 4.0.2) devtools * 2.3.1 2020-07-21 [1] CRAN (R 4.0.2) digest 0.6.25 2020-02-23 [1] CRAN (R 4.0.2) dplyr * 1.0.0 2020-05-29 [1] CRAN (R 4.0.2) DT 0.14 2020-06-24 [1] CRAN (R 4.0.2) dygraphs 1.1.1.6 2018-07-11 [1] CRAN (R 4.0.2) ellipsis 0.3.1 2020-05-15 [1] CRAN (R 4.0.2) emmeans 1.4.8 2020-06-26 [1] CRAN (R 4.0.2) estimability 1.3 2018-02-11 [1] CRAN (R 4.0.2) fansi 0.4.1 2020-01-08 [1] CRAN (R 4.0.2) fastmap 1.0.1 2019-10-08 [1] CRAN (R 4.0.2) forcats * 0.5.0 2020-03-01 [1] CRAN (R 4.0.2) fs 1.4.2 2020-06-30 [1] CRAN (R 4.0.2) generics 0.0.2 2018-11-29 [1] CRAN (R 4.0.2) ggplot2 * 3.3.2 2020-06-19 [1] CRAN (R 4.0.2) ggridges 0.5.2 2020-01-12 [1] CRAN (R 4.0.2) glue 1.4.1 2020-05-13 [1] CRAN (R 4.0.2) gridExtra 2.3 2017-09-09 [1] CRAN (R 4.0.2) gtable 0.3.0 2019-03-25 [1] CRAN (R 4.0.2) gtools 3.8.2 2020-03-31 [1] CRAN (R 4.0.2) haven 2.3.1 2020-06-01 [1] CRAN (R 4.0.2) hms 0.5.3 2020-01-08 [1] CRAN (R 4.0.2) htmltools 0.5.0 2020-06-16 [1] CRAN (R 4.0.2) htmlwidgets 1.5.1 2019-10-08 [1] CRAN (R 4.0.2) httpuv 1.5.4 2020-06-06 [1] CRAN (R 4.0.2) httr 1.4.2 2020-07-20 [1] CRAN (R 4.0.2) igraph 1.2.5 2020-03-19 [1] CRAN (R 4.0.2) inline 0.3.15 2018-05-18 [1] CRAN (R 4.0.2) jsonlite 1.7.0 2020-06-25 [1] CRAN (R 4.0.2) later 1.1.0.1 2020-06-05 [1] CRAN (R 4.0.2) lattice 0.20-41 2020-04-02 [1] CRAN (R 4.0.2) lifecycle 0.2.0 2020-03-06 [1] CRAN (R 4.0.2) loo 2.3.1 2020-07-14 [1] CRAN (R 4.0.2) lubridate 1.7.9 2020-06-08 [1] CRAN (R 4.0.2) magrittr * 1.5 2014-11-22 [1] CRAN (R 4.0.2) markdown 1.1 2019-08-07 [1] CRAN (R 4.0.2) MASS 7.3-51.6 2020-04-26 [1] CRAN (R 4.0.2) Matrix 1.2-18 2019-11-27 [1] CRAN (R 4.0.2) matrixStats 0.56.0 2020-03-13 [1] CRAN (R 4.0.2) memoise 1.1.0 2017-04-21 [1] CRAN (R 4.0.2) mime 0.9 2020-02-04 [1] CRAN (R 4.0.2) miniUI 0.1.1.1 2018-05-18 [1] CRAN (R 4.0.2) modelr 0.1.8 2020-05-19 [1] CRAN (R 4.0.2) multcomp 1.4-13 2020-04-08 [1] CRAN (R 4.0.2) munsell 0.5.0 2018-06-12 [1] CRAN (R 4.0.2) mvtnorm 1.1-1 2020-06-09 [1] CRAN (R 4.0.2) nlme 3.1-148 2020-05-24 [1] CRAN (R 4.0.2) packrat 0.5.0 2018-11-14 [1] CRAN (R 4.0.2) pillar 1.4.6 2020-07-10 [1] CRAN (R 4.0.2) pkgbuild 1.1.0 2020-07-13 [1] CRAN (R 4.0.2) pkgconfig 2.0.3 2019-09-22 [1] CRAN (R 4.0.2) pkgload 1.1.0 2020-05-29 [1] CRAN (R 4.0.2) plyr 1.8.6 2020-03-03 [1] CRAN (R 4.0.2) prettyunits 1.1.1 2020-01-24 [1] CRAN (R 4.0.2) processx 3.4.3 2020-07-05 [1] CRAN (R 4.0.2) promises 1.1.1 2020-06-09 [1] CRAN (R 4.0.2) ps 1.3.3 2020-05-08 [1] CRAN (R 4.0.2) purrr * 0.3.4 2020-04-17 [1] CRAN (R 4.0.2) R6 2.4.1 2019-11-12 [1] CRAN (R 4.0.2) Rcpp * 1.0.5 2020-07-06 [1] CRAN (R 4.0.2) RcppParallel 5.0.2 2020-06-24 [1] CRAN (R 4.0.2) readr * 1.3.1 2018-12-21 [1] CRAN (R 4.0.2) readxl 1.3.1 2019-03-13 [1] CRAN (R 4.0.2) remotes 2.2.0 2020-07-21 [1] CRAN (R 4.0.2) reprex 0.3.0 2019-05-16 [1] CRAN (R 4.0.2) reshape2 1.4.4 2020-04-09 [1] CRAN (R 4.0.2) rlang 0.4.7 2020-07-09 [1] CRAN (R 4.0.2) rprojroot 1.3-2 2018-01-03 [1] CRAN (R 4.0.2) rsconnect 0.8.16 2019-12-13 [1] CRAN (R 4.0.2) rstan * 2.21.1 2020-07-08 [1] CRAN (R 4.0.2) rstantools 2.1.1 2020-07-06 [1] CRAN (R 4.0.2) rstudioapi 0.11 2020-02-07 [1] CRAN (R 4.0.2) rvest 0.3.6 2020-07-25 [1] CRAN (R 4.0.2) sandwich 2.5-1 2019-04-06 [1] CRAN (R 4.0.2) scales 1.1.1 2020-05-11 [1] CRAN (R 4.0.2) sessioninfo 1.1.1 2018-11-05 [1] CRAN (R 4.0.2) shiny 1.5.0 2020-06-23 [1] CRAN (R 4.0.2) shinyjs 1.1 2020-01-13 [1] CRAN (R 4.0.2) shinystan 2.5.0 2018-05-01 [1] CRAN (R 4.0.2) shinythemes 1.1.2 2018-11-06 [1] CRAN (R 4.0.2) StanHeaders * 2.21.0-5 2020-06-09 [1] CRAN (R 4.0.2) stringi 1.4.6 2020-02-17 [1] CRAN (R 4.0.2) stringr * 1.4.0 2019-02-10 [1] CRAN (R 4.0.2) survival 3.2-3 2020-06-13 [1] CRAN (R 4.0.2) testthat 2.3.2 2020-03-02 [1] CRAN (R 4.0.2) TH.data 1.0-10 2019-01-21 [1] CRAN (R 4.0.2) threejs 0.3.3 2020-01-21 [1] CRAN (R 4.0.2) tibble * 3.0.3 2020-07-10 [1] CRAN (R 4.0.2) tidyr * 1.1.0 2020-05-20 [1] CRAN (R 4.0.2) tidyselect 1.1.0 2020-05-11 [1] CRAN (R 4.0.2) tidyverse * 1.3.0 2019-11-21 [1] CRAN (R 4.0.2) usethis * 1.6.1 2020-04-29 [1] CRAN (R 4.0.2) V8 3.2.0 2020-06-19 [1] CRAN (R 4.0.2) vctrs 0.3.2 2020-07-15 [1] CRAN (R 4.0.2) withr 2.2.0 2020-04-20 [1] CRAN (R 4.0.2) xml2 1.3.2 2020-04-23 [1] CRAN (R 4.0.2) xtable 1.8-4 2019-04-21 [1] CRAN (R 4.0.2) xts 0.12-0 2020-01-19 [1] CRAN (R 4.0.2) zoo 1.8-8 2020-05-02 [1] CRAN (R 4.0.2)

[1] /Library/Frameworks/R.framework/Versions/4.0/Resources/library

tfjaeger avatar Jul 26 '20 20:07 tfjaeger