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.

  • Resolved

CCS: Program mode compilation fails

Tool/software: Code Composer Studio

There's a problem with Program Mode Compilation reproducable starting from at least CCSv5 to CCSv7 (checked myself).

If source files are located at the same directory, program mode compilation work, if creating sub-directories, or adding more source directories - it doesn't.

Compilation works normally without 'program mode compilation' option enabled.

Adding source locations to 'paths' in CDT doesn't help.

Note1: I've found the same problem existed in CCSv4.4 and wasn't resolved due to: https://e2e.ti.com/support/development_tools/compiler/f/343/t/98506

Note 2: I cannot share my project, but this bug can be reproduced easilly.

  • Hello,
    I will move your post to the compiler forum. The experts there can help you best.

    Note that responses may be a bit delayed due to the holiday season here and may people are on holiday.

    Thanks
    ki

    -----------------------------------

    Did you read the CCS Forum Guidelines & FAQ? If not, PLEASE read it. If you haven't read it in awhile, please read it again to see if any updates were made.

    Having CCS problems? Check out the CCS Troubleshooting Guide

    Looking for CCS Training? Check out the CCS Training Site

    Curious about the status of a bug and know the tracking ID? Track it via the public bug tracking portal

    NOTE: When a bug is filed and a tracking ID is provided, the thread may then be suggested as "TI Thinks Resolved". Why? Please read the first FAQ of the CCS Forum Guidelines & FAQ

  • Which TI compiler do you use?  If it supports --opt_level=4, then I recommend you not use program level optimization and use --opt_level=4 instead.  You will get optimization results that are probably even better.  And it avoids all the build time problems of program level optimization.

    Thanks and regards,

    -George


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    I've tried different compilers with the same results. Currently installed compilers versions are: 7.4.23, 8.1.4, 8.2.1, 8.2.2

    I have seen none of them supporting --opt_level=4 in the CCS interface, so I actually didn't even suppose that such level could exist. Is it possible to set it, and for which compilers if yes?

    As for generic optimizations, my code has some abstractions like calling functions by pointers. If using simple optimization, compilers spends severall instructions on loading address and jumping, if using 'program mode compilation', it's only one direct jump in most cases.

    I have either to exclude abstractions (which makes it harder to support and improve this code), or to use 'program level optimization' now. The program is time critical, so even 5% of speed improvement by above mentioned optimizations are very useful, and allow me using more complex processing.

  • Expert 4530 points

    Does your compilation also fail silently, as in the thread you cited, or is there an error message?  I'm wondering exactly what you mean when you say that compilation "doesn't work."

    Could you post the console logs from a working and a non-working case?

    Program-mode compilation operates essentially by concatenating all the source files on the command line into a single unit.  Therefore, I'd expect the log to show something like "cl6x -o -pm a.c b.c c.c d.c".  If the problem is only with subfolders, then I wonder if the subdirectory prefixes are missing or the cl6x command is broken into several commands.

  • Expert 4530 points

    In reply to pf:

    Oh, and --opt_level=4 is not supported by cl6x. It is supported for ARM, MSP430, and C2000.
  • In reply to Vladislav Vasiliev55:

    Vladislav Vasiliev55
    Currently installed compilers versions are: 7.4.23, 8.1.4, 8.2.1, 8.2.2

    I can tell from those version numbers you use the C6000 compiler.  As pf points out, this compiler does not support --opt_level=4.

    I am unable to reproduce the -pm building problem.  I put together a very simple project with CCS v7.3.  It has source files in subfolders, and uses -pm.  It builds with no problem.  It is attached at the end of this post.

    Please put together a project which demonstrates the problem.  Package it into a zip file as described in the article Project Sharing.  Attach that zip file to your next post.

    Thanks and regards,

    -George

    test_pm_tms320c6678.zip


    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Since it has been a while, I presume you have resolved the problem. I'd appreciate hearing how you resolved it.

    Thanks and regards,

    -George

    TI C/C++ Compiler Forum Moderator
    Please click This Resolved My Issue on the best reply to your question
    The CCS Youtube Channel
     has short how-to videos
    The 
    Compiler Wiki answers most common questions
    Track an issue with SDOWP. Enter your bug id in the Search box.

  • In reply to George Mock:

    Thanks for the answer. Yes, your project (suprisingly) works.
    I'll try to understand what's the difference between your and my project. If there's no obvious difference, I'm going to clean-up our project from all meaningfull details and send you a stub of it.
  • In reply to George Mock:

    Thanks for your project!

    By carefully comparing it with mine, I've discovered that my .cproject file  contains file-specific compilation options with custom build settings for some source files:

    <fileInfo>
      <tool>
        <option />
        <inputType />
      </tool>
    </fileInfo>
    

    When 'program mode compilation' is enabled code composer takes into account and compiles only those files and folders with dedicated options, and ignores all others.

    I couldn't find a way to remove those custom build options using CCS environment, but text editor helps - manually editing .cproject and removing corresponding options allows to build project.

    Thanks a lot for help!

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.