stan-dev / stan-dev/rstan

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

Open
#915 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
1.1k
Forks
266
Avg merge
2h 56m
Merged PRs (30d)
1

Description

Summary:

Having installed rstan on macbook air 2020 and testing the example schools.stan example in the installation guide.
gives me:

Description:
fit <- stan(file = 'schools.stan', data = schools_dat)
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().
Warning messages:
1: In system2(CXX, args = ARGS) : error in running command
2: In file.remove(c(unprocessed, processed)) :
  cannot remove file '/var/folders/r6/qhphq41s769bj5w1_140_lr40000gn/T//RtmpvcqDc4/file350b138129b2.stan', reason 'No such file or directory'
3: There were 4 divergent transitions after warmup. Increasing adapt_delta above 0.8 may help. See
http://mc-stan.org/misc/warnings.html#divergent-transitions-after-warmup 
4: Examine the pairs() plot to diagnose sampling problems
Reproducible Steps:
dotR <- file.path(Sys.getenv("HOME"), ".R")
if (!file.exists(dotR)) dir.create(dotR)
M <- file.path(dotR, "Makevars")
if (!file.exists(M)) file.create(M)
cat("\nCXX14FLAGS += -O3 -mtune=native -arch x86_64 -ftemplate-depth-256",
    file = M, sep = "\n", append = FALSE)
Sys.setenv(DOWNLOAD_STATIC_LIBV8 = 1) # only necessary for Linux without the nodejs library / headers
install.packages("rstan", repos = "https://cloud.r-project.org/", dependencies = TRUE)

example(stan_model, package = "rstan", run.dontrun = TRUE)
   Warning messages:
   1: In system2(CXX, args = ARGS) : error in running command
  2: In file.remove(c(unprocessed, processed)) :
       cannot remove file '/var/folders/r6/qhphq41s769bj5w1_140_lr40000gn/T//RtmpvcqDc4/file350b22886706.stan', reason 
        'No such file or directory'

library(rstan)
options(mc.cores = parallel::detectCores())
rstan_options(auto_write = TRUE)
schools_dat <- list(J = 8,
y = c(28,  8, -3,  7, -1,  1, 18, 12),
sigma = c(15, 10, 16, 11,  9, 11, 10, 18))
fit <- stan(file = 'schools.stan', data = schools_dat)


Current Output:

If applicable, any relevant output from RStan.

Expected Output:

If applicable, the output you expected from RStan.

RStan Version:

rstan 2.21.1

R Version:

R version 4.0.4 (2021-02-15)

Operating System:

OS X 11.0.1

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the schools.stan example with rstan 2.21.1, R 4.0.4, and macOS 11.0.1, then inspect the compiler configuration involved in the reported clang++ command. Done means the example no longer reports that clang++ cannot be found and the resulting compilation behavior is documented or corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, macos, r
Domain
build-system, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.