Data.table: Red Hat Linux / Trisquel 上的 1.12.0 编译错误

创建于 2019-01-17  ·  32评论  ·  资料来源: Rdatatable/data.table

您好,我尝试在 Trisquel GNU/Linux 系统中安装 v1.12.0(2019 年 1 月 13 日) data.table包失败。 我在这个问题的底部有 sessionInfo 信息。

请看下面的安装日志:

> install.packages("data.table")
Installing package into ‘/x86_64-pc-linux-gnu-library/library’
(as ‘lib’ is unspecified)
trying URL 'https://cloud.r-project.org/src/contrib/data.table_1.12.0.tar.gz'
Content type 'application/x-gzip' length 3311096 bytes (3.2 MB)
==================================================
downloaded 3.2 MB

* installing *source* package ‘data.table’ ...
** package ‘data.table’ successfully unpacked and MD5 sums checked
** libs
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c assign.c -o assign.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c between.c -o between.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c bmerge.c -o bmerge.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c chmatch.c -o chmatch.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c dogroups.c -o dogroups.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c fastmean.c -o fastmean.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c fcast.c -o fcast.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c fmelt.c -o fmelt.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c forder.c -o forder.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c frank.c -o frank.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c fread.c -o fread.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c freadR.c -o freadR.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c froll.c -o froll.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c frollR.c -o frollR.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c frolladaptive.c -o frolladaptive.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c fsort.c -o fsort.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c fwrite.c -o fwrite.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c fwriteR.c -o fwriteR.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c gsumm.c -o gsumm.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c ijoin.c -o ijoin.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c init.c -o init.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c inrange.c -o inrange.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c nqrecreateindices.c -o nqrecreateindices.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c openmp-utils.c -o openmp-utils.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c quickselect.c -o quickselect.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c rbindlist.c -o rbindlist.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c reorder.c -o reorder.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c shift.c -o shift.o
ccache gcc -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -std=gnu99 -c subset.c -o subset.o
subset.c: In function ‘subsetVectorRaw’:
subset.c:36:105: error: stray ‘#’ in program
     PARLOOP(NA_INTEGER)
                                                                                                         ^
subset.c:36:106: error: unknown type name ‘pragma’
     PARLOOP(NA_INTEGER)
                                                                                                          ^
subset.c:36:117: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
     PARLOOP(NA_INTEGER)
                                                                                                                     ^
subset.c:36:16: error: ‘i’ undeclared (first use in this function)
     PARLOOP(NA_INTEGER)
                ^
subset.c:36:16: note: each undeclared identifier is reported only once for each function it appears in
subset.c:36:24: error: expected ‘;’ before ‘)’ token
     PARLOOP(NA_INTEGER)
                        ^
subset.c:36:24: error: expected statement before ‘)’ token
subset.c:42:124: error: stray ‘#’ in program
       PARLOOP(INT64_MIN)
                                                                                                                            ^
subset.c:42:125: error: unknown type name ‘pragma’
       PARLOOP(INT64_MIN)
                                                                                                                             ^
subset.c:42:136: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
       PARLOOP(INT64_MIN)
                                                                                                                                        ^
subset.c:42:24: error: expected ‘;’ before ‘)’ token
       PARLOOP(INT64_MIN)
                        ^
subset.c:42:24: error: expected statement before ‘)’ token
subset.c:46:106: error: stray ‘#’ in program
       PARLOOP(NA_REAL)
                                                                                                          ^
subset.c:46:107: error: unknown type name ‘pragma’
       PARLOOP(NA_REAL)
                                                                                                           ^
subset.c:46:118: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
       PARLOOP(NA_REAL)
                                                                                                                      ^
subset.c:46:24: error: expected ‘;’ before ‘)’ token
       PARLOOP(NA_REAL)
                        ^
subset.c:46:24: error: expected statement before ‘)’ token
subset.c:76:105: error: stray ‘#’ in program
     PARLOOP(NA_CPLX)
                                                                                                         ^
subset.c:76:106: error: unknown type name ‘pragma’
     PARLOOP(NA_CPLX)
                                                                                                          ^
subset.c:76:117: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
     PARLOOP(NA_CPLX)
                                                                                                                     ^
