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.

Complex floating point numbers in ccsv5

Other Parts Discussed in Thread: TMS320C6678

Hi,

I am working on a project that uses an array of complex floating point numbers. My C code works fine in other C compilers, but gives me " could not open source file "complex.h"  in  main.c" error, when I build it in ccs.

Can you please refer me to some material/links that can help me implement complex values in ccsv5?


Thank you for your help and time.


Thanks!

  • Hi Ashley,

    Thanks for the post.

    Could you please provide your source code for review? Also, compiler forum should be the correct forum to discuss about this topic.

    I will move your thread to compiler forum.

  • Hi, Ashley.

    Ashley said:

    My C code works fine in other C compilers, but gives me " could not open source file "complex.h"  in  main.c" error, when I build it in ccs. 

    at first maybe this link will be useful for you http://processors.wiki.ti.com/index.php/Include_paths_and_options.

    Regards,

    Igor

  • Only recent releases of TI compilers support complex.h.  Which compiler are you using, and what version?  Note the compiler version is different from the CCS version.

    Thanks and regards,

    -George

  • Hi Rajasekaran,

    Thank you for your reply. Please review the attached C - code at your earliest convenience.

    Thank you for your time and I really appreciate your help.

  • Hi Igor,

    Thank you for your reply. I looked in to the mentioned link earlier, but I am unable to find any files for "complex numbers", that can be included in the path. But, I will go through the link once again to make sure that I am doing it correct.


    Thanks for your help once again!

  • Hi George,


    Thank you for your response. I am using C6000 Compiler Tools  and  7.3.4  version (I am currently working on TMS320C6678). I am also attaching a screen shot of the window, from which I got the compiler info.

    If the above details are not exactly what you are looking for, I would appreciate if you can guide me to provide you with the correct information.


    Thanks!

    TI_compiler.docx
  • The C6000 compiler introduces support for complex.h in release 7.4.0.  You need to upgrade your compiler.  You may as well update to the latest 7.4.x release, which is currently 7.4.6.  Please see this wiki article to see how to upgrade.

    Thanks and regards,

    -George

  • Hello!

    As soon as we work with DSPs, getting result is rarely the goal. Instead, we want the result in time, often real-time. Complex data types from complex.h is what may slow down your app. Please refer to http://e2e.ti.com/support/dsp/c6000_multi-core_dsps/f/639/t/273221.aspx. Luckily, __float2_t container and rich set of intrinsics to handle it make life much better.

  • Hi George,

    Thank you very much for your advice. I was able to upgrade the C6000 code generation tool (cgt) to 7.4.6 version. I had some creating output sections errors and memory range overlap existing errors. But, I was able to fix them with the help of other threads on the TI forum. Now I am getting the expected output. Thanks alot!

  • Hi rrlagic,


    Thank you for your response. Yes, its very true that we need the outputs on time in Real time systems. I am a newbie and currently trying to use the available complex.h file in ccs.

    I am also looking at the "complex types" link you have provided and will try to implement my code efficiently.

    Thank you very much for your guidance.