LPCXpresso 6.1.0 executing pre-build in parallel with main-build

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPCXpresso 6.1.0 executing pre-build in parallel with main-build

338 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by twhittam on Fri Nov 29 03:12:09 MST 2013
I'm using a pre-build step

cd "..\..\..\Rolo_003\modules\version"; cmd /c "genver.bat"


to generate version strings before I build my target.

It works correctly except for one thing: it is run in parallel with the main build. It is started first, but does not complete before the main build starts.

I have parallel build enabled, but this should not be applied to the pre-build which by definition has to be completed before starting the main build.

Below is the console output from the build. The command echo genver.bat finished has been added to genver.bat to allow me to see when it finishes. It is clear that make compiles versionstring.c and links the program before genver.bat finishes.

make -j4 pre-build main-build 
Generate version strings.
cd "..\..\..\Rolo_003\modules\version"; cmd /c "genver.bat"
Building file: C:/rolofw/Rolo_003/modules/version/src/versionstring.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ ... versionstring.c
 
Building target: Nougat_K_M4.axf
Invoking: MCU Linker
arm-none-eabi-gcc ... -o "Nougat_K_M4.axf" ...
genver.bat finished
 
Finished building target: Nougat_K_M4.axf


I think the reason make does this is that it is being given a list of targets to build. It is then free to build them in parallel since to has not been told that one is dependent on the other. Another Eclipse environment I use operates correctly by telling make to build target all and in the makefile it list pre-build and main-build as commands to build target all.

Is there a known workaround for this or do I have to restrict my environment to non-parallel builds?
0 Kudos
4 Replies

308 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by twhittam on Fri Nov 29 08:23:20 MST 2013
OK I have the separate project idea implemented and working.

Thanks for the suggestion,
0 Kudos

308 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri Nov 29 06:55:58 MST 2013
As a workaround, could you create another project whose sole purpose was to create the version information? This project would then be a "Project Reference" of each other project. In theory, you could then use Parallel build on you 'main' build, but use non-parallel build for the versioning project.

I'm not sure if this would work, but it is probably worth a try.
0 Kudos

308 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by twhittam on Fri Nov 29 06:48:36 MST 2013
Thanks for the super-fast response and the tip.

The CDT bug described is the same as the behaviour I'm seeing, so I have tried applying the workaround suggested, but the behaviour is for some reason unchanged.

I have checked that the file created is in fact being included by the main makefile (make gave an error when I deliberately put an error in the file), and that the content is exactly as suggested.

I guess I'll just have to keep parallel build disabled.
0 Kudos

308 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri Nov 29 05:34:38 MST 2013
Please take a look at this Eclipse/CDT bug report. There is a suggested workaround in the last comment:

https://bugs.eclipse.org/bugs/show_bug.cgi?id=340300
0 Kudos