subset.c:76:24: error: expected ‘;’ before ‘)’ token
     PARLOOP(NA_CPLX)
                        ^
subset.c:76:24: error: expected statement before ‘)’ token
subset.c:81:99: error: stray ‘#’ in program
     PARLOOP(0)
                                                                                                   ^
subset.c:81:100: error: unknown type name ‘pragma’
     PARLOOP(0)
                                                                                                    ^
subset.c:81:111: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
     PARLOOP(0)
                                                                                                               ^
subset.c:81:24: error: expected ‘;’ before ‘)’ token
     PARLOOP(0)
                        ^
subset.c:81:24: error: expected statement before ‘)’ token
make: *** [subset.o] Error 1
ERROR: compilation failed for package ‘data.table’

Output of sessionInfo()

R version 3.5.2 (2018-12-20)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Trisquel GNU/Linux Belenos (7.0)

Matrix products: default
BLAS: /usr/lib/atlas-base/atlas/libblas.so.3.0
LAPACK: /usr/lib/lapack/liblapack.so.3.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] graphics  grDevices datasets  stats     utils     methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.2 tools_3.5.2   
platform-specific

最有用的评论

@jangorecki对不起,我是个白痴。 我所在的服务器显然仍在运行 Redhat 6,我没有受到支持的问题。 很高兴它仍然可以在 7 上开箱即用。

所有32条评论

你好,

我在 Linux 中安装 data.table 时也遇到了以下错误:

gcc -std=gnu99 -I"/share/ClusterShare/software/contrib/seyyaz/R-v3.5.1/lib64/R/include" -DNDEBUG   -I/share/ClusterShare/software/contrib/seyyaz/zlib-1.2.11/include -I/share/ClusterShare/software/contrib/seyyaz/bzip2-1.0.6/include -I/share/ClusterShare/software/contrib/seyyaz/xz-5.2.4/include -I/share/ClusterShare/software/contrib/seyyaz/pcre-8.42/include -I//share/ClusterShare/software/contrib/seyyaz/curl-7.63.0/include  -fopenmp -fpic  -g -O2  -c forder.c -o forder.o
forder.c: In function 'range_str':
forder.c:296: error: expected end of line before 'update'
make: *** [forder.o] Error 1
ERROR: compilation failed for package 'data.table'
* removing '/share/ClusterShare/software/contrib/seyyaz/R_libs/data.table'
* restoring previous '/share/ClusterShare/software/contrib/seyyaz/R_libs/data.table'

> sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS release 6.8 (Final)

Matrix products: default
BLAS: /share/ClusterShare/software/contrib/seyyaz/R-v3.5.1/lib64/R/lib/libRblas.so
LAPACK: /share/ClusterShare/software/contrib/seyyaz/R-v3.5.1/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.iso885915       LC_NUMERIC=C
 [3] LC_TIME=en_US.iso885915        LC_COLLATE=en_US.iso885915
 [5] LC_MONETARY=en_US.iso885915    LC_MESSAGES=en_US.iso885915
 [7] LC_PAPER=en_US.iso885915       LC_NAME=C
 [9] LC_ADDRESS=C                   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_US.iso885915 LC_IDENTIFICATION=C

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] usethis_1.4.0  devtools_2.0.1

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.0         ps_1.3.0           prettyunits_1.0.2  rprojroot_1.3-2
 [5] withr_2.1.2        digest_0.6.18      crayon_1.3.4       assertthat_0.2.0
 [9] R6_2.3.0           backports_1.1.3    magrittr_1.5       rlang_0.3.1
[13] cli_1.0.1          curl_3.3           fs_1.2.6           remotes_2.0.2
[17] callr_3.1.1        desc_1.2.0         tools_3.5.1        glue_1.3.0
[21] pkgload_1.0.2      compiler_3.5.1     processx_3.2.1     pkgbuild_1.0.2
[25] BiocManager_1.30.4 sessioninfo_1.1.1  memoise_1.1.0

请报告您的编译器版本,例如gcc --version

我的是 gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-17)。 我还用 gcc-7.3.0 编译了一个版本,它也给出了错误

它似乎与CentOS有关。 在全新的 R 安装中,我遇到了与 s-yazar 相同的问题。

通过将 gcc 升级到 4.9.0 解决了这个问题。

