Enable parallel build in SmartSnippets

⚠️
Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at https://www.dialog-semiconductor.com/support . We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
vinio
Offline
Last seen: 3 years 11 months ago
Joined: 2018-07-02 13:27
Enable parallel build in SmartSnippets

Hello,

The compilation time of my project is very long (compared to other machines running the same SmartSnipets version/SDK/platform) so I'm trying to increase this compilation time.
When I enabled the parallel build in SmartSnippets in Project -> Properties -> C/C++ Build/ Behavior /Enable Parallel Build"
I'm getting this error message :

make[1]: warning: jobserver unavailable: using -j1. Add `+' to parent make rule.
Also the build gets stucked and won't go further..
It seems that the makefile should use the $(MAKE) variable instead of make command. But I wasn't able to find out where (in the Dialog GNu tool chain or SmartSnippets configuration ??).

I think it would increase the build time by 2 or 3 so it would be worht to find out how.

Do you know more about this ?

Thanks,
Vincent

Device: 
MHv_Dialog
Offline
Last seen: 1 year 4 months ago
Staff
Joined: 2013-12-06 15:10
Hi Vincent,

Hi Vincent,

I have requested some input from our SDK team. You should hear back shortly.

/MHv

MHv_Dialog
Offline
Last seen: 1 year 4 months ago
Staff
Joined: 2013-12-06 15:10
Hi Vincent,

Hi Vincent,

I received this information from the team:

Here is a good source of info:
https://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html#Options_002fRecursion

The ‘-j’ option is a special case (see Parallel Execution). If you set it to some numeric value ‘N’ and your operating system supports it (most any UNIX system will; others typically won’t), the parent make and all the sub-makes will communicate to ensure that there are only ‘N’ jobs running at the same time between them all. Note that any job that is marked recursive (see Instead of Executing Recipes) doesn’t count against the total jobs (otherwise we could get ‘N’ sub-makes running and have no slots left over for any real work!)

If your operating system doesn’t support the above communication, then no ‘-j’ is added to MAKEFLAGS, so that sub-makes run in non-parallel mode. If the ‘-j’ option were passed down to sub-makes you would get many more jobs running in parallel than you asked for. If you give ‘-j’ with no numeric argument, meaning to run as many jobs as possible in parallel, this is passed down, since multiple infinities are no more than one.

In fact that warning means that GNU make is unable to properly handle parallel builds since it does not know how to discipline the build.
It also tells you that it is going to use -j1 and that you should add a plus sign to the “parent make rule”.
That is controlled by makefile autogenerated by SS studio, and it is visible on windows.
You can work around this by calling make --silent -j pre-build main-build -> Use unlimited jobs instead.

Sample output:

make --silent -j pre-build main-build
Generate linker scripts.
Invoking: Cross ARM GNU Print Size
text data bss dec hex filename
91240 112 24616 115968 1c500 pxp_reporter.elf
Finished building: pxp_reporter.siz

/MHv

vinio
Offline
Last seen: 3 years 11 months ago
Joined: 2018-07-02 13:27
Passing just -j option works

Passing just -j option works so well !! I takes just 2 mins to build the whole platform where it took 8 mins before.

Thanks for your support!