包 fst 的 R 编译失败

R compilation failed for package fst

我正在尝试从 CRAN 安装 fst R 包,但出现错误:

gcc -I"/path/apps/R/3.5.1-20180807-test/x86_64-linux-2.6-rhel6/lib64/R/include" -DNDEBUG 
-fopenmp -I. -Ifstcore -Ifstcore_v1 -Ifstcore/LZ4 -Ifstcore/ZSTD -Ifstcore/ZSTD/common 
-Ifstcore/ZSTD/decompress -Ifstcore/ZSTD/compress 
-I"/path/apps/R/3.5.1-20180807-test/x86_64-linux-2.6-rhel6/r_libs_site/Rcpp/include" 
-I /path/apps/R/static-zlib-gcc6.3/x86_64-linux-2.6-rhel6/include   -fpic  
-I /path/apps/R/static-zlib-gcc6.3/x86_64-linux-2.6-rhel6/include   
-c fstcore/ZSTD/compress/huf_compress.c -o fstcore/ZSTD/compress/huf_compress.o
gcc -I"/path/apps/R/3.5.1-20180807-test/x86_64-linux-2.6-rhel6/lib64/R/include" -DNDEBUG 
-fopenmp -I. -Ifstcore -Ifstcore_v1 -Ifstcore/LZ4 -Ifstcore/ZSTD -Ifstcore/ZSTD/common 
-Ifstcore/ZSTD/decompress -Ifstcore/ZSTD/compress 
-I"/path/apps/R/3.5.1-20180807-test/x86_64-linux-2.6-rhel6/r_libs_site/Rcpp/include" 
-I /path/apps/R/static-zlib-gcc6.3/x86_64-linux-2.6-rhel6/include   -fpic  
-I /path/apps/R/static-zlib-gcc6.3/x86_64-linux-2.6-rhel6/include   
-c fstcore/ZSTD/decompress/zstd_decompress.c -o fstcore/ZSTD/decompress/zstd_decompress.o
/tmp/cc0LoSFX.s: Assembler messages:
/tmp/cc0LoSFX.s:7353: Error: no such instruction: `shlx %rax,%rdx,%rax'
/tmp/cc0LoSFX.s:8204: Error: no such instruction: `shlx %rax,%rdx,%rax'
/tmp/cc0LoSFX.s:8608: Error: no such instruction: `shlx %rax,%rdx,%rax'
make: *** [fstcore/ZSTD/decompress/zstd_decompress.o] Error 1
ERROR: compilation failed for package ‘fst’

是否有任何需要的 linux 库可以从源代码编译?我还能做什么?

编辑:

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/path/apps/gcc/6.3.0/x86_64-linux-2.6-rhel6/bin/../libexec/gcc/x86_64-pc-linux-gnu/6.3.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --prefix=/path/apps/gcc/6.3.0/x86_64-linux-2.6-rhel6 --disable-multilib
Thread model: posix
gcc version 6.3.0 (GCC)

把这个放在这里是为了后代,以防其他人在遇到类似问题时最终解决这个问题。

事实证明,据我们所知,问题出在汇编程序 (/usr/bin/as) 和 gcc(我们的非系统 6.3.0 安装)的不兼容版本上。

因此,如果您不知所措,却不知道为什么会看到这些错误,请寻找兼容版本的汇编程序(在 linux 世界中,这是 binutils 的一部分module/project)。希望对您有所帮助。