MathGroup Archive 2003

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

Search the Archive

Re: linking package

  • To: mathgroup at smc.vnet.net
  • Subject: [mg40691] Re: [mg40644] linking package
  • From: "Y.A.Tesiram" <yas at pcomm.hfi.unimelb.edu.au>
  • Date: Mon, 14 Apr 2003 04:00:24 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,
You can Install the mathlink program inside your package. Below is a shell
(template) of what a package may look like that relies on a mathlink
program.

(* CVS info can go here right at the top of the package *)

(* Your name *)

(* Other stuff. *)

(* See Roman Maeders book on Programming in Mathematica or look in the
folder AddOns->ExtraPackages->Programming in Mathematica-> Template.nb for
more info
*)

BeginPackage["YourPackage"]

somefunction::usage = " I think you called this an executable but I am
assuming you meant a function that relies on your mathlink program that
will be used in a function to do something that is really interesting for
you"

Begin["`Private`"]
Install["TheNameOfYourBinary"]

somefunction[arg1_, arg2] := Module[{}

do your calculations here

]


End[]
Protect[somefunction] (* optional during developemet *)
EndPackage[]

There are a few other ways to write packages but this may be of help you
get a quick start.
To use it in a notebook, load it in as you would any Mathematica package.
But make sure that you keep the executable in the same folder as the
package itself otherwise you have to write in your package the path to the
executable.

Regards
Yas



On Sat, 12 Apr 2003, Jan Schmedes wrote:

> dear all,
>
> using mathlink i produced an executable (under windowsXP,mathematica 4.0)
> out of C code
> which can be linked in a notebook using LinkConnect[] and Install[].
> I want to create a mathematica-package which severel executables.Can
> anybody can give
> me a hint were i can found information on creation of packages which
> implement such executables created with mathlink??
>
> Thanks and best regards
>
> J. Schmedes
>
>
>



  • Prev by Date: Re: Simplification of definite integral?
  • Next by Date: Re: Re: Changing the head of the elements of an Imported list
  • Previous by thread: Re: linking package
  • Next by thread: NDAESolve