如何利用nmake的所有内核? [英] How do I utilise all the cores for nmake?

查看:193
本文介绍了如何利用nmake的所有内核?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚得到了一个新的四核心电脑,并注意到nmake只使用1个进程。



我曾经使用make,它有开关-j4启动4流程。根据下面的信息,我可以添加一个命令到我的qmake项目文件:



>

QMAKE_CXXFLAGS + = / MP



哪个对我有效。非常感谢。

解决方案

根据 MSDN nmake 没有这样的选项。



然而,您可以使用VC ++命令行编译器使用 / MP 选项并行传递多个文件,使编译器并行构建多个文件同时:

 > cl / MP a.cpp b.cpp c.cpp 

不过请注意,大多数Makefile不会调用编译器像这样 - 他们通常为每个单独的源文件调用编译器,这将阻止 / MP 选项做任何有用的事情。


I just got a new quad core computer and noticed that nmake is only using 1 process.

I used to use make which had the switch -j4 for launching 4 processes. What is the nmake equivalent?

[edit] Based on the information below I have been able to add a command to my qmake project file:

QMAKE_CXXFLAGS += /MP

Which effectively did it for me. Many thanks.

解决方案

According to MSDN, there's no such option for nmake.

You can however make the compiler build multiple files in parallel by using the /MP option with the VC++ command line compiler and passing multiple files at the same time:

> cl /MP a.cpp b.cpp c.cpp

However note that most Makefiles don't call the compiler like this - they usual invoke the compiler separate for each individual source file, which would prevent the /MP option from doing anything useful.

这篇关于如何利用nmake的所有内核?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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