sf icon indicating copy to clipboard operation
sf copied to clipboard

sf installs but crashes/bombs R

Open almccombs opened this issue 3 years ago • 1 comments

I'm trying to install sf on a Mac M1, using the standard install.packages("sf"). I've tried in RStudio, R command line, and R running in terminal. RStudio: package installs but RStudio bombs when I library(sf) R command line: package installs but R crashes when I library(sf) with the output I'll paste at bottom R in terminal: package installs with the following message, but crashes R when I library(sf) with the same output as R command line.

install.packages("sf") trying URL 'https://cloud.r-project.org/bin/macosx/big-sur-arm64/contrib/4.2/sf_1.0-8.tgz' Content type 'application/x-gzip' length 96526155 bytes (92.1 MB) ================================================== downloaded 92.1 MB The downloaded binary packages are in /var/folders/cd/3px9c21d3598stsvhw3bbwbc003wk4/T//RtmpKFDeMW/downloaded_packages Warning message: In doTryCatch(return(expr), name, parentenv, handler) : unable to load shared object '/Library/Frameworks/R.framework/Resources/modules//R_X11.so': dlopen(/Library/Frameworks/R.framework/Resources/modules//R_X11.so, 0x0006): Library not loaded: '/opt/X11/lib/libSM.6.dylib' Referenced from: '/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/modules/R_X11.so' Reason: tried: '/opt/X11/lib/libSM.6.dylib' (no such file), '/Library/Frameworks/R.framework/Resources/lib/libSM.6.dylib' (no such file), '/Library/Java/JavaVirtualMachines/jdk-17.0.1+12/Contents/Home/lib/server/libSM.6.dylib' (no such file)

Session info

R version 4.2.1 (2022-06-23) Platform: aarch64-apple-darwin20 (64-bit) Running under: macOS Monterey 12.5.1

Matrix products: default BLAS: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRblas.0.dylib LAPACK: /Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/lib/libRlapack.dylib

locale: [1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages: [1] stats graphics grDevices utils datasets methods base

loaded via a namespace (and not attached): [1] compiler_4.2.1 tools_4.2.1

Output from R command line:

> install.packages("sf") --- Please select a CRAN mirror for use in this session --- trying URL 'https://cloud.r-project.org/bin/macosx/big-sur-arm64/contrib/4.2/sf_1.0-8.tgz' Content type 'application/x-gzip' length 96526155 bytes (92.1 MB) ================================================== downloaded 92.1 MB

The downloaded binary packages are in /var/folders/cd/3px9c21d3598stsvhw3bbwbc003wk4/T//Rtmpss8Piy/downloaded_packages

library(sf)

*** caught segfault *** address 0x653970706352344e, cause 'invalid permissions'

Traceback: 1: R_ut_parse(u) 2: doTryCatch(return(expr), name, parentenv, handler) 3: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 4: tryCatchList(expr, classes, parentenv, handlers) 5: tryCatch(expr, error = function(e) { call <- conditionCall(e) if (!is.null(call)) { if (identical(call[[1L]], quote(doTryCatch))) call <- sys.call(-4L) dcall <- deparse(call, nlines = 1L) prefix <- paste("Error in", dcall, ": ") LONG <- 75L sm <- strsplit(conditionMessage(e), "\n")[[1L]] w <- 14L + nchar(dcall, type = "w") + nchar(sm[1L], type = "w") if (is.na(w)) w <- 14L + nchar(dcall, type = "b") + nchar(sm[1L], type = "b") if (w > LONG) prefix <- paste0(prefix, "\n ") } else prefix <- "Error : " msg <- paste0(prefix, conditionMessage(e), "\n") .Internal(seterrmessage(msg[1L])) if (!silent && isTRUE(getOption("show.error.messages"))) { cat(msg, file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))}) 6: try(R_ut_parse(u), silent = TRUE) 7: ud_is_parseable("B") 8: fun(libname, pkgname) 9: doTryCatch(return(expr), name, parentenv, handler) 10: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 11: tryCatchList(expr, classes, parentenv, handlers) 12: tryCatch(fun(libname, pkgname), error = identity) 13: runHook(".onLoad", env, package.lib, package) 14: loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) 15: asNamespace(ns) 16: namespaceImportFrom(ns, loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]), i[[2L]], from = package) 17: loadNamespace(package, lib.loc) 18: doTryCatch(return(expr), name, parentenv, handler) 19: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 20: tryCatchList(expr, classes, parentenv, handlers) 21: tryCatch({ attr(package, "LibPath") <- which.lib.loc ns <- loadNamespace(package, lib.loc) env <- attachNamespace(ns, pos = pos, deps, exclude, include.only)}, error = function(e) { P <- if (!is.null(cc <- conditionCall(e))) paste(" in", deparse(cc)[1L]) else "" msg <- gettextf("package or namespace load failed for %s%s:\n %s", sQuote(package), P, conditionMessage(e)) if (logical.return && !quietly) message(paste("Error:", msg), domain = NA) else stop(msg, call. = FALSE, domain = NA)}) 22: library(sf)

Possible actions: 1: abort (with core dump, if enabled) 2: normal R exit 3: exit R without saving workspace 4: exit R saving workspace

almccombs avatar Sep 12 '22 01:09 almccombs

Is this relevant:

Note: the use of X11 (including tcltk) requires XQuartz (version 2.8.1 or later). Always re-install XQuartz when upgrading your macOS to a new major version.

https://cran.r-project.org/bin/macosx/

rsbivand avatar Sep 13 '22 14:09 rsbivand