Полезная информация

23.2. How to Install Mathematica on FreeBSD

Contributed by Rich Murphey and Chuck Robey

This document shows how to install the Linux binary distribution of Mathematica 2.2 on FreeBSD 2.1.

Mathematica supports Linux but not FreeBSD as it stands. So once you have configured your system for Linux compatibility you have most of what you need to run Mathematica.

For those who already have the student edition of Mathematica for DOS the cost of upgrading to the Linux version at the time this was written, March 1996, was $45.00. It can be ordered directly from Wolfram at (217) 398-6500 and paid for by credit card.

23.2.1. Unpacking the Mathematica distribution

The binaries are currently distributed by Wolfram on CDROM. The CDROM has about a dozen tar files, each of which is a binary distribution for one of the supported architectures. The one for Linux is named LINUX.TAR. You can, for example, unpack this into /usr/local/Mathematica:

    # cd /usr/local
    # mkdir Mathematica
    # cd Mathematica
    # tar -xvf /cdrom/LINUX.TAR

23.2.2. Obtaining your Mathematica Password

Before you can run Mathematica you will have to obtain a password from Wolfram that corresponds to your ``machine ID''.

Once you have installed the Linux compatibility runtime libraries and unpacked Mathematica you can obtain the ``machine ID'' by running the program mathinfo in the Install directory.

    # cd /usr/local/Mathematica/Install
    # mathinfo
    LINUX: 'ioctl' fd=5, typ=0x89(), num=0x27 not implemented
    richc.isdn.bcm.tmc.edu   9845-03452-90255

So, for example, the ``machine ID'' of richc is 9845-03452-90255. You can ignore the message about the ioctl that is not implemented. It will not prevent Mathematica from running in any way and you can safely ignore it, though you will see the message every time you run Mathematica.

When you register with Wolfram, either by email, phone or fax, you will give them the ``machine ID'' and they will respond with a corresponding password consisting of groups of numbers. You need to add them both along with the machine name and license number in your mathpass file.

You can do this by invoking:

    # cd /usr/local/Mathematica/Install
    # math.install

It will ask you to enter your license number and the Wolfram supplied password. If you get them mixed up or for some reason the math.install fails, that is OK; you can simply edit the file mathpass in this same directory to correct the info manually.

After getting past the password, math.install will ask you if you accept the install defaults provided, or if you want to use your own. If you are like us and distrust all install programs, you probably want to specify the actual directories. Beware. Although the math.install program asks you to specify directories, it will not create them for you, so you should perhaps have a second window open with another shell so that you can create them before you give them to the install program. Or, if it fails, you can create the directories and then restart the math.install program. The directories we chose to create beforehand and specify to math.install were:

/usr/local/Mathematica/bin for binaries
/usr/local/Mathematica/man/man1 for man pages
/usr/local/Mathematica/lib/X11 for the XKeysymb file

You can also tell it to use /tmp/math.record for the system record file, where it puts logs of sessions. After this math.install will continue on to unpacking things and placing everything where it should go.

The Mathematica Notebook feature is included separately, as the X Front End, and you have to install it separately. To get the X Front End stuff correctly installed, cd into the /usr/local/Mathematica/FrontEnd directory and execute the xfe.install shell script. You will have to tell it where to put things, but you do not have to create any directories because it will use the same directories that had been created for math.install. When it finishes, there should be a new shell script in /usr/local/Mathematica/bin called mathematica.

Lastly, you need to modify each of the shell scripts that Mathematica has installed. At the beginning of every shell script in /usr/local/Mathematica/bin add the following line:

    % XKEYSYMDB=/usr/local/Mathematica/lib/X11/XKeysymDB; export XKEYSYMDB

This tells Mathematica were to find its own version of the key mapping file XKeysymDB. Without this you will get pages of error messages about missing key mappings.

On 2.1-STABLE you need to add the following as well:

    % RESOLV_HOST_CONF=/compat/linux/etc/host.conf; export RESOLV_HOST_CONF

This tells Mathematica to use the Linux version of host.conf. This file has a different syntax from FreeBSD's host.conf, so you will get an error message about /etc/host.conf if you leave this out.

You might also want to modify your /etc/manpath.config file to read the new man directory, and you may need to edit your ~/.cshrc file to add /usr/local/Mathematica/bin to your path.

That is about all it takes. With this you should be able to type mathematica and get a really slick looking Mathematica Notebook screen up. Mathematica has included the Motif user interfaces, but it is compiled in statically, so you do not need the Motif libraries. Good luck doing this yourself!

23.2.3. Bugs

The Notebook front end is known to hang sometimes when reading notebook files with an error messages similar to:

    File .../Untitled-1.mb appears to be broken for OMPR.257.0

We have not found the cause for this, but it only affects the Notebook's X Window front end, not the mathematica engine itself. So the command line interface invoked by math is unaffected by this bug.

23.2.4. Acknowledgments

A well-deserved thanks should go to Søren Schmidt and Peter Wemm who made Linux mode what it is today, and Michael Smith who drove these two guys like dogs to get it to the point where it runs Linux binaries better than Linux! :-)