greta-dev / greta

simple and scalable statistical modelling in R
https://greta-stats.org
Other
531 stars 63 forks source link

Identify if OS is using M1 macs and break the news #487

Closed njtierney closed 2 years ago

njtierney commented 2 years ago

e.g., (from https://github.com/rstudio/tensorflow/blob/701d402efa78fea25c95c1b3394c22b27aabd466/R/utils.R#L3-L34)

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
  )

}