如何利用nmake的所有内核?(How do I utilise all the cores for nmake?)

编程入门 行业动态 更新时间:2024-10-13 20:17:28
如何利用nmake的所有内核?(How do I utilise all the cores for nmake?)

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

我曾经使用make,它有开关-j4启动4个进程。 nmake等价物是什么?

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

QMAKE_CXXFLAGS + = / 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.

最满意答案

根据MSDN , nmake没有这样的选择。

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

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

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

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.

更多推荐

本文发布于:2023-08-07 06:34:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1463031.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:内核   nmake   cores   utilise

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!