Installing Existing MathLink-Compatible Programs

One of the most common uses of MathLink is to allow you to call functions in an external program from within Mathematica. Once the external program has been set up, all you need do to be able to use it is to "install" it in your current Mathematica session.

Install["prog"]install a MathLink-compatible external program
Uninstall[link]uninstall the program

Setting up external programs with functions to be called from within Mathematica.

This installs a MathLink-compatible external program called .
In[1]:=
Click for copyable input
Out[1]=
is one of the functions inside .
In[2]:=
Click for copyable input
Out[2]=
You can use it just as you would a function within Mathematica.
In[3]:=
Click for copyable input
Out[3]=

When you have a package written in the Mathematica language a single version will run unchanged on any computer system. But external programs typically need to be compiled separately for every different type of computer.

Mathematica has a convention of keeping versions of external programs in directories that are named after the types of computers on which they will run. And assuming that this convention has been followed, Install["prog"] should always install the version of prog appropriate for the particular kind of computer that you are currently using.

Install["name`"]install a program found anywhere on $Path

Using context names to specify programs to install.

When you ask to read in a Mathematica language file using , Mathematica will automatically search all directories in the list $Path in order to find a file with the appropriate name. Similarly, if you use Install["name`"] Mathematica will automatically search all directories in $Path in order to find an external program with the name name.exe. Install["name`"] allows you to install programs that are stored in a central directory without explicitly having to specify their location.

New to Mathematica? Find your learning path »
Have a question? Ask support »