Multi-core compiling

Sysprogs forums Forums VisualGDB Multi-core compiling

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #12032
    Steve
    Participant

    I have a large cmake project, I want to build it using multiple cores because it takes a long time. I tried to do this by adding the “-j” flag to the settings as follows:

    However, when I start building, only one core is being used. In task manager I see a single instance of “cc1plus.exe” using 25% of my cpu (=1 out of 4 cores) and no other processes doing significant work. How do I compile with multiple cores?

    #12036
    support
    Keymaster

    Hi,

    This could happen if your Makefile contained a target structure that cannot be easily parallelized. Also the MinGW Make has a bug that often hangs it when using multi-core mode. Our best advice would be to try switching the project to MSBuild. It’s not officially supported for MinGW/Cygwin projects, however if you add the ‘VisualGDB’ platform to the project and manually enter the toolchain location via VS project properties, VisualGDB should pick it up. MSBuild does not rely on Make for local builds, so it will work much faster. If it does not work, let us know and we will try to help.

    #12083
    Steve
    Participant

    Thanks, I tried MSBuild earlier but had trouble getting my code to compile there. I might ask later about that if I have the need.

    Instead I replaced the “$(VISUALGDB_DIR)\make.exe” in the make command with “C:\msys64\usr\bin\make.exe” and now it is utilizing 100% of my cpu and seems to work fine.

    #12089
    support
    Keymaster

    Hi,

    That could do as well. Either way, if you decide to give MSBuild a try, let us know and we will help you set it up.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.