multi-core compiling

Sysprogs forums Forums VisualGDB multi-core compiling

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #6270
    michael.s
    Participant

    I use VisualGDB to crosscompile for the Raspberry. One of the reasons is obviously to speed up the compilation. When I compile my project, I notice that my CPU usage is only between 35-45% and each job seems to be startet consecutivly, like this:

    1>  C:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -c -pipe -Wno-psabi -std=c++11 -w -g -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_WEBKIT -DQT_GUI_LIB -DQT_CORE_LIB -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/share/qt4/mkspecs/arm-linux-gnueabihf -I. -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtCore -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtGui -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4 -Ic:/SysGCC/raspberry/arm-linux-gnueabihf/sysroot/usr/local/include -IDebug -IDebug -o Debug/MemberData.o Base/MemberData.cpp
    1>  C:/SysGCC/raspberry/bin/arm-linux-gnueabihf-g++.exe -c -pipe -Wno-psabi -std=c++11 -w -g -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_WEBKIT -DQT_GUI_LIB -DQT_CORE_LIB -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/share/qt4/mkspecs/arm-linux-gnueabihf -I. -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtCore -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4/QtGui -Ic:/sysgcc/raspberry/arm-linux-gnueabihf/sysroot/usr/include/qt4 -Ic:/SysGCC/raspberry/arm-linux-gnueabihf/sysroot/usr/local/include -IDebug -IDebug -o Debug/Message.o Base/Message.cpp

    compiling under a SDD the bottleneck here is probably not the hdd, but the insufficient use of all the cores. under VS i could normally add the -MPXX flag or with make the ‘-j’ flag. how can i speed it up using virtualGDB

    thanks

    #6291
    support
    Keymaster

    Hi,

    Simply add “-j <number of cores>” to the Make command line arguments in VisualGDB Project Properties to enable parallel building.

    #8627
    b.timofte
    Participant

    Where should i add this option ? Your answer is not clear

    #8629
    support
    Keymaster

    Hi,

    Sorry for the confusion. Please refer to the screenshot below for details:

    Note that $(LocalMultiThreadedBuildFlags) is case-sensitive. It will automatically be replaced with -j(number of CPU cores on your machine) during build.

    #8897
    thm
    Participant

    Thanks, this makes a huge difference.

    Is there a reason why its not enabled by default for new projects?

    #8898
    support
    Keymaster

    Hi,

    Yes, it sometimes causes Make to simply hang. VisualGDB 5.2 will come with a separate MSBuild platform that will integrate the existing toolchains directly into the Visual Studio build system, so the multi-threaded build will be automatic and it won’t trigger the Make bug.

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