Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'How to compile this code into an exe ?' topicStudent Support Forum > General > Archives > "How to compile this code into an exe ?"

< Previous CommentHelp | Reply To Comment | Reply To Topic
Author Comment/Response
Forum Moderator
email me
02/25/12 4:11pm

Import, Solve, other big functions can be compiled for internal use, but since they need Mathematica to run, they cannot be converted to C and compiled separately.

Modifying the simple example from http://reference.wolfram.com/mathematica/Compile/tutorial/Introduction.html#959405935:

In[4]:= cFun = Compile[{{x}}, x^2 + Import["demo.dat"] ]

Out[4]= CompiledFunction[{x},x^2+Import[demo.dat],-CompiledCode-]

In[5]:= ExportString[cFun,"C"]

CCodeGenerate::wmreq: The expression Function[{x},Import[demo.dat]] requires Mathematica to be evaluated. The function will be generated but can be expected to fail with a nonzero error code when executed. >>



URL: ,

Subject (listing for 'How to compile this code into an exe ?')
Author Date Posted
How to compile this code into an exe ? Bishshoy Das 02/23/12 3:34pm
Re: How to compile this code into an exe ? Nasser M. Ab... 02/24/12 6:26pm
Re: How to compile this code into an exe ? Forum Modera... 02/24/12 8:20pm
Re: Re: How to compile this code into an exe ? Bishshoy Das 02/25/12 05:36am
Re: How to compile this code into an exe ? Forum Modera... 02/25/12 4:11pm
< Previous CommentHelp | Reply To Comment | Reply To Topic