在至强融核上使用GCC [英] Using GCC on Xeon Phi

查看:145
本文介绍了在至强融核上使用GCC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人告诉我可以在使用gcc构建的MIC上运行程序.

I was told one can run a program on MIC that was built with gcc.

是真的吗?

如果是,如何进行?

我正在使用gcc版本4.4.7.

I'm using gcc version 4.4.7.

推荐答案

Intel Xeon Phi确实可以运行使用gcc交叉编译器编译的程序.但是,由于gcc会"

Intel Xeon Phi can indeed run programs that are compiled with the gcc cross compiler. However gcc is not suitable for compiling any applications for the coprocessor, since gcc does "not include support for Knights Corner vector instructions and related optimization improvements. GCC for Knights Corner is really only for building the kernel and related tools; it is not for building applications.", according to Intel.

gsl库出现问题是由于该库并未针对Intel Xeon Phi进行交叉编译,而是针对主机进行了编译和配置. 为了使gsl(或任何其他库)在Intel Xeon Phi上工作,您必须交叉编译协处理器,并在编译需要该库的程序时为编译器和链接器提供必要的路径:

The problem you have with the gsl library is caused because the library was not cross-compiled for the Intel Xeon P instead was compiled and configured for the host machine. In order to get gsl (or any other library) working on the Intel Xeon P you have to cross compile it for the coprocessor and provide the necessary paths to the compiler and the linker when you compile a program that requires that library:

gcc hellophi.c -L/path/to/cross/compiled/glslib -lgsl

使用icc时,您可以将交叉编译的库通过TCP/IP堆栈传输到协处理器(例如,使用scp),然后让icc进行环境变量和路径处理.

When using icc, you can transfer the cross compiled library to the coprocessor through the TCP/IP stack (e.g. using scp) and let icc do the environment variable and path handling.

这篇关于在至强融核上使用GCC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