Group Abstract Group Abstract

Message Boards Message Boards

Finding the mdefs.h C header file to utilize Cform function output

POSTED BY: Ed di Girolamo
4 Replies

Great, That command worked. I have an additional question. In using CForm[] there are macros that are used not in the mdefs.h file. Nor do the other .h files in the same directory seem to hold them (I could be wrong, but no success with a grep search on the contents of the folder for macros labelled "List or InterpolatingFunction". Where would I find more of the appropriate header files?

POSTED BY: Ed di Girolamo

Do you have an example of such a macro? Keep in mind that the scope of CForm is very limited, it only understands a tiny subset of the language and in most cases its output will not actually be compilable C code. See also the C code generation tutorial in the documentation for what is feasible in terms of generated code (interpolating functions are definitely not).

POSTED BY: Ilian Gachevski

I have been attempting to try various simple functions but the C code generation tutorial will help me sort it out for my next actual project. Thank you for that resource and link!

POSTED BY: Ed di Girolamo

Try evaluating FileNames["mdefs.h", $InstallationDirectory, Infinity]

POSTED BY: Ilian Gachevski
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard