generates C code from the compiled function cfun using the name as the exported function name, and saves in the file name.c.

generates output in filename.

generates C code from several compiled functions and saves in filename.


  • To use , you first need to load it using Needs["CCodeGenerator`"].
  • can make standalone code or a Wolfram Library.
  • Mathematica contains the necessary headers and libraries for standalone code.
  • You can generate a header for the generated code by setting to .
  • The following option can be given:
  • "CodeTarget""WolframRTL"the type of code to generate

ExamplesExamplesopen allclose all

Basic Examples (1)Basic Examples (1)

First, load the package:

Click for copyable input

Generate C code into a file:

Click for copyable input

Display the file of C code:

Generate code from two compiled functions:

Click for copyable input

Display the file of C code:

New to Mathematica? Find your learning path »
Have a question? Ask support »