Skip to content

Commit

Permalink
add macos_arm64 exe. addresses #208.
Browse files Browse the repository at this point in the history
  • Loading branch information
e-perl-NOAA authored and k-doering-NOAA committed May 24, 2024
1 parent 9472e5a commit 7fa3263
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions R/runSS.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ run_ss_model <- function(dir,
if (os == "unix") {
system(
paste0(
"cd ", dir, ";", paste0(bin, " "),
"sudo chmod a+x ", bin, "; ", "cd ", dir, "; ", paste0(bin, " "),
admb_options
),
ignore.stdout = ignore.stdout, ...
Expand Down Expand Up @@ -119,7 +119,7 @@ get_bin <- function(bin_name = "ss") {
if (.Platform[["OS.type"]] == "windows") {
platform <- "Windows64"
bin_name <- paste0(bin_name, ".exe")
bit <- gsub("\\/", "", Sys.getenv("R_ARCH"))
bit <- R.version$arch
if (grepl("3", bit)) {
if (!grepl("86", bit)) {
platform <- "Windows32"
Expand All @@ -132,17 +132,21 @@ get_bin <- function(bin_name = "ss") {
}
}
} else {
if (substr(R.version[["os"]], 1, 6) == "darwin") {
if (substr(R.version[["os"]], 1, 6) == "darwin" && R.version[["arch"]] == "x86_64") {
platform <- "MacOS"
} else {
if (R.version[["os"]] == "linux-gnu") {
platform <- "Linux64"
if (substr(R.version[["os"]], 1, 6) == "darwin" && R.version[["arch"]] == "aarch64") {
platform <- "MacOS_arm64"
} else {
warning(
"SS3 binary is not available for OS ", R.version[["os"]],
" within the package. You must have an appropriate SS3 binary in your ",
"path. See the ss3sim vignette."
)
if (R.version[["os"]] == "linux-gnu") {
platform <- "Linux64"
} else {
warning(
"SS3 binary is not available for OS ", R.version[["os"]], " ", R.version[["arch"]],
" within the package. You must have an appropriate SS3 binary in your ",
"path. See the ss3sim vignette."
)
}
}
}
}
Expand Down
Binary file added inst/bin/MacOS_arm64/ss
Binary file not shown.

0 comments on commit 7fa3263

Please sign in to comment.