无法在本地服务器上安装rgdal软件包,发生了无法恢复的异常。 R现在正在中止... [错误:加载失败]

时间:2018-04-27 14:34:05

标签: r rgdal

我试图安装Rgdal软件包,所有软件包及其依赖项我已经安装了它们,因为我的服务器处于脱机状态,我很长时间都在努力应对这些依赖项。但现在我觉得我解决了这个问题,但现在我认为我的问题来自R,我甚至无法弄清楚会发生什么。当我在R:

上运行命令namespace MyLibrary { Q_NAMESPACE enum class MYLIBRARYSHARED_EXPORT MyEnumClass { ... }; Q_ENUM_NS(MyEnumClass) ... } // namespace MyLibrary 时,这就是我的直觉
install.packages("rgdal_1.2-15.tar.gz","/usr/lib64/R/library/",repos=NULL,configure.args="--with-proj-include=/usr/proj49/include/")

更新

即使使用较新版本的Rgdal * installing *source* package ‘rgdal’ ... ** package ‘rgdal’ successfully unpacked and MD5 sums checked configure: CC: gcc -m64 -std=gnu99 configure: CXX: g++ -m64 configure: rgdal: 1.2-15 checking for /usr/bin/svnversion... no configure: svn revision: 691 checking for gdal-config... /usr/bin/gdal-config checking gdal-config usability... yes configure: GDAL: 1.8.1 checking GDAL version >= 1.6.3... yes checking gdal: linking with --libs only... yes checking GDAL: /usr/share/gdal/pcs.csv readable... yes configure: -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -I/usr/proj49/include/ checking proj_api.h presence and usability... yes checking PROJ.4 version: ... > 4.8.0 /usr/bin/ld: warning: libproj.so.12, needed by /usr/lib64/libogdi.so.3, may conflict with libproj.so.0 ./configure: line 2112: 27095 Segmentation fault (core dumped) ./proj_conf_test2 checking PROJ.4: epsg found and readable... yes /usr/bin/ld: warning: libproj.so.12, needed by /usr/lib64/libogdi.so.3, may conflict with libproj.so.0 ./configure: line 2187: 27107 Segmentation fault (core dumped) ./proj_conf_test3 checking PROJ.4: conus found and readable... yes configure: Package CPP flags: -I/usr/include/gdal -I/usr/proj49/include/ configure: Package LIBS: -lgdal -lproj configure: creating ./config.status config.status: creating src/Makevars ** libs g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c OGR_write.cpp -o OGR_write.o g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c gdal-bindings.cpp -o gdal-bindings.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c init.c -o init.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c inverser.c -o inverser.o gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c local_stubs.c -o local_stubs.o g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogr_geom.cpp -o ogr_geom.o ogr_geom.cpp: In function ‘SEXPREC* R_OGR_CAPI_features(SEXPREC*, SEXPREC*, SEXPREC*)’: ogr_geom.cpp:39: warning: ‘mp_count_k0’ may be used uninitialized in this function gcc -m64 -std=gnu99 -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fpic -fPIC -c ogr_polygons.c -o ogr_polygons.o g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogr_proj.cpp -o ogr_proj.o g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogrdrivers.cpp -o ogrdrivers.o g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c ogrsource.cpp -o ogrsource.o ogrsource.cpp: In function ‘SEXPREC* ogrReadListColumn(OGRLayer*, SEXPREC*, int, int, int)’: ogrsource.cpp:651: warning: unused variable ‘DINT_MAX’ ogrsource.cpp:652: warning: unused variable ‘DINT_MIN’ g++ -m64 -std=c++0x -I/usr/include/R -DNDEBUG -I/usr/include/gdal -I/usr/proj49/include/ -I/usr/local/include -I"/usr/lib64/R/library/sp/include" -fpic -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -c projectit.cpp -o projectit.o g++ -m64 -std=c++0x -shared -L/usr/lib64/R/lib -o rgdal.so OGR_write.o gdal-bindings.o init.o inverser.o local_stubs.o ogr_geom.o ogr_polygons.o ogr_proj.o ogrdrivers.o ogrsource.o projectit.o -lgdal -lproj -L/usr/lib64/R/lib -lR installing to /usr/lib64/R/library/rgdal/libs ** R ** data ** inst ** preparing package for lazy loading ** help *** installing help indices converting help for package ‘rgdal’ finding HTML links ... done CRS-class html GDALDataset-class html GDALDriver-class html GDALMajorObject-class html GDALRasterBand-class html GDALReadOnlyDataset-class html GDALReadOnlyDataset-methods html GDALTransientDataset-class html GridsDatums html RGB2PCT html SGDF2PCT html SpatialGDAL-class html closeDataset-methods html displayDataset html llgrid html Rd warning: /tmp/RtmpKNPZgP/R.INSTALL68d7595014d0/rgdal/man/llgrid.Rd:11: missing file link ‘Spatial’ Rd warning: /tmp/RtmpKNPZgP/R.INSTALL68d7595014d0/rgdal/man/llgrid.Rd:16: missing file link ‘gridat’ Rd warning: /tmp/RtmpKNPZgP/R.INSTALL68d7595014d0/rgdal/man/llgrid.Rd:17: missing file link ‘gridat’ make_EPSG html nor2k html projInfo html project html readGDAL html Rd warning: /tmp/RtmpKNPZgP/R.INSTALL68d7595014d0/rgdal/man/readGDAL.Rd:136: missing file link ‘flipVertical’ readOGR html showWKT html spTransform-methods html wrappers html writeOGR html ** building package indices ** installing vignettes ** testing if installed package can be loaded sh: line 1: 28842 Segmentation fault (core dumped) '/usr/lib64/R/bin/R' --no-save --slave 2>&1 < '/tmp/RtmpKNPZgP/file68d75bc50ad1' *** caught segfault *** address 0x20, cause 'memory not mapped' Traceback: 1: .Call("PROJ4_proj_def_dat_Installed", PACKAGE = "rgdal") 2: assign("has_proj_def.dat", .Call("PROJ4_proj_def_dat_Installed", PACKAGE = "rgdal"), envir = .RGDAL_CACHE) 3: fun(libname, pkgname) 4: doTryCatch(return(expr), name, parentenv, handler) 5: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 6: tryCatchList(expr, classes, parentenv, handlers) 7: tryCatch(fun(libname, pkgname), error = identity) 8: runHook(".onLoad", env, package.lib, package) 9: loadNamespace(package, lib.loc) 10: doTryCatch(return(expr), name, parentenv, handler) 11: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 12: tryCatchList(expr, classes, parentenv, handlers) 13: 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 = stderr()) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))}) 14: try({ attr(package, "LibPath") <- which.lib.loc ns <- loadNamespace(package, lib.loc) env <- attachNamespace(ns, pos = pos, deps)}) 15: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE) 16: withCallingHandlers(expr, packageStartupMessage = function(c) invokeRestart("muffleMessage")) 17: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)) 18: doTryCatch(return(expr), name, parentenv, handler) 19: tryCatchOne(expr, names, parentenv, handlers[[1L]]) 20: tryCatchList(expr, classes, parentenv, handlers) 21: 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 = stderr()) .Internal(printDeferredWarnings()) } invisible(structure(msg, class = "try-error", condition = e))}) 22: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE))) 23: tools:::.test_load_package("rgdal", "/usr/lib64/R/library") An irrecoverable exception occurred. R is aborting now ... ERROR: loading failed * removing ‘/usr/lib64/R/library/rgdal’ Warning message: In install.packages("rgdal_1.2-15.tar.gz", "/usr/lib64/R/library/", : installation of package ‘rgdal_1.2-15.tar.gz’ had non-zero exit status ,我也会遇到同样的错误

1 个答案:

答案 0 :(得分:1)

请按照以下步骤在RHEL / CentOS 7上安装gdal

wget http://download.osgeo.org/gdal/2.0.1/gdal-2.0.1.tar.gz

./configure

make

make install