@Huitziii感谢您的反馈。 奇怪的是@s-yazar 在 gcc-7.3 上出现错误,而您升级到 gcc-4.9 解决了这个问题。 目前,我们手头没有重现该问题的环境。

@jangorecki
我返回并再次使用 gcc-7.3 重新编译了 R 3.5.1。 这次安装data.table没有问题。 不知道是什么导致了早期的错误。

@s-yazar 感谢您的反馈。
所以到目前为止@s-yazar 和@Huitziii编译错误已经通过升级编译器解决了。
@iembry你能升级你的编译器吗?

@iembry请让我们知道升级编译器是否解决了问题,如果没有,我将重新打开此问题。

我在运行 gcc v4.4.7 的 RedHat 系统上遇到了同样的问题 - 我安装devtoolset-2 ,如下所述: https ://unix.stackexchange.com/a/125621 因为“标准”RedHat gcc 在此发行版仍然是 v4.4.7,所以 yum update 没有做任何事情(我还必须下载并安装此评论中列出的 GPG 密钥)

devtoolset-2包含一堆东西,包括更新的 gcc v4.8.2,启用该环境:

source scl_source enable devtoolset-2

然后你有 gcc v4.8.2,然后安装 data.table v1.1.2.0 工作。

@philippbayer感谢您的反馈

@jangorecki我很抱歉我的超级延迟响应,但是不,我无法升级我的编译器,直到我升级我的计算机并升级我的发行版。 我有一个旧版本的 gcc 编译器,但我不记得它现在是哪个版本。

您是否可以在 data.table 的 CRAN 页面上放置 gcc 编译器 > 版本?

谢谢你。

发布一个无法在最新的 redhat OS 的完全更新版本上编译的数据表版本似乎是一个非常不友好的举动。 让人们从非核心存储库安装新编译器以进行全新安装并不是一种很好的体验。

真的没有补丁可以让代码在 gcc 4.4.7 下仍然工作吗?

@s-andrews 根据https://access.redhat.com/solutions/19458最近的一个是 RHEL7 并附带 gcc 4.8.x。 您的操作系统版本是多少?
根据上面的评论,它在 gcc 4.8.2 上编译得很好。 请注意,4.8.2 已经快 6 岁了。
同时,我们的 R 依赖至少为 R 3.1,即 5 岁。 所以我们可以说我们对 gcc 比 R 更向后兼容。

@iembry抱歉回复晚了,我之前错过了你的评论。 我不确定这是否可行,因为编译 data.table 不需要 gcc,还有许多其他编译器,因此在 DESCRIPTION 中仅列出 gcc 看起来不合适。

@jangorecki对不起,我是个白痴。 我所在的服务器显然仍在运行 Redhat 6,我没有受到支持的问题。 很高兴它仍然可以在 7 上开箱即用。

@jangorecki您延迟回复没关系。 我理解你关于 gcc 不是唯一编译器的观点。 感谢您回复。

安装 data.table 时出现同样的错误。 这是sessionInfo()的输出:

R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Debian GNU/Linux 8 (jessie)

Matrix products: default
BLAS: /usr/lib/libblas/libblas.so.3.0
LAPACK: /usr/lib/lapack/liblapack.so.3.0

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] compiler_3.5.3 tools_3.5.3 

我的 gcc 版本是 gcc (Debian 4.9.2-10+deb8u2) 4.9.2,根据上面的评论应该没问题。

我会尝试更新 gcc,但我没有 root 权限。

你能提供安装日志输出吗?

这是输出(与原始帖子中的几乎相同):

> install.packages("data.table", repos="http://cran.cnr.berkeley.edu/")
Installing package into ‘/home/jcasti15/R/x86_64-pc-linux-gnu-library/3.5’
(as ‘lib’ is unspecified)
trying URL 'http://cran.cnr.berkeley.edu/src/contrib/data.table_1.12.2.tar.gz'
Content type 'application/x-gzip' length 3343698 bytes (3.2 MB)
==================================================
downloaded 3.2 MB

