问题描述
我使用 R 3.4.4 和 Ubuntu 16.04 并遵循 gert 安装说明 here。我已经安装了 libgit2-dev,但 gert 安装崩溃并出现以下错误:
** testing if installed package can be loaded
*** caught illegal operation ***
address 0x7fbf6f06b405,cause 'illegal operand'
Traceback:
1: .Call(R_git_config_list,NULL)
2: git_config_global()
3: doTryCatch(return(expr),name,parentenv,handler)
4: tryCatchOne(expr,names,handlers[[1L]])
5: tryCatchList(expr,classes,handlers)
6: 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)[1L] prefix <- paste("Error in",dcall,": ") LONG <- 75L msg <- conditionMessage(e) sm <- strsplit(msg,"\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 && identical(getoption("show.error.messages"),TRUE)) { cat(msg,file = outFile) .Internal(printDeferredWarnings()) } invisible(structure(msg,class = "try-error",condition = e))})
7: try({ settings <- git_config_global() name <- subset(settings,name == "user.name")$value email <- subset(settings,name == "user.email")$value if (length(name) || length(email)) { packageStartupInform("Default user: %s <%s>",as_string(name),as_string(email)) } else { packageStartupInform("No default user configured") }})
8: fun(libname,pkgname)
9: doTryCatch(return(expr),handler)
10: tryCatchOne(expr,handlers[[1L]])
11: tryCatchList(expr,handlers)
12: tryCatch(fun(libname,pkgname),error = identity)
13: runHook(".onAttach",ns,dirname(nspath),nsname)
14: attachNamespace(ns,pos = pos,deps)
15: doTryCatch(return(expr),handler)
16: tryCatchOne(expr,handlers[[1L]])
17: tryCatchList(expr,handlers)
18: tryCatch({ attr(package,"LibPath") <- which.lib.loc ns <- loadNamespace(package,lib.loc) env <- attachNamespace(ns,deps)},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) 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) invokeRestart("muffleMessage"))
21: suppresspackageStartupMessages(library(pkg_name,logical.return = TRUE))
22: doTryCatch(return(expr),handler)
23: tryCatchOne(expr,handlers[[1L]])
24: tryCatchList(expr,handlers)
25: tryCatch(expr,condition = e))})
26: try(suppresspackageStartupMessages(library(pkg_name,logical.return = TRUE)))
27: tools:::.test_load_package("gert","/home/viktoriya/R/x86_64-pc-linux-gnu-library/3.4")
An irrecoverable exception occurred. R is aborting Now ...
Illegal instruction (core dumped)
ERROR: loading Failed
请帮忙。
解决方法
我遇到了同样的问题,这为我解决了。试试
Sys.setenv(USE_SYSTEM_LIBGIT2=1)
install.packages("gert")