[R-SIG-Mac] Issue installing units package after updating R to 4.4

Duncan Murdoch murdoch@dunc@n @end|ng |rom gm@||@com
Tue Jul 9 19:12:54 CEST 2024


How did you install R?  You have a lot of homebrew references in the log 
below.

It appears you installed R from homebrew, so you probably need to 
install all packages from homebrew (or from source, using homebrew 
tools).  Note that CRAN doesn't support homebrew installs.

I'd recommend that you install R from CRAN instead, and if necessary 
follow the instructions on https://mac.r-project.org/bin/ to get extra 
libs like udunits.

Duncan Murdoch

On 2024-07-09 7:56 a.m., Jacob Howard Ph.D. wrote:
> Hello all, I am running the R 4.4 on an M2 mac chip. Since updating R to 4.4 I have not been able to install the R units package, which is needed to install the sf package. I am hoping someone here can point out something silly I have done to help here. Thanks in advance.
> 
> To resolve the issue I have tried:
> 
>    *   install.packages(�units�)
>    *   install.packages("units", configure.args = c("--with-udunits2-include=/opt/homebrew/Cellar/udunits/2.2.28/include", "--with-udunits2-lib=/opt/homebrew/Cellar/udunits/2.2.28/lib"))
>    *   reinstalling udunits
>    *   reinstalling r
>    *   running with my normal as well as with a blank MAKEVARS file.
> 
> The same error results each time and is copied below:
> 
> Installing package into �/opt/homebrew/lib/R/4.4/site-library�
> (as �lib� is unspecified)
> * installing *source* package �units� ...
> ** using staged installation
> configure: units: 0.8-5
> checking whether the C++ compiler works... yes
> checking for C++ compiler default output file name... a.out
> checking for suffix of executables...
> checking whether we are cross compiling... no
> checking for suffix of object files... o
> checking whether the compiler supports GNU C++... yes
> checking whether /opt/homebrew/bin/ccache /opt/homebrew/opt/llvm/bin/clang++ accepts -g... yes
> checking for /opt/homebrew/bin/ccache /opt/homebrew/opt/llvm/bin/clang++ option to enable C++11 features... none needed
> checking for stdio.h... yes
> checking for stdlib.h... yes
> checking for string.h... yes
> checking for inttypes.h... yes
> checking for stdint.h... yes
> checking for strings.h... yes
> checking for sys/stat.h... yes
> checking for sys/types.h... yes
> checking for unistd.h... yes
> checking for _Bool... no
> checking for stdbool.h that conforms to C99... yes
> checking for error_at_line... no
> checking for gcc... /opt/homebrew/bin/ccache /opt/homebrew/opt/llvm/bin/clang
> checking whether the compiler supports GNU C... yes
> checking whether /opt/homebrew/bin/ccache /opt/homebrew/opt/llvm/bin/clang accepts -g... yes
> checking for /opt/homebrew/bin/ccache /opt/homebrew/opt/llvm/bin/clang option to enable C11 features... none needed
> checking for XML_ParserCreate in -lexpat... yes
> checking for udunits2.h... yes
> checking for ut_read_xml in -ludunits2... yes
> configure: creating ./config.status
> config.status: creating src/Makevars
> ** libs
> using C++ compiler: �Homebrew clang version 18.1.6�
> using SDK: �MacOSX14.4.sdk�
> /opt/homebrew/bin/ccache /opt/homebrew/opt/llvm/bin/clang++ -I"/opt/homebrew/Cellar/r/4.4.0_1/lib/R/include" -DNDEBUG -DUDUNITS2_DIR=0   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/homebrew/include -I/opt/homebrew/opt/llvm/include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/tcl-tk/include -I'/opt/homebrew/lib/R/4.4/site-library/Rcpp/include' -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/homebrew/include -I/opt/homebrew/opt/llvm/include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/tcl-tk/include    -fPIC  -g -O3 -Wall -pedantic -mtune=native -pipe  -c RcppExports.cpp -o RcppExports.o
> /opt/homebrew/bin/ccache /opt/homebrew/opt/llvm/bin/clang++ -I"/opt/homebrew/Cellar/r/4.4.0_1/lib/R/include" -DNDEBUG -DUDUNITS2_DIR=0   -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/homebrew/include -I/opt/homebrew/opt/llvm/include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/tcl-tk/include -I'/opt/homebrew/lib/R/4.4/site-library/Rcpp/include' -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -I/opt/homebrew/include -I/opt/homebrew/opt/llvm/include -I/opt/homebrew/opt/openssl/include -I/opt/homebrew/opt/gettext/include -I/opt/homebrew/opt/tcl-tk/include    -fPIC  -g -O3 -Wall -pedantic -mtune=native -pipe  -c udunits.cpp -o udunits.o
> /opt/homebrew/bin/ccache /opt/homebrew/opt/llvm/bin/clang++ -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -L/opt/homebrew/Cellar/r/4.4.0_1/lib/R/lib -L/opt/homebrew/opt/gettext/lib -L/opt/homebrew/opt/readline/lib -L/opt/homebrew/opt/xz/lib -L/opt/homebrew/lib -L/opt/homebrew/opt/llvm/lib -Wl,-rpath,/opt/homebrew/opt/llvm/lib -o units.so RcppExports.o udunits.o -lexpat -lexpat -ludunits2 -L/opt/homebrew/Cellar/r/4.4.0_1/lib/R/lib -lR -lintl -Wl,-framework -Wl,CoreFoundation
> ld: warning: ignoring duplicate libraries: '-lexpat'
> ld: warning: reexported library with install name '/opt/homebrew/opt/llvm/lib/libunwind.1.dylib' found at '/opt/homebrew/Cellar/llvm/18.1.6/lib/libunwind.1.0.dylib' couldn't be matched with any parent library and will be linked directly
> installing to /opt/homebrew/lib/R/4.4/site-library/00LOCK-units/00new/units/libs
> ** R
> ** demo
> ** inst
> ** byte-compile and prepare package for lazy loading
> ** help
> *** installing help indices
> ** building package indices
> ** installing vignettes
> ** testing if installed package can be loaded from temporary location
> sh: line 1: 53460 Bus error: 10           R_TESTS= '/opt/homebrew/Cellar/r/4.4.0_1/lib/R/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/q_/0m_xd5dd1qlcshyjbgnzrw9w0000gp/T//Rtmpu95vVt/filec9f5215fbb15'
> 
> *** caught bus error ***
> address 0x0, cause 'invalid alignment'
> 
> 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(package, lib.loc)
> 15: doTryCatch(return(expr), name, parentenv, handler)
> 16: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> 17: tryCatchList(expr, classes, parentenv, handlers)
> 18: 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)})
> 19: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)
> 20: withCallingHandlers(expr, packageStartupMessage = function(c) tryInvokeRestart("muffleMessage"))
> 21: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE))
> 22: doTryCatch(return(expr), name, parentenv, handler)
> 23: tryCatchOne(expr, names, parentenv, handlers[[1L]])
> 24: tryCatchList(expr, classes, parentenv, handlers)
> 25: 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))})
> 26: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib,     character.only = TRUE, logical.return = TRUE)))
> 27: tools:::.test_load_package("units", "/opt/homebrew/lib/R/4.4/site-library/00LOCK-units/00new")
> An irrecoverable exception occurred. R is aborting now ...
> ERROR: loading failed
> * removing �/opt/homebrew/lib/R/4.4/site-library/units�
> 
> 	[[alternative HTML version deleted]]
> 
> 
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac using r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac



More information about the R-SIG-Mac mailing list