Reply
Posts: 5
Registered: ‎03-28-2017

Pre-build generated files are not compiled in parallel build

I have a python script which generates some C source and header files. When I turn off parallel build, I only need to compile once. When I turn on parallel builds, I have to compile twice as the generated source files seem to get missed by the first build. Since there can be significant differences in build times between parallel and non-parallel builds I'd prefer to use parallel builds so I end up compiling twice. The generated files are not always generated as they are only generated when I make changes to a text file that the files are generated from.

Posts: 439
Registered: ‎12-05-2016

Re: Pre-build generated files are not compiled in parallel build

Hi @strawbot,

 

So the python script is run and then the project is built within Studio?  Is the project "Refreshed" before it is built? (right click the project folder and select "Refresh")

 

Thank you,

jpitt

Posts: 5
Registered: ‎03-28-2017

Re: Pre-build generated files are not compiled in parallel build

The python script is run as a pre-build step. I press the hammer to build the application and the pre-build step updates (only if needed) source and header files and the build proceeds. If the parallel build check box is checked, then the updated files are not compiled and I have to press the hammer a second time.

Posts: 439
Registered: ‎12-05-2016

Re: Pre-build generated files are not compiled in parallel build

Hi @strawbot,

 

It turns out this is a known issue with the Eclipse CDT builder: ( https://bugs.eclipse.org/bugs/show_bug.cgi?id=340300 ).  There a couple of workarounds suggested:

1. Add your own builder that runs the pre-build python script and that gets invoked before the CDT Builder.

2. 

1. Add a makefile.init in the project root with the following content:
   allwithpre : 
       $(MAKE) --no-print-directory pre-build
       $(MAKE) --no-print-directory main-build
2. Remove the pre-build task from the configuration
3. In the project settings, C/C++ Build -> Behavior -> Workbench Build
   Behavior, Change "all" to "allwithpre"

The first option might be easier to do with Simplicity Studio.

 

Thank you,

jpitt

Posts: 5
Registered: ‎03-28-2017

Re: Pre-build generated files are not compiled in parallel build

1. don't know how to do that

2. I can try that

 

Looks like CDT 9.3 might be released in June and it might address that issue.

Posts: 439
Registered: ‎12-05-2016

Re: Pre-build generated files are not compiled in parallel build

Hi @strawbot,

 

Yes CDT 9.3 should be released fairly soon, but I'm not sure when the update will be incorporated into Simplicity Studio.

 

As far as creating your own eclipse builder there are some examples available on the web if you want to go down that path.

 

Thank you,

jpitt