无法安装 R 依赖项,大量错误

时间:2021-03-08 20:46:25

标签: r package

我在 Ubuntu 18.04.5 LTS 下的 Rstudio 1.4.1106 中运行 R 4.0.4(Lost Library Book)。我是 R 新手,我最终想安装以下软件包:

library(magicaxis)
library(plotrix)
library(pracma)
library(sjmisc) 
library(spatstat.utils) 
library(tidyverse)

但首先,我想至少先安装 magicaxis。这是 `install.packages("magicaxis")

的结果
Installing package into ‘/home/nick/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
also installing the dependencies ‘maps’, ‘celestial’, ‘sm’, ‘mapproj’, ‘RANN’

trying URL 'https://cloud.r-project.org/src/contrib/maps_3.3.0.tar.gz'
Content type 'application/x-gzip' length 2493744 bytes (2.4 MB)
==================================================
downloaded 2.4 MB

trying URL 'https://cloud.r-project.org/src/contrib/celestial_1.4.6.tar.gz'
Content type 'application/x-gzip' length 48505 bytes (47 KB)
==================================================
downloaded 47 KB

trying URL 'https://cloud.r-project.org/src/contrib/sm_2.2-5.6.tar.gz'
Content type 'application/x-gzip' length 256355 bytes (250 KB)
==================================================
downloaded 250 KB

trying URL 'https://cloud.r-project.org/src/contrib/mapproj_1.2.7.tar.gz'
Content type 'application/x-gzip' length 25429 bytes (24 KB)
==================================================
downloaded 24 KB

trying URL 'https://cloud.r-project.org/src/contrib/RANN_2.6.1.tar.gz'
Content type 'application/x-gzip' length 58136 bytes (56 KB)
==================================================
downloaded 56 KB

trying URL 'https://cloud.r-project.org/src/contrib/magicaxis_2.2.1.tar.gz'
Content type 'application/x-gzip' length 1920555 bytes (1.8 MB)
==================================================
downloaded 1.8 MB

* installing *source* package ‘maps’ ...
** package ‘maps’ successfully unpacked and MD5 sums checked
** using staged installation
checking for gawk... no
checking for mawk... mawk
configure: creating ./config.status
config.status: creating src/Makefile
** libs
** arch - 
make -f "/usr/lib/R/etc/Makeconf" -f Makefile init.o mapclip.o mapget.o smooth.o thin.o 
make[1]: Entering directory '/tmp/RtmposCGu0/R.INSTALL275f6ff20521/maps/src'
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-EkOYxp/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
In file included from /home/nick/mesasdk/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed/features.h:338:0,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:25,
                 from init.c:1:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:467:49: error: missing binary operator before token "("
 #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
                                                 ^
In file included from init.c:1:0:
/usr/include/stdlib.h:133:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:139:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:145:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:151:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:157:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:163:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:169:37: error: missing binary operator before token "("
 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                     ^
/usr/include/stdlib.h:211:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
                 ^
/usr/include/stdlib.h:225:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:231:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:237:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:243:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:249:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:255:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:261:37: error: missing binary operator before token "("
 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                     ^
/usr/lib/R/etc/Makeconf:172: recipe for target 'init.o' failed
make[1]: Leaving directory '/tmp/RtmposCGu0/R.INSTALL275f6ff20521/maps/src'
make[1]: *** [init.o] Error 1
Makefile:83: recipe for target 'objects' failed
make: *** [objects] Error 2
ERROR: compilation failed for package ‘maps’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/4.0/maps’
Warning in install.packages :
  installation of package ‘maps’ had non-zero exit status
* installing *source* package ‘sm’ ...
** package ‘sm’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG      -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-EkOYxp/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c fgamma.c -o fgamma.o
In file included from /home/nick/mesasdk/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed/features.h:338:0,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/math.h:27,
                 from /usr/share/R/include/Rmath.h:45,
                 from fgamma.c:1:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:467:49: error: missing binary operator before token "("
 #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
                                                 ^
In file included from /usr/share/R/include/Rmath.h:45:0,
                 from fgamma.c:1:
/usr/include/math.h:66:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/math.h:69:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/math.h:72:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/math.h:75:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/math.h:78:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/math.h:81:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/math.h:84:37: error: missing binary operator before token "("
 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                     ^
/usr/include/math.h:107:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
                 ^
/usr/include/math.h:115:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/math.h:118:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/math.h:121:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/math.h:124:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/math.h:127:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/math.h:130:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/math.h:133:37: error: missing binary operator before token "("
 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                     ^
In file included from /usr/share/R/include/Rmath.h:45:0,
                 from fgamma.c:1:
/usr/include/math.h:203:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
                 ^
In file included from /usr/share/R/include/Rmath.h:45:0,
                 from fgamma.c:1:
/usr/include/math.h:235:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
                 ^
In file included from /usr/include/math.h:290:0,
                 from /usr/share/R/include/Rmath.h:45,
                 from fgamma.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:112:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_FUNCS_EXT)
                 ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:264:18: error: missing binary operator before token "("
 # if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
                  ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:283:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
                 ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:338:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
                 ^
In file included from /usr/include/math.h:307:0,
                 from /usr/share/R/include/Rmath.h:45,
                 from fgamma.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:112:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_FUNCS_EXT)
                 ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:264:18: error: missing binary operator before token "("
 # if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
                  ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:283:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
                 ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:338:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
                 ^
In file included from /usr/include/math.h:350:0,
                 from /usr/share/R/include/Rmath.h:45,
                 from fgamma.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:112:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_FUNCS_EXT)
                 ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:264:18: error: missing binary operator before token "("
 # if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
                  ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:283:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
                 ^
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:338:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT) || __MATH_DECLARING_FLOATN
                 ^
In file included from /usr/share/R/include/Rmath.h:45:0,
                 from fgamma.c:1:
/usr/include/math.h:388:18: error: missing binary operator before token "("
 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
                  ^
/usr/include/math.h:405:18: error: missing binary operator before token "("
 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
                  ^
In file included from /usr/share/R/include/Rmath.h:45:0,
                 from fgamma.c:1:
/usr/include/math.h:422:18: error: missing binary operator before token "("
 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
                  ^
/usr/include/math.h:439:18: error: missing binary operator before token "("
 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
                  ^
/usr/include/math.h:456:18: error: missing binary operator before token "("
 # if __GLIBC_USE (IEC_60559_TYPES_EXT)
                  ^
/usr/include/math.h:683:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
                 ^
In file included from /usr/share/R/include/Rmath.h:45:0,
                 from fgamma.c:1:
/usr/include/math.h:1176:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
                 ^
In file included from /usr/share/R/include/R_ext/RS.h:34:0,
                 from fgamma.c:2:
/usr/include/string.h:164:21: error: missing binary operator before token "("
      || __GLIBC_USE (LIB_EXT2))
                     ^
/usr/include/string.h:173:43: error: missing binary operator before token "("
 #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
                                           ^
/usr/lib/R/etc/Makeconf:172: recipe for target 'fgamma.o' failed
make: *** [fgamma.o] Error 1
ERROR: compilation failed for package ‘sm’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/4.0/sm’
Warning in install.packages :
  installation of package ‘sm’ had non-zero exit status
* installing *source* package ‘RANN’ ...
** package ‘RANN’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I. -IANN -DRANN     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-EkOYxp/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ANN.cpp -o ANN.o
In file included from /home/nick/mesasdk/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed/features.h:338:0,
                 from /home/nick/mesasdk/include/c++/7.2.0/x86_64-pc-linux-gnu/bits/os_defines.h:39,
                 from /home/nick/mesasdk/include/c++/7.2.0/x86_64-pc-linux-gnu/bits/c++config.h:533,
                 from /home/nick/mesasdk/include/c++/7.2.0/cstdlib:41,
                 from ANN.cpp:29:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:467:49: error: missing binary operator before token "("
 #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
                                                 ^
In file included from /home/nick/mesasdk/include/c++/7.2.0/cstdlib:75:0,
                 from ANN.cpp:29:
/usr/include/stdlib.h:133:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:139:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:145:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:151:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:157:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:163:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:169:37: error: missing binary operator before token "("
 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                     ^
/usr/include/stdlib.h:211:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
                 ^
/usr/include/stdlib.h:225:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:231:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:237:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:243:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:249:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:255:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:261:37: error: missing binary operator before token "("
 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                     ^
In file included from /home/nick/mesasdk/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed/wchar.h:46:0,
                 from /home/nick/mesasdk/include/c++/7.2.0/cwchar:44,
                 from /home/nick/mesasdk/include/c++/7.2.0/bits/postypes.h:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iosfwd:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iomanip:39,
                 from ./ANN/ANNx.h:39,
                 from ANN.cpp:30:
/usr/include/stdio.h:276:43: error: missing binary operator before token "("
 #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
                                           ^
/usr/include/stdio.h:349:17: error: missing binary operator before token "("
 #if __GLIBC_USE (LIB_EXT2)
                 ^
/usr/include/stdio.h:567:17: error: missing binary operator before token "("
 #if __GLIBC_USE (DEPRECATED_GETS)
                 ^
/usr/include/stdio.h:592:43: error: missing binary operator before token "("
 #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
                                           ^
In file included from /usr/include/stdio.h:862:0,
                 from /home/nick/mesasdk/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed/wchar.h:46,
                 from /home/nick/mesasdk/include/c++/7.2.0/cwchar:44,
                 from /home/nick/mesasdk/include/c++/7.2.0/bits/postypes.h:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iosfwd:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iomanip:39,
                 from ./ANN/ANNx.h:39,
                 from ANN.cpp:30:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:225:17: error: missing binary operator before token "("
 #if __GLIBC_USE (DEPRECATED_GETS)
                 ^
In file included from /home/nick/mesasdk/include/c++/7.2.0/cwchar:44:0,
                 from /home/nick/mesasdk/include/c++/7.2.0/bits/postypes.h:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iosfwd:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iomanip:39,
                 from ./ANN/ANNx.h:39,
                 from ANN.cpp:30:
/home/nick/mesasdk/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed/wchar.h:175:11: fatal error: xlocale.h: No such file or directory
 # include <xlocale.h>
           ^~~~~~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:181: recipe for target 'ANN.o' failed
make: *** [ANN.o] Error 1
ERROR: compilation failed for package ‘RANN’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/4.0/RANN’
Warning in install.packages :
  installation of package ‘RANN’ had non-zero exit status
ERROR: dependency ‘RANN’ is not available for package ‘celestial’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/4.0/celestial’
Warning in install.packages :
  installation of package ‘celestial’ had non-zero exit status
ERROR: dependency ‘maps’ is not available for package ‘mapproj’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/4.0/mapproj’
Warning in install.packages :
  installation of package ‘mapproj’ had non-zero exit status
ERROR: dependencies ‘celestial’, ‘sm’, ‘mapproj’, ‘RANN’ are not available for package ‘magicaxis’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/4.0/magicaxis’
Warning in install.packages :
  installation of package ‘magicaxis’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmppFv38j/downloaded_packages’

我假设 R 会自动安装缺少的依赖项,但由于它没有,我尝试遵循先安装依赖项并安装 RANN 的建议。

Installing package into ‘/home/nick/R/x86_64-pc-linux-gnu-library/4.0’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/RANN_2.6.1.tar.gz'
Content type 'application/x-gzip' length 58136 bytes (56 KB)
==================================================
downloaded 56 KB

* installing *source* package ‘RANN’ ...
** package ‘RANN’ successfully unpacked and MD5 sums checked
** using staged installation
** libs
g++ -std=gnu++11 -I"/usr/share/R/include" -DNDEBUG -I. -IANN -DRANN     -fpic  -g -O2 -fdebug-prefix-map=/build/r-base-EkOYxp/r-base-4.0.4=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -g  -c ANN.cpp -o ANN.o
In file included from /home/nick/mesasdk/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed/features.h:338:0,
                 from /home/nick/mesasdk/include/c++/7.2.0/x86_64-pc-linux-gnu/bits/os_defines.h:39,
                 from /home/nick/mesasdk/include/c++/7.2.0/x86_64-pc-linux-gnu/bits/c++config.h:533,
                 from /home/nick/mesasdk/include/c++/7.2.0/cstdlib:41,
                 from ANN.cpp:29:
/usr/include/x86_64-linux-gnu/sys/cdefs.h:467:49: error: missing binary operator before token "("
 #if __GNUC_PREREQ (4,8) || __glibc_clang_prereq (3,5)
                                                 ^
In file included from /home/nick/mesasdk/include/c++/7.2.0/cstdlib:75:0,
                 from ANN.cpp:29:
/usr/include/stdlib.h:133:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:139:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:145:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:151:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:157:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:163:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:169:37: error: missing binary operator before token "("
 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                     ^
/usr/include/stdlib.h:211:17: error: missing binary operator before token "("
 #if __GLIBC_USE (IEC_60559_BFP_EXT)
                 ^
/usr/include/stdlib.h:225:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT16 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:231:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT32 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:237:35: error: missing binary operator before token "("
 #if __HAVE_FLOAT64 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                   ^
/usr/include/stdlib.h:243:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:249:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT32X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:255:36: error: missing binary operator before token "("
 #if __HAVE_FLOAT64X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                    ^
/usr/include/stdlib.h:261:37: error: missing binary operator before token "("
 #if __HAVE_FLOAT128X && __GLIBC_USE (IEC_60559_TYPES_EXT)
                                     ^
In file included from /home/nick/mesasdk/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed/wchar.h:46:0,
                 from /home/nick/mesasdk/include/c++/7.2.0/cwchar:44,
                 from /home/nick/mesasdk/include/c++/7.2.0/bits/postypes.h:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iosfwd:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iomanip:39,
                 from ./ANN/ANNx.h:39,
                 from ANN.cpp:30:
/usr/include/stdio.h:276:43: error: missing binary operator before token "("
 #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
                                           ^
/usr/include/stdio.h:349:17: error: missing binary operator before token "("
 #if __GLIBC_USE (LIB_EXT2)
                 ^
/usr/include/stdio.h:567:17: error: missing binary operator before token "("
 #if __GLIBC_USE (DEPRECATED_GETS)
                 ^
/usr/include/stdio.h:592:43: error: missing binary operator before token "("
 #if defined __USE_XOPEN2K8 || __GLIBC_USE (LIB_EXT2)
                                           ^
In file included from /usr/include/stdio.h:862:0,
                 from /home/nick/mesasdk/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed/wchar.h:46,
                 from /home/nick/mesasdk/include/c++/7.2.0/cwchar:44,
                 from /home/nick/mesasdk/include/c++/7.2.0/bits/postypes.h:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iosfwd:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iomanip:39,
                 from ./ANN/ANNx.h:39,
                 from ANN.cpp:30:
/usr/include/x86_64-linux-gnu/bits/stdio2.h:225:17: error: missing binary operator before token "("
 #if __GLIBC_USE (DEPRECATED_GETS)
                 ^
In file included from /home/nick/mesasdk/include/c++/7.2.0/cwchar:44:0,
                 from /home/nick/mesasdk/include/c++/7.2.0/bits/postypes.h:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iosfwd:40,
                 from /home/nick/mesasdk/include/c++/7.2.0/iomanip:39,
                 from ./ANN/ANNx.h:39,
                 from ANN.cpp:30:
/home/nick/mesasdk/lib/gcc/x86_64-pc-linux-gnu/7.2.0/include-fixed/wchar.h:175:11: fatal error: xlocale.h: No such file or directory
 # include <xlocale.h>
           ^~~~~~~~~~~
compilation terminated.
/usr/lib/R/etc/Makeconf:181: recipe for target 'ANN.o' failed
make: *** [ANN.o] Error 1
ERROR: compilation failed for package ‘RANN’
* removing ‘/home/nick/R/x86_64-pc-linux-gnu-library/4.0/RANN’
Warning in install.packages :
  installation of package ‘RANN’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmppFv38j/downloaded_packages’
> 

我对这些消息感到不知所措,不知道该怎么办。我试着按照advice here 并一一安装依赖项,但每次尝试时,都会遇到这些错误之一。这是配置问题吗?对此的任何支持将不胜感激。

编辑 1 感谢 @user20650 的建议。我至少安装了magicaxis。

1 个答案:

答案 0 :(得分:1)

@user20650 的建议解决了这个问题。

  1. 转到 here 并按照说明将个人包裹存档 (PPA) 添加到您的系统。
  2. 使用 sudo apt install r-cran-magicaxis 安装软件包 magicaxis,或将 magicaxis 替换为所需的软件包。包名称的形式全部为小写字母。