* installing *source* package ‘data.table’ ...
** package ‘data.table’ successfully unpacked and MD5 sums checked
** libs
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c assign.c -o assign.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c between.c -o between.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c bmerge.c -o bmerge.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c chmatch.c -o chmatch.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c dogroups.c -o dogroups.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c fastmean.c -o fastmean.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c fcast.c -o fcast.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c fmelt.c -o fmelt.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c forder.c -o forder.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c frank.c -o frank.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c fread.c -o fread.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c freadR.c -o freadR.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c froll.c -o froll.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c frollR.c -o frollR.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c frolladaptive.c -o frolladaptive.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c fsort.c -o fsort.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c fwrite.c -o fwrite.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c fwriteR.c -o fwriteR.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c gsumm.c -o gsumm.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c ijoin.c -o ijoin.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c init.c -o init.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c inrange.c -o inrange.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c nqrecreateindices.c -o nqrecreateindices.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c openmp-utils.c -o openmp-utils.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c quickselect.c -o quickselect.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c rbindlist.c -o rbindlist.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c reorder.c -o reorder.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c shift.c -o shift.o
gcc -std=gnu99 -I"/usr/share/R/include" -DNDEBUG     -fopenmp -fpic  -g -O2 -fstack-protector-strong -Wformat -Werror=
format-security -D_FORTIFY_SOURCE=2 -g  -c subset.c -o subset.o
subset.c: In function ‘subsetVectorRaw’:
subset.c:36:105: error: stray ‘#’ in program
     PARLOOP(NA_INTEGER)
                                                                                                         ^
subset.c:36:106: error: unknown type name ‘pragma’
     PARLOOP(NA_INTEGER)
                                                                                                          ^
subset.c:36:117: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
     PARLOOP(NA_INTEGER)
                                                                                                                     ^
subset.c:36:16: error: ‘i’ undeclared (first use in this function)
     PARLOOP(NA_INTEGER)
                ^
subset.c:36:16: note: each undeclared identifier is reported only once for each function it appears in
subset.c:36:24: error: expected ‘;’ before ‘)’ token
     PARLOOP(NA_INTEGER)
                        ^
subset.c:36:24: error: expected statement before ‘)’ token
subset.c:42:124: error: stray ‘#’ in program
       PARLOOP(INT64_MIN)

      ^
subset.c:42:125: error: unknown type name ‘pragma’
       PARLOOP(INT64_MIN)

       ^
       subset.c:42:136: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
       PARLOOP(INT64_MIN)

                  ^
subset.c:42:24: error: expected ‘;’ before ‘)’ token
       PARLOOP(INT64_MIN)
                        ^
subset.c:42:24: error: expected statement before ‘)’ token
subset.c:46:106: error: stray ‘#’ in program
       PARLOOP(NA_REAL)
                                                                                                          ^
subset.c:46:107: error: unknown type name ‘pragma’
       PARLOOP(NA_REAL)
                                                                                                           ^
subset.c:46:118: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
       PARLOOP(NA_REAL)

^
subset.c:46:24: error: expected ‘;’ before ‘)’ token
       PARLOOP(NA_REAL)
                        ^
subset.c:46:24: error: expected statement before ‘)’ token
subset.c:81:105: error: stray ‘#’ in program
     PARLOOP(NA_CPLX)
                                                                                                         ^
subset.c:81:106: error: unknown type name ‘pragma’
     PARLOOP(NA_CPLX)
     subset.c:81:117: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
     PARLOOP(NA_CPLX)
                                                                                                                     ^
subset.c:81:24: error: expected ‘;’ before ‘)’ token
     PARLOOP(NA_CPLX)
                        ^
subset.c:81:24: error: expected statement before ‘)’ token
subset.c:86:99: error: stray ‘#’ in program
     PARLOOP(0)
                                                                                                   ^
subset.c:86:100: error: unknown type name ‘pragma’
     PARLOOP(0)
                                                                                                    ^
subset.c:86:111: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
     PARLOOP(0)
                                                                                                               ^
subset.c:86:24: error: expected ‘;’ before ‘)’ token
     PARLOOP(0)
                        ^
subset.c:86:24: error: expected statement before ‘)’ token
/usr/lib/R/etc/Makeconf:163: recipe for target 'subset.o' failed
make: *** [subset.o] Error 1
ERROR: compilation failed for package ‘data.table’
* removing ‘/home/jcasti15/R/x86_64-pc-linux-gnu-library/3.5/data.table’

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

