【发布时间】:2015-08-31 20:49:02
【问题描述】:
我从 intel 网站下载了 MPSS 软件堆栈版本 3.5.2 源代码。我正在尝试从源代码编译 xeon phi 移植的 GCC(从 GCC 4.7.0 移植)并将其安装在本地子目录中。但是,我收到以下错误-
k1om-mpss-linux-gcc -dumpspecs > tmp-specs
/bin/sh: k1om-mpss-linux-gcc: command not found
我的配置如下-
# The below directory contains the cross compiled libs
# like assembler and linker
export PATH=$HOME/xeon-phi-gcc/bin
# The configure command
../xeon-phi-gcc/configure \
--build=x86_64-linux \
--host=x86_64-mpsssdk-linux \
--target=k1om-mpss-linux \
--prefix=$HOME/cross-gcc \
--enable-languages=c,c++ \
--with-sysroot=/opt/mpss/3.5.1/sysroots/k1om-mpss-linux \
--disable-multilib
# Compiling
make
为什么 Makefile 调用 k1om-mpss-linux-gcc ?这不应该是 make 完成后交叉编译的 gcc 二进制文件吗?我该如何解决这个问题或我错过了什么?
编辑 1:我将配置参数更改为 --build=x86_64-mpsssdk-linux --host=x86_64-mpsssdk-linux。我现在收到以下错误-
In file included from gtype-desc.c:30:0:
../../gcc-4.7.0+mpss3.5.2/gcc/tree.h:3179:11: warning: identifier ‘thread_local’ conflicts with C++ keyword [-Wc++-compat]
unsigned thread_local : 1;
^
gtype-desc.c:8696:18: error: subscripted value is neither array nor pointer nor vector
sizeof (x_rtl[0]),
^
gtype-desc.c:8815:36: error: subscripted value is neither array nor pointer nor vector
sizeof (default_target_libfuncs[0]),
^
gtype-desc.c:8899:31: error: subscripted value is neither array nor pointer nor vector
sizeof (default_target_rtl[0]),
^
gtype-desc.c:8920:31: error: subscripted value is neither array nor pointer nor vector
sizeof (default_target_rtl[0]),
^
gtype-desc.c:8927:31: error: subscripted value is neither array nor pointer nor vector
sizeof (default_target_rtl[0]),
^
gtype-desc.c:8934:31: error: subscripted value is neither array nor pointer nor vector
sizeof (default_target_rtl[0]),
^
gtype-desc.c 是机器生成的文件。
编辑 2:我现在收到错误-
/tmp/cc4aDvmI.s: Assembler messages:
/tmp/cc4aDvmI.s:94: Error: no such instruction: `kmov %esi,%k2'
/tmp/cc4aDvmI.s:147: Error: no such instruction: `kmov %edi,%k2'
/tmp/cc4aDvmI.s:255: Error: no such instruction: `kmov %r8d,%k2'
/tmp/cc4aDvmI.s:258: Error: no such instruction: `vpackstorelq %zmm0,(%rsp){%k2}'
我该如何解决这个问题?这些似乎是向量指令,但我认为 gcc 交叉编译器不支持向量指令。
【问题讨论】:
-
"/tmp/cc4aDvmI.s:258: Error: no such instruction: 'vpackstorelq %zmm0,(%rsp){%k2}'" 表示 GCC 生成该向量指令,但 Assembler 不不支持。尝试将更正
as(来自 MPSS)的路径添加到 $PATH,或者您可能需要使用 --with-as=... 选项重建 GCC。 -
预安装的汇编器是
/usr/bin/as或/opt/mpss/3.5.1/sysroots/x86_64-mpsssdk-linux/usr/bin/k1om-mpss-linux/k1om-mpss-linux-as。然而,配置脚本会寻找x86_64-mpsssdk-linux-as。我应该使用哪一个,或者我还需要制作另一个汇编器? -
事实上,我尝试使用它们,它们都给出了相同的错误。
-
你确定GCC真的使用
k1om-mpss-linux-as吗? (例如,您可以查看strace -f -o out.strace /path/to/gcc ...)我刚刚尝试使用 MPSS 3.5.1 中的 k1om-mpss-linux-as 组装 'vpackstorelq %zmm0,(%rsp){%k2}',它可以工作。 -
你说的是普通的 GCC 还是 GCC 交叉编译器?只是为了澄清,我正在尝试安装交叉编译器。仅当使用 icc 或预安装的交叉编译器编译程序时发生此错误时,Google 才会给我结果。我在编译
gcc-4.7.0+mpss3.5.2源代码时收到此错误。
标签: linux gcc cross-compiling porting xeon-phi