Why can't the MEX function compile the TI C6000 intrinsic functions used in C files that includes the header c6x.h from TI?

1 view (last 30 days)
I'm trying to generate MEX files for some C source codes which contain some TI C6000 intrinsic functions. Although the headers include the TI c6x.h header, it still generates data type errors when compiling and generating the mex files using MEX command.
The compiler used for C in Matlab is MinGW64. I would assume that the TI functions used in the C source code files cannot be interpreted and compiled by MinGW64 compiler.
Is there any way to use TI C6000 compiler for MEX (C) applications in MATLAB?
Would appreciate any possible solutions or recommendations to integrate the TI C6000 intrinsic functions within MATLAB environment.

Accepted Answer

Vidip Jain
Vidip Jain on 20 Mar 2023
It is not possible to use the TI C6000 compiler directly with MATLAB's MEX command. However, there are some alternatives you can consider:
  1. Use the TI Code Composer Studio (CCS) IDE to compile your C source code and generate the necessary object files. You can then use the MEX command to link these object files with your MATLAB code.
  2. Another option is to use MATLAB's Embedded Coder, which generates C code from MATLAB code. You can then use the TI C6000 compiler to compile the generated C code. This approach may require some modifications to your original code to make it compatible with the Embedded Coder.
  3. Finally, you could consider rewriting the code that uses TI C6000 intrinsic functions in a way that is compatible with the MinGW64 compiler. This may involve using alternative functions or implementing your own functions that achieve the same functionality.
  1 Comment
Mahmoud Azhari
Mahmoud Azhari on 21 Mar 2023
Thanks for the information. I ended up using option 3) long time ago, by getting the implementations of the intrinsic functions used by TI C6000 and now it's compiling on MATLAB using MinGW64 compiler.

Sign in to comment.

More Answers (0)

Products


Release

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!