Skip to content

Commit d4a0dda

Browse files
committed
catch the x86 and aarch64 error and output a better warning
1 parent 63775ae commit d4a0dda

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)