How to set the Build setting for using TI DSP compiler

CodeLite installation/troubleshooting forum
dragonway
CodeLite Curious
Posts: 3
Joined: Tue May 08, 2012 2:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

How to set the Build setting for using TI DSP compiler

Post by dragonway »

We want to use the Codelite as the DSP development IDE instead of TI's CCS in Ubantu OS, but the TI's C54x DSP C compiler must be used by Codelite. Who can tell me how to configure the "Build setting " and "debug setting" of codelite to using the C54x DSP compiler in Codelite. I also want to know how to configure the option of the compiler in Codelite.
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to set the Build setting for using TI DSP compiler

Post by eranif »

If you could provide a sample of a typical build output from the command line (compile + link) - I will be able to help you
The more the merrier...
Eran
Make sure you have read the HOW TO POST thread
dragonway
CodeLite Curious
Posts: 3
Joined: Tue May 08, 2012 2:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to set the Build setting for using TI DSP compiler

Post by dragonway »

a sample of build output with TI C compiler in windows OS is as following:

----------------------------- timer.pjt - Debug -----------------------------
[timer.c] "C:\CCStudio_v3.3\C5400\cgtools\bin\cl500" -g -q -fr"./Debug" -d"_DEBUG" -d"CHIP_5416" -mf -v548 -@"Debug.lkf" "timer.c"

[Linking...] "C:\CCStudio_v3.3\C5400\cgtools\bin\cl500" -@"Debug.lkf"
<Linking>

Build Complete,
0 Errors, 0 Warnings, 0 Remarks.


Only as a reference, The options metioned in TI C Compiler user's guide is as following:
For compiler and linker:

cl500 [options] [filenames] [-z [link_options] [object files]]

cl500 : Command that runs the compiler and the assembler
options: Options that affect the way the shell processes input files
filenames: One or more C/C++ source files, assembly source files, orobject files.
-z: Option that invokes the linker.
link_options: Options that control the linking process
object files: Name of the additional object files for the linking process

For example: cl500 -i c:\tools\files time.c -z -o prog.out -l rts500.lib

You can get this user's guide at this address: http://www.ti.com/lit/ug/spru103g/spru103g.pdf.


Note and Question:
The compiler and linker is the same one named " cl500.exe ", which is at the directory "C:\CCStudio_v3.3\C5400\cgtools\bin" in sample project.

In sample project,we want to know how to make a new compiler and configure it at the "settings--->Build setting " and "settings--->debug setting" of codelite in Codelite.

We also wonder where and how to set complier options and linker options in Codelite project when we invoke the compiler as metioned above,
for example to compiler options: "Include Search Path (-i) "or "Pre-Define Symbol(-d)" and to linker options "Search Path(-i)" or "Include Libraries (-l)" .

We need your kind assistance for these and look forward to get your advice.
Thank you very much.
dragonway
CodeLite Curious
Posts: 3
Joined: Tue May 08, 2012 2:52 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to set the Build setting for using TI DSP compiler

Post by dragonway »

Hello Eran

I have provide a sample of the command line above , can you help me?
User avatar
eranif
CodeLite Plugin
Posts: 6375
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: How to set the Build setting for using TI DSP compiler

Post by eranif »

Hi,

From "Settings > Build Settings > Compilers" click on the New button and create a new compiler.
The new compiler by default will clone the g++ settings.

Step 1: Update the tools:

First, you need to replace the GNU tools with your tools to do this:

Select your new compiler from the tree to the left and go to "Tools"
and start modifying the tools, for example (If I understand you correctly):

Code: Select all

Compiler Name:  "C:\CCStudio_v3.3\C5400\cgtools\bin\cl500"
C Compiler Name:  "C:\CCStudio_v3.3\C5400\cgtools\bin\cl500"
Linker Name:  "C:\CCStudio_v3.3\C5400\cgtools\bin\cl500" -z
Step 2: Update the file types recognized by your compiler
codelite compile files according to the patterns set under "You Compiler > File Types"

For example, to compile a "C" file, codelite will use this pattern (which you can change to fit your needs)

Code: Select all

$(C_CompilerName) $(SourceSwitch) "$(FileFullPath)" $(C_CmpOptions) $(ObjectSwitch)$(IntermediateDirectory)/$(ObjectName)$(ObjectSuffix) $(IncludePath)
The macros:
$(C_CompilerName) is taken from the Tools page "C Compiler Name" (in your case, it will be replaced with "C:\CCStudio_v3.3\C5400\cgtools\bin\cl500")
$(CompilerName) is taken from the Tools Page "Compiler Name"
$(IncludePath) is taken from the "Project settings -> Compiler -> Include Paths" (this field should contain list of include paths separated by semicolon, each search path will be prended with $(IncludeSwitch) ).
So basically you need to set the include path like this in the project settings:

Code: Select all

/some/path;/some/other/path
which will be convereted by codelite to

Code: Select all

$(IncludeSwitch)/some/path $(IncludeSwitch)/some/other/path
Step 3: Updating the switches

$(SourceSwitch), $(ObjectSwitch) and $(ObjectSuffix) from the pattern above are taken from:
"You Compiler > Switches"

Here you can modify all the default "switches".
For example, in your case, the "Include" switch should be changed from "-I" set to "-i"
and Preprocessor switch should be changed from "-D" to "-d"

Once you completed settings your compiler, simply select it to be the compiler for your project.
To do this: Right click on your project settings => Settings => General
and in the "Compiler" drop down control select you newly created compiler.

This should be enough to let you start compiling.
If you want codelite to also color the errors / warning and make them clickable, you will need to provide some errors / warnings example so I can help you convert them into a regular expressions that codelite understands


Eran
Make sure you have read the HOW TO POST thread
Post Reply