xgboost在CentOS 6.8上构建错误

xgboost build error on CentOS 6.8

本文关键字:构建 错误 CentOS xgboost      更新时间:2023-10-16

操作系统:CentOS 6.8

编译器:gcc 4.8.2和g++4.8.2

复制

的步骤

请按照安装指南中的步骤操作

我的步骤

git clone --recursive https://github.com/dmlc/xgboost git submodule init git submodule update cd xgboost make -j4

然后得到

下面的错误

[root@xxx]# make -j4 g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/learner.o src/learner.cc >build/learner.d g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/logging.o src/logging.cc >build/logging.d g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/c_api/c_api.o src/c_api/c_api.cc >build/c_api/c_api.d g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/c_api/c_api_error.o src/c_api/c_api_error.cc >build/c_api/c_api_error.d g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp src/c_api/c_api_error.cc -o build/c_api/c_api_error.o g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp src/learner.cc -o build/learner.o g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp src/logging.cc -o build/logging.o g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp src/c_api/c_api.cc -o build/c_api/c_api.o g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/common/common.o src/common/common.cc >build/common/common.d g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp src/common/common.cc -o build/common/common.o g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/data/data.o src/data/data.cc >build/data/data.d g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp src/data/data.cc -o build/data/data.o g++ -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp -MM -MT build/data/simple_csr_source.o src/data/simple_csr_source.cc >build/data/simple_csr_source.d g++ -c -std=c++0x -Wall -O3 -msse2 -Wno-unknown-pragmas -funroll-loops -Iinclude -Idmlc-core/include -Irabit/include -fPIC -fopenmp src/data/simple_csr_source.cc -o build/data/simple_csr_source.o /tmp/ccNp7oXM.s: Assembler messages: /tmp/ccNp7oXM.s:148: Error: expecting string instruction after `rep' /tmp/ccNp7oXM.s:1796: Error: expecting string instruction after `rep' /tmp/ccNp7oXM.s:4394: Error: expecting string instruction after `rep' make: *** [build/data/simple_csr_source.o] Error 1 make: *** Waiting for unfinished jobs.... /tmp/ccnxYuhm.s: Assembler messages: /tmp/ccnxYuhm.s:44: Error: expecting string instruction after `rep' /tmp/ccnxYuhm.s:272: Error: expecting string instruction after `rep' /tmp/ccnxYuhm.s:276: Error: expecting string instruction after `rep' /tmp/ccnxYuhm.s:316: Error: expecting string instruction after `rep' /tmp/ccnxYuhm.s:29012: Error: expecting string instruction after `rep' make: *** [build/learner.o] Error 1 /tmp/ccyHo0ol.s: Assembler messages: /tmp/ccyHo0ol.s:331: Error: expecting string instruction after `rep' /tmp/ccyHo0ol.s:386: Error: expecting string instruction after `rep' /tmp/ccyHo0ol.s:555: Error: expecting string instruction after `rep' /tmp/ccyHo0ol.s:11407: Error: expecting string instruction after `rep' /tmp/ccyHo0ol.s:17712: Error: expecting string instruction after `rep' make: *** [build/c_api/c_api.o] Error 1 /tmp/cc3gD7Gv.s: Assembler messages: /tmp/cc3gD7Gv.s:82: Error: expecting string instruction after `rep' make: *** [build/data/data.o] Error 1

对于根本原因有什么建议吗?

我不熟悉xgboost,但是从错误中可以明显看出一些ASM代码没有正确生成:

期望在' rep'后输入字符串指令

ASM中的REP关键字前缀表示"重复此指令多次(由C寄存器定义)"。

然而,这也可能是你的工具链的问题。实际上,如果生成此错误的代码不依赖于内联ASM,则很可能这是一个工具链错误。

某些版本的binutils认为rep ret是无效的,而它实际上是一个有效的x86-64指令。

尝试升级到 binutils 2.23.52.0.1