is_mac_arm64 <- function() {
sys_info <- Sys.info()
sys_info[["sysname"]] == "Darwin" &&
sys_info[["machine"]] == "arm64"
}
if (is_mac_arm64()) {
msg <- cli::format_error(
c(
"{.pkg greta} does not currently work with Apple Silicon (M1)",
"We are working on getting this resolved ASAP, see {.url https://github.com/greta-dev/greta/issues/458} for more details"
)
)
stop(
msg,
call. = FALSE
)
}
e.g., (from https://github.com/rstudio/tensorflow/blob/701d402efa78fea25c95c1b3394c22b27aabd466/R/utils.R#L3-L34)