根据@jc-castillo,问题已在 Debian jessie 上使用 gcc 4.9.2 进行了复制。 截至目前,我们希望依赖 gcc 4.8.2+,从而重新打开。
任何人都知道是否有办法在包安装开始时将 gcc 版本转储到控制台? 可能会安装较新的 gcc,但由于机器配置较旧的 gcc 正在用于安装软件包。 仔细检查一下会很有用。

@jangorecki

问题已在 Debian jessie 上使用 gcc 4.9.2 重现。 截至目前,我们希望依赖 gcc 4.8.2+,从而重新打开。

如果问题在 gcc 4.9.2 中重现,为什么我们要依赖更早版本的 gcc (4.8.2+) ?

从过去的多份报告中,我们观察到 4.8.2+ 已经足够新了。 只有这个单一的报告不适合这里。 在声明对 4.9.2(或更高版本)的依赖之前,最好仔细检查安装过程中实际使用的版本。

@jc-castillo 您能否确认gcc --version的输出,请仔细检查。 请参阅上面的@jangorecki评论。

在从 R 安装期间, ~/.R/Makevars最终可能会覆盖gcc --version ,请您也检查一下吗? 如果你没有这个文件应该没问题。

@mattdowle Makevars是否已经影响配置脚本? 还是只是 pkg src 编译? 我们也许可以从配置脚本中添加打印,以便在 00install.out 中使用 gcc 版本更容易调试此类问题。

@jangorecki gcc --version打印在configure听起来不错。 需要包装,以便如果 gcc 不可用,它不会导致configure失败。 用户可能正在使用不同的编译器并且没有安装gcc 。 R-exts 第 1.2 节提到R CMD config也可能有助于从configure发出。

@jc-castillo 您能否在之前失败的同一环境中重新尝试安装最新的开发版本? 我们为 gcc 版本添加了额外的输出,以确保 R 进程正在使用哪个版本来编译包源。

我正在关闭这个问题,唯一要调查的是@jc-castillo 的报告,他不再回复了。 安装现在会打印 gcc 版本,因此我们可以更准确地调试在编译期间正在使用哪个 gcc 版本。 @jc-castillo 如果这个问题仍然影响到你,请告诉我们,我们可以随时重新打开这个问题。

在为当前的 r-devel 安装 data.table 时,我在 GNU/Linux Mint 17.3 Cinnamon 64 位中也遇到了同样的问题。

下面是我的输出:

install.packages("data.table")
Installing package into ‘/usr/local/lib/R-devel/lib/R/library’
(as ‘lib’ is unspecified)
trying URL 'https://cran.dcc.uchile.cl/src/contrib/data.table_1.12.8.tar.gz'
Content type 'application/x-gzip' length 4948391 bytes (4.7 MB)
==================================================
downloaded 4.7 MB

* installing *source* package ‘data.table’ ...
** package ‘data.table’ successfully unpacked and MD5 sums checked
** using staged installation
zlib 1.2.8 is available ok
** libs
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c assign.c -o assign.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c between.c -o between.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c bmerge.c -o bmerge.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c chmatch.c -o chmatch.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c cj.c -o cj.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c coalesce.c -o coalesce.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c dogroups.c -o dogroups.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c fastmean.c -o fastmean.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c fcast.c -o fcast.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c fifelse.c -o fifelse.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c fmelt.c -o fmelt.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c forder.c -o forder.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c frank.c -o frank.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c fread.c -o fread.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c freadR.c -o freadR.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c froll.c -o froll.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c frollR.c -o frollR.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c frolladaptive.c -o frolladaptive.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c fsort.c -o fsort.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c fwrite.c -o fwrite.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c fwriteR.c -o fwriteR.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c gsumm.c -o gsumm.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c ijoin.c -o ijoin.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c init.c -o init.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c inrange.c -o inrange.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c nafill.c -o nafill.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c nqrecreateindices.c -o nqrecreateindices.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c openmp-utils.c -o openmp-utils.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c quickselect.c -o quickselect.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c rbindlist.c -o rbindlist.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c reorder.c -o reorder.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c shift.c -o shift.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c subset.c -o subset.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c transpose.c -o transpose.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c types.c -o types.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c uniqlist.c -o uniqlist.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c utils.c -o utils.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c vecseq.c -o vecseq.o
ccache gcc -I"/usr/local/lib/R-devel/lib/R/include" -DNDEBUG   -I/usr/local/include  -fopenmp -fpic  -ggdb -pipe -std=gnu99 -Wall -pedantic  -c wrappers.c -o wrappers.o
subset.c: In function ‘subsetVectorRaw’:
subset.c:36:105: error: stray ‘#’ in program
     PARLOOP(NA_INTEGER)
                                                                                                         ^
