CCodeGenerator`
CCodeGenerator`

CCodeStringGenerate

CCodeStringGenerate[cfun,name,opts]

generates C code from the compiled function cfun using the name as the exported function name.

更多信息和选项更多信息
  • To use CCodeStringGenerate, you first need to load it using Needs["CCodeGenerator`"].
  • CCodeStringGenerate can make standalone code or a Wolfram Library.
  • The Wolfram Language contains the necessary headers and libraries for standalone code.
  • You can generate a header for the generated code by setting "CodeTarget" to "WolframRTLHeader".
  • The following option can be given:
  • "CodeTarget""WolframRTL"the type of code to generate
  • 范例

    基本范例  (1)

    First, load the package:

    In[1]:=
    Click for copyable input

    Generate a string of C code:

    In[2]:=
    Click for copyable input
    Out[2]=

    Generate code from two compiled functions:

    In[3]:=
    Click for copyable input
    Out[3]=

    参见

    CCodeGenerate  SymbolicCGenerate  LibraryGenerate

    教程