We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

AR# 39608

How do I compile core C-Model MEX functions for my platform?


How do I compile core C-Model MEX functions for my platform?


The steps for compiling the MEX function are documented in the User Guide for the core C-Models. This Answer Record is to provide more details on where to obtain information about the compilers that are compatible with MATLAB, and how to set it up with MATLAB in order to compile the MEX function.

MATLAB supports various compilers, and a complete list for the latest release of MATLAB can be found at:

If you want a list for a different version of MATLAB, please search the MathWorks website.


Most Linux distributions come with a GCC (Free) compiler installed. This can be used with MATLAB to compile the MEX function provided.
Here is an example, you start with the command line and make sure you can compile.
  >m1 -64 14.2
  >run_matlab R2012a
  >cd /path/to/project/fir_compiler_v6_3_bitacc_cmodel_nt64_standalone
  >gcc run_bitacc_cmodel.c -o run_bitacc_cmodel -I. -L. -lgmp -lIp_fir_compiler_v6_3_bitacc_cmodel

Then you launch Matlab and setup the compiler and run the provided scripts:
  %mex -setup


It is recommended that you use Visual Studio (Visual C++) or Visual C++ Express Edition (Free) from Microsoft. MathWorks provides more information on these compilers from their list of supported compilers above.

AR# 39608
Date 05/23/2014
Status Archive
Type General Article
  • Fast Fourier Transform
  • Discrete Fourier Transform (DFT)
Page Bookmarked