Skip to content

Commit 65f0ebe

Browse files
authored
Merge pull request #672 from stan-dev/apple-silicon-error-msg
A better warning message in case of running R inside a Rosetta2 app
2 parents d66fa80 + 02d4dea commit 65f0ebe

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

R/model.R

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -580,6 +580,18 @@ compile <- function(quiet = TRUE,
580580
call. = FALSE
581581
)
582582
}
583+
if (os_is_macos()) {
584+
if (R.version$arch == "aarch64"
585+
&& grepl("but the current translation unit is being compiled for target", x)) {
586+
warning(
587+
"The C++ compiler has errored due to incompatibility between the x86 and ",
588+
"Apple Silicon architectures.\n",
589+
"If you are running R inside an IDE (RStudio, VSCode, ...), ",
590+
"make sure the IDE is a native Apple Silicon app.\n",
591+
call. = FALSE
592+
)
593+
}
594+
}
583595
},
584596
error_on_status = FALSE
585597
)

0 commit comments

Comments
 (0)