How do I utilise all the cores for nmake?

后端 未结 8 1593
忘了有多久
忘了有多久 2020-12-13 00:00

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 t

相关标签:
8条回答
  • 2020-12-13 00:16

    QT has a tool for this: http://download.qt.io/official_releases/jom/

    They also use it per default in Qt creator.

    0 讨论(0)
  • 2020-12-13 00:24

    Incredibuild claims to be able to run nmake builds on multiple cores / multiple machines. I don't have any experience of it.

    0 讨论(0)
  • 2020-12-13 00:25

    Quick googling gives: http://msdn.microsoft.com/en-us/library/bb385193.aspx

    0 讨论(0)
  • 2020-12-13 00:29

    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.

    0 讨论(0)
  • 2020-12-13 00:30

    Another generic, non-Qt-related way to tell nmake to use all the cores is to set environmental variable CL to /MP:

    set CL=/MP
    nmake
    

    will use all the CPU cores.

    0 讨论(0)
  • 2020-12-13 00:34

    This doesn't work for normal makefiles, but there is a setting in Visual Studio 2005 that lets you build more than one .vcproj file at the same time (provided one isn't dependent on the other). Tools -> Options -> Projects and Solutions -> Build and Run -> X maximum number of parallel project builds.

    0 讨论(0)
提交回复
热议问题