This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Quick (Easy) tip for speeding up project builds in CCS

Other Parts Discussed in Thread: HALCOGEN

This tip isn't anything 'new' but it's not the default setting and it makes a big difference for me so thought I'd pass it on.

Since CCS uses gmake to build, if you have a recent computer (multicore CPU) you can set the build parallelism by adding the -jN option to your command line.   Uncheck 'Use default build command'  in the project properties  'Build' / Builer tab and change the command line to something like:

${CCS_UTILS_DIR}/bin/gmake -j4 -k

Which works for my 2 core 4 thread i5.    It cuts down a HalCoGen project build (rebuild all) time from about 1:50 to 0.45.

Wish I had an i7 :)

 

  • Hi Anthony,

    I've just tried this technique and can see that it would work well to improve build times.

    Unfortunately, I seem to have run into a problem with it. I run a pre-build batch file and also have a makefile.targets defined, both of which prepare inputs necessary for my build, and they must complete prior to any compilation.

    With build parallelism configured, the natural flow and dependencies are disrupted, and the compilation zooms off in parallel to the pre-build and makefile.targets.

    Am I able to force the compilation stage to hold off until both pre-build and makefile.targets are complete?

    Incidentally, I have to insert a space between the 'j' and number of processors on the command line (so '-j 4' in your example, rather than '-j4').

    And... I do have an i7! What a difference it makes, 8 threads, so thanks for pointing out this very handy tip.

    Regards, Tony.

  • Hi Tony,

    I'm not sure about the pre-build and post-build steps - we can investigate.  I haven't checked the CCS forum for this yet and that would probably be the first place to start.

    I posted this after having a 'duh' moment after waiting over and over again for all the regenerated HalCoGen files to compile.  It just dawned on me that if we're using GNU make and gnu make has a parallel build option then this should work.  Was pretty happy to see the speed up and thought that since it's not set to parallel by default there are probably other people who might be missing this too.


    There is actually even more information about building here http://processors.wiki.ti.com/index.php/Projects_and_Build_Handbook_for_CCS#Parallel_builds

    And they show a different way to turn on the parallel build.  I don't know if it matters but you could try that and see if it helps the pre/post build.

    The i7 comment comes from trying to increase past -j 4 ... I didn't see any improvement on my PC.  I also started daydreaming about how much faster it might be on a server w. dual hex-core CPUs... :)

    There are a lot of posts on the internet if you google 'gnu make parallel' at sites like stackoverflow and various blogs that talk about gnu make pitfalls when you run in parallel mode - if you've got issues in the way dependencies are specified.  So depending on what is in the pre/post build steps that you've got maybe the issue is related there as well.  

    Are you getting any sense that there is an issue 'inside' the build steps controlled by CCS's generated makefile for the build --- or just in the boundaries between the main build and the pre/post build steps that you've got setup?

  • Hi Anthony,

    Thanks for all the pointers, I'll have a poke around later today to see what I can find, when I get the time ironically!

    I don't think this is an issue with CCS's makefile or that part of the process, it will be something to do with the GNU make I suspect, some attribute needs defining in some manner.

    I'll update this post if I find anything.

    Regards, Tony.

  • Hi Tony,

    Posting to the CCS forum might also be a good idea -  http://e2e.ti.com/support/development_tools/code_composer_studio/f/81.aspx

    The folks monitoring this forum are really good w. Eclipse.

  • For those interested, I posted this on the CCS forum and they report fixed in CCS 5.4:

    http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/t/356074.aspx

    Regards, Tony.

  • All,

    Note that if you are using a pre-build step, then you cannot specify the number of processors with a literal number. Instead use the 'unlimited number of jobs' option '-j'.

    This is a bug and is under investigation (SDSCM00050659). Again, refer to my related post above for more details.

    Regards, Tony.