subset.c:36:106: error: unknown type name ‘pragma’
     PARLOOP(NA_INTEGER)
                                                                                                          ^
subset.c:36:117: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
     PARLOOP(NA_INTEGER)
                                                                                                                     ^
subset.c:36:16: error: ‘i’ undeclared (first use in this function)
     PARLOOP(NA_INTEGER)
                ^
subset.c:36:16: note: each undeclared identifier is reported only once for each function it appears in
subset.c:36:24: error: expected ‘;’ before ‘)’ token
     PARLOOP(NA_INTEGER)
                        ^
subset.c:36:24: error: expected statement before ‘)’ token
subset.c:42:124: error: stray ‘#’ in program
       PARLOOP(INT64_MIN)
                                                                                                                            ^
subset.c:42:125: error: unknown type name ‘pragma’
       PARLOOP(INT64_MIN)
                                                                                                                             ^
subset.c:42:136: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
       PARLOOP(INT64_MIN)
                                                                                                                                        ^
subset.c:42:24: error: expected ‘;’ before ‘)’ token
       PARLOOP(INT64_MIN)
                        ^
subset.c:42:24: error: expected statement before ‘)’ token
subset.c:46:106: error: stray ‘#’ in program
       PARLOOP(NA_REAL)
                                                                                                          ^
subset.c:46:107: error: unknown type name ‘pragma’
       PARLOOP(NA_REAL)
                                                                                                           ^
subset.c:46:118: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
       PARLOOP(NA_REAL)
                                                                                                                      ^
subset.c:46:24: error: expected ‘;’ before ‘)’ token
       PARLOOP(NA_REAL)
                        ^
subset.c:46:24: error: expected statement before ‘)’ token
subset.c:80:105: error: stray ‘#’ in program
     PARLOOP(NA_CPLX)
                                                                                                         ^
subset.c:80:106: error: unknown type name ‘pragma’
     PARLOOP(NA_CPLX)
                                                                                                          ^
subset.c:80:117: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
     PARLOOP(NA_CPLX)
                                                                                                                     ^
subset.c:80:24: error: expected ‘;’ before ‘)’ token
     PARLOOP(NA_CPLX)
                        ^
subset.c:80:24: error: expected statement before ‘)’ token
subset.c:85:99: error: stray ‘#’ in program
     PARLOOP(0)
                                                                                                   ^
subset.c:85:100: error: unknown type name ‘pragma’
     PARLOOP(0)
                                                                                                    ^
subset.c:85:111: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘parallel’
     PARLOOP(0)
                                                                                                               ^
subset.c:85:24: error: expected ‘;’ before ‘)’ token
     PARLOOP(0)
                        ^
subset.c:85:24: error: expected statement before ‘)’ token
make: *** [subset.o] Error 1
ERROR: compilation failed for package ‘data.table’
* removing ‘/usr/local/lib/R-devel/lib/R/library/data.table’

The downloaded source packages are in
    ‘/tmp/RtmpPBv7Mi/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
Warning message:
In install.packages("data.table") :
  installation of package ‘data.table’ had non-zero exit status

我的 gcc 版本是:

gcc --version gcc (Ubuntu 4.8.4-2ubuntu1~14.04.4) 4.8.4

@hzambran看起来可能与 OpenMP 有关? 您可以尝试安装当前的开发版本吗? 那里的日志应该包含有关您的 OpenMP 安装的诊断信息

@hzambran您能否在安装过程中禁用ccache并直接使用gcc ? 然后提供输出。

感谢您的回复。

我不是编译专家,所以你能告诉我如何在安装过程中禁用ccache并直接使用gcc吗?

我也尝试使用当前开发版本的 data.table,但我得到了同样的错误。

此页面是否有帮助?
0 / 5 - 0 等级