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.

Compiler/TMS320C6713: Optimization Options

Part Number: TMS320C6713

Tool/software: TI C/C++ Compiler

Hi all,

I need to specify the optimization only for certain files while I wish to leave the rest unoptimized. Does anyone have an idea about the options I should specify in the makefile so that I can apply -o2 only on two files such as File1.c and File2.c. I know that I can do this in CCS IDE by playing with the build options of these files only; yet I need to do this through the makefile rather than through the IDE.

In detail, I generate an application for C6713 using MATLAB/Simulink r2015b and using "Texas Instruments Code Composer Studio v5 (makefile generation only)" as the IDE/Toolchain. I can manually enter so-called "Compiler options string" to be copied to the makefile so that the output is generated accordingly. I was able to specify -o2 by inputting "opt_level=2" at that part for the whole project so that optimization is carried out for all files in the project.

Thanks for your help in advance.

  • Nusrettin Gulec said:
    I generate an application for C6713 using MATLAB/Simulink r2015b and using "Texas Instruments Code Composer Studio v5 (makefile generation only)" as the IDE/Toolchain.

    I presume this means your makefile is automatically generated by MATLAB.  None of us compiler experts are familiar with MATLAB, or this feature.  Perhaps there is a way to ask MathWorks your question.

    Thanks and regards,

    -George

  • Hi George and Brian,

    Thanks for your directions; I will be trying to connect Mathworks on the issue indeed.

    However, I believe I misguided you guys by my first paragraph (completely my fault when I read it now). The thing I am trying to learn here, I believe, is not related to MATLAB. If not, I will be waiting for Mathworks to respond anyway. Thanks for your patience in reading the sequel.

    I'll try to put it as simple as possible: I do have a makefile that contains the line:

    COMPILER_CODEGEN_ARGS := -I"C:/Program Files/MATLAB/R2015b/toolbox/idelink/extensions/ticcs/inc" -I"C:/Users/sst ism/Documents/MATLAB/c6713/Nusret_6713_ticcs" -I"C:/Users/sst ism/Documents/MATLAB/c6713" -I"C:/Program Files/MATLAB/R2015b/extern/include" -I"C:/Program Files/MATLAB/R2015b/simulink/include" -I"C:/Program Files/MATLAB/R2015b/rtw/c/src" -I"C:/Program Files/MATLAB/R2015b/rtw/c/src/ext_mode/common" -I"C:/Program Files/MATLAB/R2015b/rtw/c/ert" --opt_level=2 -D"CHIP_6713" -D"__TICCSC__" -D"RT" -D"USE_RTMODEL" -mv6710 -D"MODEL=Nusret_6713" -D"NUMST=1" -D"NCSTATES=0" -D"HAVESTDIO=" -D"ONESTEPFCN=1" -D"TERMFCN=1" -D"MAT_FILE=0" -D"MULTI_INSTANCE_CODE=0" -D"INTEGER_CODE=0" -D"MT=0" -D"CLASSIC_INTERFACE=0" -D"ALLOCATIONFCN=0" -D"TID01EQ=0"

    where the stressed part triggers optimization level 2 during compilation (at least to my understanding). I wonder how I should be editing this part so that compiler optimization is enabled only for a single file; say MyFile.c (if that's possible by any means).

    Thank you for your help.

  • This question is about make, and not the TI compiler.  As such, you are in the wrong forum.  I'll make a few general comments that may help.

    One approach that comes to mind  ... Create another make variable, say OPT_ARGS.  OPTS_ARGS is different based on what file is being compiled.  Wherever the present $(COMPILER_CODEGEN_ARGS) appears, $(OPT_ARGS) needs to appear as well.  For more help with this, please consult your favorite book or website about make.

    Thanks and regards,

    -George

  • Hello George,

    Sorry for the lack of discrimination between make and TI compiler on my side; I am too novice about the issues as I pointed out.

    Thanks for your directions once again. I will try to go on with OPT_ARGS and try to resolve my issue elsewhere beyond this point.

    Regards,