使用 icc -static 问题进行编译
我一直在使用 ICC 编译我为我的研究编写的程序(没有什么令人印象深刻的,只是大量的浮点计算),我可以使用以下命令很好地编译它:
g++ -O3 mixingModel.cpp configFile.cpp -o mixingModel
或
icc -O3 -ipo -static mixingModel.cpp configFile.cpp -o mixingModel
但是,一旦我添加 -static ,编译器就会挂起。当我想使用 -fast 并且编译器只是坐在那里永远编译时,这个问题首先出现了。正在运行的进程称为 mcpcom,它占用了我 99% 的 cpu(因此它是一个线程),几乎没有任何内存。我之前已经让它在那里放置了 30 多分钟(通常没有 -fast 的编译时间不到一分钟)。
然后我继续用 C++ 编写了一个小型的 hello world 程序,并尝试使用 -fast 标志编译它,它再次显示了相同的 MO。坐在那里,CPU 使用率达到 99%,调用的进程是 mcpcom。
注意:我正在 64 位 Linux 上进行编译,ICC 版本为 11.1 20100806
谢谢,
Patrick
I have been using ICC to compile a program I wrote for my research (nothing impressive just a lot of floating point calculations) and I can compile it just fine using:
g++ -O3 mixingModel.cpp configFile.cpp -o mixingModel
or
icc -O3 -ipo -static mixingModel.cpp configFile.cpp -o mixingModel
However, as soon as I add -static the compiler just hangs. This issue first crept up when I wanted to use -fast and the compiler just sat there compiling away forever. The process that is running is called mcpcom and it takes 99% of my cpu (so its one thread) and hardly any memory. I have let it sit there for over 30 minutes before (usual compile time without -fast is under one minutes).
I then went ahead and wrote a small hello world program in c++ and tried compiling it with the -fast flag and it again showed the same MO. Sat there with 99% cpu used and the process called is mcpcom.
Note: I am compiling on 64bit Linux with ICC version 11.1 20100806
Thank you,
Patrick
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这可能是由于 icc 的程序间优化所致。它考虑所有目标文件,在进行静态链接时可能会很多。所以我建议删除
-ipo
。显然,这是一个老问题。This is likely due to icc's inter-procedural optimization. It considers all object files, which can be a lot when doing static linking. So I recommend to drop
-ipo
. Apparently, this is an old problem.