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

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

问题描述

我刚刚得到了一个新的四核计算机,注意到nmake只使用一个进程。

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

我以前使用make有开关-j4启动4过程。什么是nmake等价物?

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


根据下面的信息,我已经能够添加一个命令到我的qmake项目文件:

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

QMAKE_CXXFLAGS + = / MP

QMAKE_CXXFLAGS += /MP

这对我有效。非常感谢。

Which effectively did it for me. Many thanks.

推荐答案

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

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

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

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

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

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天全站免登陆