r - 从源代码编译 R 包的多个不同错误
问题描述
我在从源代码编译某些包时遇到问题。在我发现的几种情况下,我遇到了不同的错误。简而言之,完整的打印输出在这篇文章的末尾:
#1
** testing if installed package can be loaded from temporary location
sh: line 1: 69462 Segmentation fault: 11 R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/5_/l71sk6kn29z17n011g8kld5m0000gp/T//Rtmp3WutjJ/file10e7f1b64a0fb'
*** caught segfault ***
address 0x30, cause 'memory not mapped'
#2
** testing if installed package can be loaded from temporary location
sh: line 1: 69665 Abort trap: 6 R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/5_/l71sk6kn29z17n011g8kld5m0000gp/T//Rtmp93p6kU/file10fc52393e443'
ERROR: loading failed
#3
-L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
installing to /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs
(some code removed)
Error: package or namespace load failed for ‘RcppArmadillo’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so, 6): Symbol not found: __ZNKSt13random_device13_M_getentropyEv
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so
Expected in: flat namespace
in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so
Error: loading failed
Execution halted
ERROR: loading failed
到目前为止,我大致按以下顺序尝试了以下操作:
- 升级到 R 4.x
- 从 gcc 9.x 退回到 8.x(并更新了 .R/Makevars)
- 升级了所有自制软件包
- 按照这个建议的修复(https://medium.com/@micheleberardi/python-abort-trap-6-fix-after-catalina-update-c20fde9fe6d1)将链接未版本化的dylib文件复制到dylibs
- 安装了建议工具:clang 8.0、gfortran 6.2
- 打开 Xcode 安装“组件”
- 验证是否安装了 Xcode 命令行工具
- 安装 GNU Fortran 8.2
我正在运行 OSX 10.15.5、R 4.0.2
以下是每个失败编译的完整详细信息:
> devtools::install_github("tylermorganwall/rayshader")
Using github PAT from envvar GITHUB_PAT
Downloading GitHub repo tylermorganwall/rayshader@master
* installing *source* package ‘rayshader’ ...
** using staged installation
** libs
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c bilineargrid.cpp -o bilineargrid.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c calculate_normal.cpp -o calculate_normal.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c construct_matrix.cpp -o construct_matrix.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c find_groups.cpp -o find_groups.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c interpolate_color.cpp -o interpolate_color.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c lambshade.cpp -o lambshade.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c make_base_cpp.cpp -o make_base_cpp.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c pointspread.cpp -o pointspread.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c rayshade.cpp -o rayshade.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/progress/include' -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo/include' -I/usr/local/include -fPIC -Wall -g -O2 -c rayshade_multicore.cpp -o rayshade_multicore.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/Cellar/gcc@8/8.4.0_1/lib -o rayshader.so RcppExports.o bilineargrid.o calculate_normal.o construct_matrix.o find_groups.o interpolate_color.o lambshade.o make_base_cpp.o pointspread.o rayshade.o rayshade_multicore.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-rayshader/00new/rayshader/libs
** R
** data
*** moving datasets to lazyload DB
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
sh: line 1: 69665 Abort trap: 6 R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/5_/l71sk6kn29z17n011g8kld5m0000gp/T//Rtmp93p6kU/file10fc52393e443'
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/rayshader’
Error: Failed to install 'rayshader' from GitHub:
(converted from warning) installation of package ‘/var/folders/5_/l71sk6kn29z17n011g8kld5m0000gp/T//Rtmpm4EPFO/file10f73164c94ba/rayshader_0.19.1.tar.gz’ had non-zero exit status
> install.packages("RcppArmadillo")
There is a binary version available but the source version is later:
binary source needs_compilation
RcppArmadillo 0.9.900.1.0 0.9.900.2.0 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) y
installing the source package ‘RcppArmadillo’
trying URL 'https://cran.rstudio.com/src/contrib/RcppArmadillo_0.9.900.2.0.tar.gz'
Content type 'application/x-gzip' length 1645254 bytes (1.6 MB)
==================================================
downloaded 1.6 MB
* installing *source* package ‘RcppArmadillo’ ...
** package ‘RcppArmadillo’ successfully unpacked and MD5 sums checked
** using staged installation
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 we are using the GNU C++ compiler... yes
checking whether /usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 accepts -g... yes
checking how to run the C++ preprocessor... /usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -E
checking whether we are using the GNU C++ compiler... (cached) yes
checking whether /usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 accepts -g... (cached) yes
checking whether we have a suitable tempdir... /var/folders/5_/l71sk6kn29z17n011g8kld5m0000gp/T
checking whether R CMD SHLIB can already compile programs using OpenMP... yes
checking LAPACK_LIBS... R-supplied partial LAPACK found
configure: WARNING: Some complex-valued LAPACK functions may not be available
configure: creating ./config.status
config.status: creating inst/include/RcppArmadilloConfigGenerated.h
config.status: creating src/Makevars
** libs
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -I../inst/include -fPIC -Wall -g -O2 -c RcppArmadillo.cpp -o RcppArmadillo.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -I../inst/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -I../inst/include -fPIC -Wall -g -O2 -c fastLm.cpp -o fastLm.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/Cellar/gcc@8/8.4.0_1/lib -o RcppArmadillo.so RcppArmadillo.o RcppExports.o fastLm.o -L/Library/Frameworks/R.framework/Resources/lib -lRlapack -L/Library/Frameworks/R.framework/Resources/lib -lRblas -L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0 -L/usr/local/gfortran/lib -lgfortran -lquadmath -lm -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
ld: warning: directory not found for option '-L/usr/local/gfortran/lib/gcc/x86_64-apple-darwin18/8.2.0'
installing to /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs
** R
** 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
Error: package or namespace load failed for ‘RcppArmadillo’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so, 6): Symbol not found: __ZNKSt13random_device13_M_getentropyEv
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so
Expected in: flat namespace
in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-RcppArmadillo/00new/RcppArmadillo/libs/RcppArmadillo.so
Error: loading failed
Execution halted
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/RcppArmadillo’
Warning in install.packages :
installation of package ‘RcppArmadillo’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/5_/l71sk6kn29z17n011g8kld5m0000gp/T/Rtmpm4EPFO/downloaded_packages’
> install.packages("raster")
There is a binary version available but the source version is later:
binary source needs_compilation
raster 3.3-7 3.3-13 TRUE
Do you want to install from sources the package which needs compilation? (Yes/no/cancel) y
installing the source package ‘raster’
* installing *source* package ‘raster’ ...
** package ‘raster’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c RasterModule.cpp -o RasterModule.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c RcppExports.cpp -o RcppExports.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c aggregate.cpp -o aggregate.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c area.cpp -o area.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c bilinear.cpp -o bilinear.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c broom.cpp -o broom.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c cellRowCol.cpp -o cellRowCol.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c clamp.cpp -o clamp.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c distance.cpp -o distance.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c edge.cpp -o edge.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c focal_fun.cpp -o focal_fun.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c focal_get.cpp -o focal_get.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c focal_sum.cpp -o focal_sum.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/gcc-8 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c geodesic.c -o geodesic.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c getPolygons.cpp -o getPolygons.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c layerize.cpp -o layerize.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c memory.cpp -o memory.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c modal.cpp -o modal.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c ppmin.cpp -o ppmin.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c raster_aggregate.cpp -o raster_aggregate.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c raster_distance.cpp -o raster_distance.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c rasterize.cpp -o rasterize.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c reclass.cpp -o reclass.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c terrain.cpp -o terrain.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c util.cpp -o util.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -I"/Library/Frameworks/R.framework/Resources/include" -DNDEBUG -I'/Library/Frameworks/R.framework/Versions/4.0/Resources/library/Rcpp/include' -I/usr/local/include -fPIC -Wall -g -O2 -c xyCell.cpp -o xyCell.o
/usr/local/Cellar/gcc@8/8.4.0_1/bin/g++-8 -std=gnu++11 -dynamiclib -Wl,-headerpad_max_install_names -undefined dynamic_lookup -single_module -multiply_defined suppress -L/Library/Frameworks/R.framework/Resources/lib -L/usr/local/Cellar/gcc@8/8.4.0_1/lib -o raster.so RasterModule.o RcppExports.o aggregate.o area.o bilinear.o broom.o cellRowCol.o clamp.o distance.o edge.o focal_fun.o focal_get.o focal_sum.o geodesic.o getPolygons.o layerize.o memory.o modal.o ppmin.o raster_aggregate.o raster_distance.o rasterize.o reclass.o terrain.o util.o xyCell.o -F/Library/Frameworks/R.framework/.. -framework R -Wl,-framework -Wl,CoreFoundation
installing to /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-raster/00new/raster/libs
** R
** inst
** byte-compile and prepare package for lazy loading
in method for ‘brick’ with signature ‘x="kasc"’: no definition for class “kasc”
in method for ‘brick’ with signature ‘x="grf"’: no definition for class “grf”
in method for ‘brick’ with signature ‘x="SpatRaster"’: no definition for class “SpatRaster”
in method for ‘coerce’ with signature ‘"STFDF","RasterBrick"’: no definition for class “STFDF”
in method for ‘coerce’ with signature ‘"STSDF","RasterBrick"’: no definition for class “STSDF”
in method for ‘coerce’ with signature ‘"asc","RasterLayer"’: no definition for class “asc”
in method for ‘coerce’ with signature ‘"RasterLayer","asc"’: no definition for class “asc”
in method for ‘coerce’ with signature ‘"kasc","RasterBrick"’: no definition for class “kasc”
in method for ‘coerce’ with signature ‘"kasc","RasterStack"’: no definition for class “kasc”
in method for ‘coerce’ with signature ‘"kde","RasterLayer"’: no definition for class “kde”
in method for ‘coerce’ with signature ‘"grf","RasterBrick"’: no definition for class “grf”
in method for ‘coerce’ with signature ‘"grf","RasterLayer"’: no definition for class “grf”
Creating a generic function for ‘ncol’ from package ‘base’ in package ‘raster’
in method for ‘extent’ with signature ‘x="sf"’: no definition for class “sf”
in method for ‘extract’ with signature ‘x="Raster",y="sf"’: no definition for class “sf”
in method for ‘mask’ with signature ‘x="Raster",mask="sf"’: no definition for class “sf”
in method for ‘raster’ with signature ‘x="sf"’: no definition for class “sf”
in method for ‘raster’ with signature ‘x="kasc"’: no definition for class “kasc”
in method for ‘raster’ with signature ‘x="asc"’: no definition for class “asc”
in method for ‘raster’ with signature ‘x="kde"’: no definition for class “kde”
in method for ‘raster’ with signature ‘x="grf"’: no definition for class “grf”
in method for ‘raster’ with signature ‘x="SpatRaster"’: no definition for class “SpatRaster”
in method for ‘rasterize’ with signature ‘x="sf",y="Raster"’: no definition for class “sf”
Creating a generic function for ‘rowSums’ from package ‘base’ in package ‘raster’
Creating a generic function for ‘colSums’ from package ‘base’ in package ‘raster’
in method for ‘setValues’ with signature ‘x="RasterLayerSparse"’: no definition for class “RasterLayerSparse”
in method for ‘spplot’ with signature ‘obj="SpatRaster"’: no definition for class “SpatRaster”
in method for ‘spplot’ with signature ‘obj="SpatVector"’: no definition for class “SpatVector”
in method for ‘stack’ with signature ‘x="kasc"’: no definition for class “kasc”
in method for ‘stack’ with signature ‘x="SpatRaster"’: no definition for class “SpatRaster”
** help
*** installing help indices
** building package indices
** testing if installed package can be loaded from temporary location
sh: line 1: 69462 Segmentation fault: 11 R_TESTS= '/Library/Frameworks/R.framework/Resources/bin/R' --no-save --no-restore --no-echo 2>&1 < '/var/folders/5_/l71sk6kn29z17n011g8kld5m0000gp/T//Rtmp3WutjJ/file10e7f1b64a0fb'
*** caught segfault ***
address 0x30, cause 'memory not mapped'
Traceback:
1: Module(module, mustStart = TRUE, where = env)
2: doTryCatch(return(expr), name, parentenv, handler)
3: tryCatchOne(expr, names, parentenv, handlers[[1L]])
4: tryCatchList(expr, classes, parentenv, handlers)
5: tryCatch(Module(module, mustStart = TRUE, where = env), error = function(e) e)
6: loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE)
7: (function (ns) loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE))(<environment>)
8: doTryCatch(return(expr), name, parentenv, handler)
9: tryCatchOne(expr, names, parentenv, handlers[[1L]])
10: tryCatchList(expr, classes, parentenv, handlers)
11: tryCatch((function (ns) loadModule(module = "spmod", what = TRUE, env = ns, loadNow = TRUE))(<environment>), error = function(e) e)
12: eval(substitute(tryCatch(FUN(WHERE), error = function(e) e), list(FUN = f, WHERE = where)), where)
13: eval(substitute(tryCatch(FUN(WHERE), error = function(e) e), list(FUN = f, WHERE = where)), where)
14: .doLoadActions(where, attach)
15: methods::cacheMetaData(ns, TRUE, ns)
16: loadNamespace(package, lib.loc)
17: doTryCatch(return(expr), name, parentenv, handler)
18: tryCatchOne(expr, names, parentenv, handlers[[1L]])
19: tryCatchList(expr, classes, parentenv, handlers)
20: 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) message(paste("Error:", msg), domain = NA) else stop(msg, call. = FALSE, domain = NA)})
21: library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)
22: withCallingHandlers(expr, packageStartupMessage = function(c) tryInvokeRestart("muffleMessage"))
23: suppressPackageStartupMessages(library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE))
24: doTryCatch(return(expr), name, parentenv, handler)
25: tryCatchOne(expr, names, parentenv, handlers[[1L]])
26: tryCatchList(expr, classes, parentenv, handlers)
27: 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 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))})
28: try(suppressPackageStartupMessages(library(pkg_name, lib.loc = lib, character.only = TRUE, logical.return = TRUE)))
29: tools:::.test_load_package("raster", "/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-raster/00new")
An irrecoverable exception occurred. R is aborting now ...
ERROR: loading failed
* removing ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/raster’
* restoring previous ‘/Library/Frameworks/R.framework/Versions/4.0/Resources/library/raster’
Warning in install.packages :
installation of package ‘raster’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/5_/l71sk6kn29z17n011g8kld5m0000gp/T/RtmpB8DDq4/downloaded_packages’
解决方案
尝试在开发者版本上安装 RccpArmadillo
install.packages("https://cran.r-project.org/src/contrib/Archive/RcppArmadillo/RcppArmadillo_0.9.900.3.0.tar.gz",
repos=NULL,
type="source")
推荐阅读
- python - Instagram 无法从 AWS 和 DigitalOcean 登录
- ios - 如何使用realm保存NSURL数组?
- c# - 表中的简单 where 语句需要一个小时
- dart - 如何在颤动中将图像转换为base64图像?
- java - 如何从viewpageradpater“连续”更新片段的textview?viewpager适配器在主片段中
- http - katalon自动化记录器可以用来操作http post参数吗
- ios - 需要帮助在自定义单元格中设置 UISwitch(XIB、Swift 4、Xcode 9)
- c# - 左右 DTO 到对象 AutoMapper-C#
- scala - 如何将覆盖方法存储在Scala中的变量中
- twitter-bootstrap-3 - Bootstrap 单选按钮在选择时会发生变化