MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: outputting C code

  • To: mathgroup at smc.vnet.net
  • Subject: [mg116767] Re: outputting C code
  • From: Albert Retey <awnl at gmx-topmail.de>
  • Date: Sat, 26 Feb 2011 06:09:39 -0500 (EST)
  • References: <ik2qo1$ar9$1@smc.vnet.net> <ik5f8b$sjs$1@smc.vnet.net>

Hi,

> It looks like I am able to create some code for external use.
> However, I wonder if enough code is generated or if some is in byte
> code for that platform.  Let me elaborate.  I want to know if it is
> possible to create a function that calls built-in Mathematica
> functions, and use this in an external software package.
> 
> For example,  if I have an application meant for use on an Android
> device, is it possible for Mathematica to give me all I need to
> generate a Java library, or C source code that can be compiled for a
> Java device?  As compilation is device dependent, it seems it might be
> limited to the device on which Mathematica is running.  If you have
> Mathematica for Windows, it generates Windows code, if on a Mac, it
> generates Mac code.  Is this correct, or is there a way to get all I
> need to run on an Android, Palm, or iphone?

While I think the generated C-Code should probably be compilable for
other platforms the problem that you can not solve without Wolfram is
that you will need to link to the Wolfram RTL library (that's the
"Libraries" -> "WolframRTL_Static_Minimal.lib" part in
CCodeGenerator/tutorial/Examples#119837896). AFAIK Android and Palm's
WebOS are basically Linux-Distributions but since they typically running
on ARM processors you can not use the (binary) libraries that come with
the Linux version of Mathematica (which I think is only available for
the x86/x64 architectures). For the iPhone I'm not even sure if there
are C-Compilers and standard libraries available (officially), I think
Apple insisted on apps to be programmed in Objective C until very
recently...

As long as Wolfram Research does not provide the Wolfram RTL libraries
for these architectures, you are out of luck. Does anyone know whether
binaries for these architecture are available or planned to be made
available or did I get something wrong with the above?

hth,

albert


  • Prev by Date: Re: Custom stylesheet based on "NaturalColor"
  • Next by Date: Re: How to local files on ParallelKernels
  • Previous by thread: Re: outputting C code
  • Next by thread: Re: outputting C code