简体   繁体   English

如何从源代码编译至强phi修补的gcc?

[英]How to compile Xeon phi patched gcc from source?

I downloaded the MPSS software stack version 3.5.2 source code from the intel website. 我从英特尔网站下载了MPSS软件堆栈3.5.2版源代码。 I am trying to compile the xeon phi ported GCC (ported from GCC 4.7.0) from source and install it in a local subdirectory. 我正在尝试从源代码编译Xeon phi移植的GCC(从GCC 4.7.0移植)并将其安装在本地子目录中。 However, I am getting the following error- 但是,我收到以下错误-

k1om-mpss-linux-gcc -dumpspecs > tmp-specs
/bin/sh: k1om-mpss-linux-gcc: command not found

My configuration is as follows- 我的配置如下-

# 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

Why is the Makefile calling k1om-mpss-linux-gcc ? 为什么Makefile调用k1om-mpss-linux-gcc Shouldn't this be the cross compiled gcc binary after make completes ? 这不应该是make完成后交叉编译的gcc二进制文件吗? How can I fix this or what am I missing ? 我该如何解决这个问题或缺少什么?

EDIT 1: I changed the config parameters to --build=x86_64-mpsssdk-linux --host=x86_64-mpsssdk-linux . 编辑1:我将config参数更改为--build=x86_64-mpsssdk-linux --host=x86_64-mpsssdk-linux I get the following errors now- 我现在收到以下错误-

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 is a machine generated file. gtype-desc.c是计算机生成的文件。

EDIT 2: I am now getting the error- 编辑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}'

How can I fix this ? 我怎样才能解决这个问题 ? These seem to be vector instructions but I thought that the gcc cross compiler didn't support vector instructions. 这些似乎是矢量指令,但我认为gcc交叉编译器不支持矢量指令。

Your --build , --host and --target machine are all different (this is referenced as canadian compile, which is slightly different from cross compile, where --build and --host are the same). 您的--build ,-- --host--target机器都不同(这被称为加拿大编译,这与交叉编译( --build--host相同)略有不同)。 This means that an additional compiler is needed to build target libraries. 这意味着需要额外的编译器来构建目标库。

From GCC docs (6.1): 从GCC文档(6.1):

If build and host are different, you must have already built and installed a cross compiler that will be used to build the target libraries (if you configured with --target=foo-bar, this compiler will be called foo-bar-gcc). 如果构建和宿主不同,则必须已经构建并安装了将用于构建目标库的交叉编译器(如果使用--target = foo-bar配置,则该编译器将称为foo-bar-gcc) 。

So, as your --target is k1om-mpss-linux , you need that version of compiler in order to build GCC. 因此,由于您的--targetk1om-mpss-linux ,因此需要该版本的编译器才能构建GCC。

The result will be a GCC compiled on a --build machine that will run on a --host machine and that will produce code that can run on a --target machine. 结果将是在--build机器上编译的GCC,该机器将在--host机器上运行,并生成可在--target机器上运行的代码。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM