This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
Mathematica System Program

mcc

mcc options files
MathLink template file compiler
  • mcc is a C compiling command for creating a program for installation into Mathematica with the Mathematica command Install. The installed program communicates with Mathematica by using the MathLink protocol. The mcc command should have a MathLink template file as one of its file arguments along with ordinary C source files and object files, which encode the functions that are to be installed into Mathematica. The MathLink template filename should bear a .tm suffix.
  • The mcc script first passes the template file to the Mathematica utility mprep, which preprocesses it into a C file that uses MathLink library functions. It then invokes the compiler identified by the environment variable CC to compile and link this C file along with the other files, arguments, and the MathLink library, libML.a.
  • On operating systems that support multiple binary formats, mcc automatically links with the appropriate libML.a library.
  • mcc passes all defined options through to the C compiler, but it also treats the following options specially:
-gkeep the C file generated by mprep and pass the -g option to the C compiler to generate a symbol table for debugging
-Epass the .tm files through mprep, then run the C source files through the C compiler only, sending output to stdout
-Ppass the .tm files through mprep, then run the C source files through the C compiler only, writing the output to a file with a .i suffix
-xo namewrite the output file in name/$SystemID/name, to be located by Install["name"]