Incredibuild Support has moved! Come join us at:
Parallelization of Custom Build tools and custom build rules using the .ib_profile.xml
Posted by Yoni Davidson on 08 January 2018 04:02 PM
Visual Studio 2010 and newer versions use the MSBuild engine which executes all custom build tools and custom build rules within the context of a single project in a sequential manner – on a single CPU core
For example, in the following scenario: A custom build tool running moc.exe (as in the GUI SDK QT) will be executed in a sequential manner in project A for each file that needs to be generated.
Specifying in your IncrediBuild profile a tool name (the process name – moc.exe) with the AllowPredictedBatch option will instruct IncrediBuild to execute these moc tools in parallel resulting in a significant performance boost.
Since the tool will run in a parallel manner, it can also be configured to be distributed to remote machines (please see XML sample below).
Note that the tools that can be safely accelerated with this feature must have the following characteristics:
1) Two Instances of the executable will not attempt to write to the same file (e.g. output file, log file)
2) None of the instances of the executable should be dependent on anything that the other instances do. (e.g one instance does not depend on the output file of another instance, none of the instances deletes any files or folders the other instances use).
Parallelization will be applied on the defined tools up to the point where a different executable will be invoked (CL, LINK or anything else).
To use the feature add AllowPredictedBatch="true" tool tag to your solution’s .ib_profile.xml
If your solution name file is my_solution.sln, and you would like to parallelize and distribute moc.exe execution, add the file my_solution.ib_profile.xml to the folder where my_solution.slnresides – this will apply the profile to any build of this solution ran from within the IDE. Alternatively, if building from the command line, you can use the “/profile” switch to specify the profile file:
Buildconsole my_solution.sln /rebuild /cfg=”debug|win32” /profile=”my_solution.ib_profile.xml”
Example contents of my_solution.ib_profile.xml:
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<Tool Filename="moc" AllowRemote="true" AllowPredictedBatch="true"/>