Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

System Administration Guide: Wolfram Mathematica Tutorial Collection

Download as pdf or txt
Download as pdf or txt
You are on page 1of 156

Wolfram Mathematica Tutorial Collection

SYSTEM ADMINISTRATION GUIDE


For use with Wolfram Mathematica® 7.0 and later.

For the latest updates and corrections to this manual:


visit reference.wolfram.com
For information on additional copies of this documentation:
visit the Customer Service website at www.wolfram.com/services/customerservice
or email Customer Service at info@wolfram.com
Comments on this manual are welcomed at:
comments@wolfram.com

Printed in the United States of America.


15 14 13 12 11 10 9 8 7 6 5 4 3 2

©2008 Wolfram Research, Inc.


All rights reserved. No part of this document may be reproduced or transmitted, in any form or by any means,
electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of the copyright
holder.
Wolfram Research is the holder of the copyright to the Wolfram Mathematica software system ("Software") described
in this document, including without limitation such aspects of the system as its code, structure, sequence,
organization, “look and feel,” programming language, and compilation of command names. Use of the Software
unless pursuant to the terms of a license granted by Wolfram Research or as otherwise authorized by law is an
infringement of the copyright.
Wolfram Research, Inc. and Wolfram Media, Inc. ("Wolfram") make no representations, express,
statutory, or implied, with respect to the Software (or any aspect thereof), including, without limitation,
any implied warranties of merchantability, interoperability, or fitness for a particular purpose, all of which
are expressly disclaimed. Wolfram does not warrant that the functions of the Software will meet your
requirements or that the operation of the Software will be uninterrupted or error free. As such, Wolfram
does not recommend the use of the software described in this document for applications in which errors
or omissions could threaten life, injury or significant loss.
Mathematica, MathLink, and MathSource are registered trademarks of Wolfram Research, Inc. J/Link, MathLM,
.NET/Link, and webMathematica are trademarks of Wolfram Research, Inc. Windows is a registered trademark of
Microsoft Corporation in the United States and other countries. Macintosh is a registered trademark of Apple
Computer, Inc. All other trademarks used herein are the property of their respective owners. Mathematica is not
associated with Mathematica Policy Research, Inc.
System Administration for Network Licenses

MathLM
What Is MathLM? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Installing MathLM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Launching MathLM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Logging MathLM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Monitoring MathLM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
Restricting and Reserving Licenses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Troubleshooting MathLM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38

Mathematica
Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Unix and Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84

System Administration for Single-Machine


Licenses

Mathematica
Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99
Unix and Linux . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Mac OS X . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
System Administration for
Network Licenses
System Administration for Network Licenses 3

MathLM
What Is MathLM?
MathLM administers licenses for organizations running multiple instances of Mathematica with a
network license. Network licenses have two very important advantages:

† Network licenses provide a cost-effective way of making Mathematica available to multiple


client machines in a networked environment. Instead of a separate license for each
machine, a network license allows a specified number of copies of Mathematica to run
concurrently on the network.

† Network licenses provide a convenient way of using gridMathematica to make powerful


parallel computations on 16 or more kernels in a networked environment. Instead of a
separate license for each machine hosting one or more of the 16 kernels, a network license
allows the worker kernels to run concurrently on the network.

MathLM is installed on a single machine, known as the license server. Once MathLM is running,
it acts as a gatekeeper for new Mathematica sessions. MathLM sets up the appropriate number
of process slots for each class of computer covered by your network license agreement. MathLM
monitors the number of copies of Mathematica in use and issues licenses to clients until all
available licenses are in use.

The number of concurrent processes that may run over the entire network is printed on your
license certificate. You can increase the number of processes allowed with a license upgrade
from Wolfram Research. See the Wolfram Mathematica Increment Request Form on the web at
wolfram.com/products/mathematica/processes for more information on increasing your process
increments.

Mathematica consists of two components, the kernel and the front end. The Mathematica kernel
performs computations. The Mathematica front end is the graphical notebook interface. MathLM
keeps track of kernel and front end processes separately.
4 System Administration for Network Licenses

† The number n of processes printed on your network license certificate generally gives you n
front end process slots and 4 n kernel process slots per increment. See the Increment
Request form on the web at wolfram.com/products/mathematica/processes for more infor-
mation on increasing your process increments.

† The gridMathematica network license certificate generally gives you 16 sub-kernel process
slots (sixteen worker kernels).

A client Mathematica process must request a license from MathLM before it starts taking user
input or performing calculations. In order for clients to run Mathematica, MathLM must be
running on the license server at all times. If the client machine making the request is not of a
type covered by the license, or if all the process slots are already in use, the client Mathematica
process cannot be started.

Installing MathLM
Requirements
MathLM is available for Windows, all Unix and Linux platforms on which Mathematica is sup-
ported, and Mac OS X. Visit www.wolfram.com/products/mathematica/platforms.html for a
complete list of platform availability. Each MathLM license server can support any combination
of client machines, regardless of the platform on which MathLM itself is running. MathLM auto-
matically supports both IPv4 and IPv6 environments.

The machine that you choose as a license server should be stable and should have a reliable
TCP/IP connection to the clients you want to serve. As MathLM requires minimal processor and
memory resources, an older machine with a reliable network connection would be an acceptable
license server. Ideally, there should not be any intervening firewalls between the license server
and the clients. If there is an intervening firewall, you will need to configure the network to
allow traffic to an appropriate port through the firewall. The license server must be located at
the physical site where your product is registered, as stipulated by your license agreement.

To install and run MathLM, you must register with Wolfram Research and receive a password.
See "Registration and Passwords" for further information.

Installing MathLM on Windows


To install MathLM on Windows 2000/XP/Vista, you must have administrative privileges.
System Administration for Network Licenses 5

To Install MathLM on Windows:


1. Insert the MathLM CD. The Wolfram Mathematica 7 License Manager window appears
on your screen. Click the button labeled Install MathLM to a hard disk.

2. The Wolfram Mathematica License Manager Setup dialog appears on your screen.
Click Next to begin the installation process.
6 System Administration for Network Licenses

3. By default, MathLM is installed in the directory C:\Program Files\Wolfram Research\


MathLM. To choose another destination directory, click Browse. Click Next to continue.

4. Click Next to add MathLM shortcuts to the Start menu in the Wolfram Mathematica folder.
System Administration for Network Licenses 7

5. Select any previous MathLM installations you want to remove. Click Next to continue.

Note: If you are installing over a previous version of MathLM, your existing mathpass file,
custom settings, and MonitorLM configuration files will not be deleted.

6. Click Install to install MathLM.

7. Your MathID number is displayed in the next dialog box. To obtain your password, contact
Wolfram Research (see "Registration and Passwords" for details). You will need to provide
your license number (located on your electronic or printed license certificate) and your
MathID number.
8 System Administration for Network Licenses

Once you have your password, enter your license number and password in the dialog box.
Click Add to add the new password to the list of recognized passwords. Click Next to
continue.

8. The Wolfram Mathematica License Manager Setup dialog will tell you when it is
finished installing MathLM. Click Finish to quit the installer.

After the installation is completed, MathLM will start automatically. For information on configur-
ing MathLM with additional options, refer to "Launching MathLM".
System Administration for Network Licenses 9

Installing MathLM on Unix, Linux, and Mac OS X


To install and run MathLM on Unix and Linux, you may need root privileges. To install and run
MathLM on Mac OS X, you must have administrative privileges.

To Install MathLM on Unix, Linux, and Mac OS X:


On Mac OS X, open the Terminal application and type the commands that follow in the
Terminal window.

1. Insert the MathLM CD into the CD/DVD-ROM drive.

2. Mount the CD. For information on mounting a CD, see "Mounting a CD or DVD on Unix
and Linux".

Note: This step is not required on Mac OS X and some Linux and Unix platforms, as the
operating system automatically handles mounting.

3. Change the directory to the appropriate subdirectory beneath the CD mount point. Note
that the exact location of the CD mount point might be different on Unix and Linux
platforms.

Unix:

cd /cdrom/Unix

Mac OS X:

cd /Volumes/MathLM/Macintosh

4. Type the following command and press Return.

./MathLMInstaller

5. Your machine name and MathID number are displayed. To obtain your password, contact
Wolfram Research (see "Registration and Passwords" for details). You will need to provide
your license number (located on your electronic or printed license certificate) and your
MathID number.

Once you have your password, type the letter c and press Return to proceed with the
installation.

-----------------------------------------------------------------
MathLM 7.0 Installer
-----------------------------------------------------------------
You can use this installer to install MathLM for the first time, or to
install a new version when you already have a previous version installed.
-----------------------------------------------------------------
10 YouAdministration
System can use for this installer
to install MathLM for the first time, or to
Network Licenses

To complete the installation, you will need a MathLM password.

To receive a password, register your copy of MathLM by going to


register.wolfram.com. You can also find registration instructions
in the file SysAdminGuide.pdf on the MathLM CD, or on the web at
http://reference.wolfram.com/network.

To register and get a password you will need to supply the


following information:

Machine name: hostname


MathID: dddd-ddddd-ddddd

Enter 'c' to continue or 'e' to exit the installer [c]:

6. Enter your MathLM license number as it appears on your electronic or printed license
certificate. Then press Return.

Enter the license ID located on your electronic


or printed license certificate.
Your license ID should be of the form Lnnnn-nnnn, where
the n are digits.

Enter your license ID:

7. Enter your MathLM password. Then press Return.

Enter your MathLM password:

8. The installer prompts you to specify the directory in which MathLM should be installed.
The default location is /usr/local/Wolfram/MathLM. Press Return to accept the default,
or type in a new location and then press Return.

The installer will copy relevant files from the distribution


CD-ROM into your MathLM directory. If you specify a
directory that already contains MathLM, the installer
will update components to the latest available version. To install
MathLM from scratch, specify a directory that does not
already exist.

Enter the MathLM directory [/usr/local/Wolfram/MathLM]:

Note: If you choose a directory that does not exist, the installer will create it for you. If a
copy of MathLM already exists in the directory you specify, the installer will inform you
before updating any files.

Note: If you are installing over a previous version of MathLM, your existing mathpass file,
custom settings, and MonitorLM configuration files will not be deleted.
System Administration for Network Licenses 11

9. The installer prompts you to specify the directory in which symbolic links will be created.
The default location is /usr/sbin. Press Return to accept the default, or type in a new
location and then press Return.

The installer will copy relevant files from the distribution


CD-ROM into a linking directory. If you specify a directory
that already contains files from an older installation of
MathLM, the installer will update components to the latest
available version. To install MathLM from scratch, specify
a directory that does not already exist.

Enter the linking directory [/usr/sbin]:

Note: If you choose a directory that does not exist, the installer will create it for you. If
symbolic links to an older copy of MathLM already exist in the directory you specify, the
installer will inform you before updating them.

10. The installer begins copying files from the CD. Each directory created is listed on your
screen, and the location of the password file is displayed. If any error messages are
generated during installation, they are logged to the installation directory.

11. Once the installation is complete, you must start MathLM manually. First, change direc-
tory to the location in which MathLM is installed (the default location is
/usr/local/Wolfram/MathLM). Then issue one of the following commands.

To start MathLM, type

./mathlm

To start MathLM and log messages to a file, type

./mathlm -logfile filename

Only a few options are presented here. A full discussion of the command-line options for
MathLM is given in "Launching MathLM".

Launching MathLM
Launching MathLM on Windows
Launching MathLM Manually
Once installed, MathLM starts running automatically by default each time the machine is
rebooted. To start or stop MathLM manually, follow these instructions.

It is assumed here that MathLM is installed in the default location, C:\Program Files\Wolfram
Research\MathLM.
12 System Administration for Network Licenses

To Start MathLM under Windows 2000/XP/Vista:

1. Open the Control Panel. (From the Start menu, choose Settings  Control Panel.)

2. Double-click the Services icon located in the Administrative Tools folder. To change set-
tings for services, you will need administrative privileges.

3. Select Mathematica 7.0 License Manager from the list of services.

4. Double-click the service name to open the Properties dialog box; then click Start.

Alternatively, in a command prompt window run the command net start mathlm.

To Stop MathLM under Windows 2000/XP/Vista:

1. Double-click the Services icon located in the Control Panel\Administrative Tools folder. To
change settings for services, you will need administrative privileges.

2. Select Mathematica 7.0 License Manager from the list of services.

3. Double-click the service name to open the Properties dialog box; then click Stop.

Alternatively, in a command prompt window run the command net stop mathlm.

Starting MathLM Automatically


Under normal conditions, the installer will install MathLM as a service on the machine. This
means MathLM will start automatically each time the machine is rebooted. You can manually
change the settings that control whether MathLM starts when the machine is rebooted.

It is assumed here that MathLM is installed in the default location, C:\Program Files\Wolfram
Research\MathLM.

To Start MathLM Each Time a Windows 2000/XP/Vista Machine Is Rebooted:

1. Open a command prompt window. (From the Start menu, choose Programs 
Accessories  Command Prompt.)

2. Use the cd command to change directories to C:\Program Files\Wolfram Research\


MathLM. Remember to use double quotes around directory names that include spaces.

3. Run .\mathlm -install.


System Administration for Network Licenses 13

If MathLM is already installed as a service but was previously disabled, you can enable it again
using the following steps.

4. Double-click the Services icon located in the Control Panel\Administrative Tools folder. To
change settings for services, you will need administrative privileges.

5. Select Mathematica 7.0 License Manager from the list of services and double-click.

6. In the dialog box that appears, set Startup type to Automatic.

7. Click OK to close the dialog box.

You can start or stop MathLM without rebooting the machine. The MathLM service will give no
indication that it has started, but the operating system will report if it fails to start.

To Prevent MathLM from Starting Each Time a Windows 2000/XP/Vista Machine Is Rebooted:

1. Double-click the Services icon located in the Control Panel\Administrative Tools folder. To
change settings for services, you will need administrative privileges.

2. Select Mathematica 7.0 License Manager from the list of services and double-click.

3. In the dialog box that appears, set Startup type to Disabled.

4. Click OK to close the dialog box.

Alternatively, in a command prompt window run the command .\mathlm -uninstall.


This will remove MathLM from the Service list.

Launching MathLM on Unix, Linux, and Mac OS X


To start MathLM on Unix and Linux, you may need root privileges. To start MathLM on Mac OS
X, you must have administrative privileges.

You can start MathLM manually at any time using the command-line options listed in
"Command-Line Options". However, it is typical to configure MathLM so it starts automatically
when the system is rebooted.

Starting MathLM Automatically on Unix and Linux


To do this, create a new startup script containing the following lines, or add them to an existing
system startup script.

if [ -f /usr/local/Wolfram/MathLM/mathlm];
then /usr/local/Wolfram/MathLM/mathlm -logfile filename;
fi
14 System Administration for Network Licenses

Starting MathLM Automatically on Mac OS X


To do this, you can write a startup item for MathLM. Startup items are programs (such as shell
scripts) that are run during the last phase of booting a Mac OS X system. They can be config-
ured to perform tasks such as clearing away temporary files or starting system daemons.

To Create a Startup Item for MathLM:

1. Create a directory called /MathLM in /Library/StartupItems. You might need to create the
directory /Library/StartupItems first.

2. In /Library/StartupItems/MathLM, create a file called MathLM with the following contents.


The name of the file must be the same as the name of the directory.

#!/bin/sh
. /etc/rc.common
##
# This script will start up the Mathematica License Manager, mathlm.
##
if [ "${MATHLM:=-YES-}" = "-YES-" ]; then
ConsoleMessage "Starting the Mathematica License Manager"
/usr/local/Wolfram/MathLM/mathlm
else
ConsoleMessage "The Mathematica License Manager was not started"
fi

3. Change permissions on the file to make it executable.

chmod 755 MathLM

4. In the same directory, /Library/StartupItems/MathLM, create a file called StartupParameÖ


ters.plist with the following contents.

{
Description = "Mathematica License Manager";
Provides = ("MathLM");
Requires = ("Core Services");
OrderPreference = "None";
Messages = {
start = "Starting Mathematica License Manager";
stop = "Stopping Mathematica License Manager";
};
}

5. Change permissions on the file to make it read-only.

chmod 644 StartupParameters.plist


System Administration for Network Licenses 15

6. Edit the /etc/hostconfig file, and add the following text in the Services section.

MATHLM=-YES-

7. To start MathLM without rebooting, run the following command.

SystemStarter start MathLM

MathLM Command-Line Options


The following are command-line options for MathLM.

-foreground keep MathLM in the foreground and print server messages


to stdout
-help print the list of all command-line options and the MathID
-language lang specify the language in which to display server messages
-localtime use local time instead of GMT in server messages
-logfile file write server messages to a specified log file
-logformat string specify the format for displaying server messages
-loglevel n specify the level of verbosity of server messages
-mathid print the MathID of the machine running MathLM
-noremotemonitor specify that MathLM cannot be remotely monitored via
MonitorLM
-pwfile file specify a file in which to look for Mathematica passwords
-restrict file specify a policy file that describes how to allocate Mathemat -
ica licenses
-timeout n return suspended licenses after a specified number of hours
-trfile file specify a file that defines substitutions for the text of error
messages

mathlm command-line options.

The following additional command-line option is accepted on Unix, Linux, and Mac OS X.

-syslog log messages to syslogd

mathlm command-line options specific to Unix, Linux, and Mac OS X.


16 System Administration for Network Licenses

The following additional command-line options are accepted on Windows.

-install install MathLM as a service program and automatically


start the service
-uninstall stop any currently running MathLM processes and remove
MathLM from the list of services

mathlm command-line options specific to Windows.

With -install, any arguments given are stored as a part of the service and used when start-
ing MathLM automatically.

Possible values for lang in -language are English, French, German and Japanese.

The four levels of verbosity in -loglevel are as follows.

1 report server startup/shutdown errors and print a success-


ful startup message
2 report everything from level 1 and all runtime error
messages
3 report everything from level 2, all license activity, and
startup messages pertaining to the process ID and socket
number
4 report everything from level 3, debugging information, and
a license table for every license transaction

-loglevel verbosity levels.

If -foreground is specified, the default verbosity level is set to 4.

If -logfile is used without -loglevel, the default logging verbosity is set to 3.

If -loglevel is used without specifying a level, the verbosity defaults to 4.

The default format for log messages is the W3C common logfile format. MathLM log files can be
imported using the Import format "ApacheLog".

Note: On Windows, a slash (/) or a dash (-) may be used to indicate options.
System Administration for Network Licenses 17

Logging MathLM
Enabling Logging
You can enable logging in two ways.

† Log server messages to stdout by using the option -foreground to keep mathlm in the
foreground.

† Log server messages to a specific file using the option -logfile file.

The log file records messages as they occur, building up a detailed record of license activity
over a period of time.

Logging supports both IPv4 and IPv6 environments with no additional configuration required.

Syntax of the Log File


By default, MathLM generates all log files in the W3C Common Logfile Format used by web
servers such as Apache. However, you can customize the format by using the option
-logformat. This option takes a string argument that specifies the format in which server
messages are displayed. The string contains a series of commands of the form %var#, where

† var is a letter representing one of nine variables, such as the host, user, day, time, or
event.

† # is a number defining a specific format for the variable var.

For example, %y1 means that the year is displayed in two-digit format (e.g., 08), while %y2
displays the year in four-digit format (e.g., 2008).

In addition to the %var# commands, the string can also include plain text such as brackets,
dashes, quotation marks, and arbitrary comments. The text can be used to include comments
and separators in the server messages for formatting purposes. All text included in the string
appears literally in the server message with the following two exceptions: use %q to include a
double quote ("), and use %% to include a percentage sign (%).

You must specify the type of messages that should be logged using the option -loglevel, as
explained in "Launching MathLM".
18 System Administration for Network Licenses

Here is a list of variables that can be included in the string, along with their numeric values and
formats.

Variable Name Possible Values Description


%h# 1 | IP address Host
2 | Hostname
3 | Fully qualified domain name
%u# 1 | User ID User
2 | Username
%m# [1...31] Day of Month
%w# 1 | Numeric [ 1 ... 7 ] Day of Week
2 | Abbreviated [ Sun ... Sat ]
3 | Verbose [ Sunday ... Saturday
]
%m# 1 | Numeric [ 01 ... 12 ] Month
2 | Abbreviated [ Jan ... Dec ]
3 | Verbose [ January ... Decem -
ber ]
%y# 1 | Two-digit [ 08 ] Year
2 | Four-digit [ 2008 ]
%t# 1 | Twelve-hour (10:20:15) Time
2 | Twenty-four-hour (22:20:15)
3 | GMT offset (-0500)
%e# 1 | Numeric Event
2 | Verbose
%r# 1 | Numeric Response
2 | Verbose

MathLM Logging Variables.

Note: All Windows clients on a network have the same user ID (set to the number 65535
by default). Hence, the user ID setting is only meaningful for clients running Unix, Linux,
or Mac OS X.

Note: To use the GMT offset format (%t3), you must also use the -localtime option
when starting MathLM.

Samples and Behavior


Running the command mathlm -logfile log.txt, without the option -logformat, generates
messages in the default format. An example of messages in the default format, as contained in
log.txt, follows.
System Administration for Network Licenses 19

hostname.domain.com - username [01/Sep/2008:22:01:35] "MathLM 7.0


executable launched" ".\mathlm" -
hostname.domain.com - username [01/Sep/2008:22:01:35] "Verbosity level
specified" "1" -
hostname.domain.com - username [01/Sep/2008:22:01:35] "Logging verbosity
level specified" "3" -
hostname.domain.com - username [01/Sep/2008:22:01:35] "Hostname"
"hostname.domain.com" -

The default format string, which mimics the Common Logfile Format, can be invoked by the
following.

%h3 - %u2 [%d/%m2/%y2:%t2 %t3] %q%e2%q %q%r2%q -

To specify the Common Logfile Format manually, you must specify this string as the value of
the -logformat option, as in the following command. The messages generated by this com-
mand are in the same format as the previous example.

mathlm -logfile log.txt -logformat "%h3 - %u2 [%d/%m2/%y2:%t2 %t3] %q%e2%q


%q%r2%q -"

By default, time is displayed in GMT. If you want local time to be displayed instead, you must
use the -localtime command-line option with either the %t1 tag or the %t2 tag. The %t3 tag
should not appear in the format string if you want local time to be displayed.

An alternate format string using local time follows.

mathlm -logfile log.txt -localtime -logformat "%h1 - %u2 [%m1-%d-%y1: %t1]


%q%e2%q %q%r2%q -"

An example of server messages in this user-specified format, as contained in log.txt, is


displayed here.

192.168.1.9 - username [09-16-08: 04:32:51 PM] "MathLM 7.0 executable


launched" ".\mathlm" -
192.168.1.9 - username [09-16-08: 04:32:51 PM] "Default (Common Logfile
Format) log format specified" "%h1 - %u2 [%m1-%d-%y1: %t1] %q%e2%q %q%r2%q
-" -
192.168.1.9 - username [09-16-08: 04:32:51 PM] "Verbosity level specified"
"1" -
192.168.1.9 - username [09-16-08: 04:32:51 PM] "Logging verbosity level
specified" "3" -
192.168.1.9 - username [09-16-08: 04:32:51 PM] "Hostname"
"hostname.domain.com" -
20 System Administration for Network Licenses

Note: Server messages in IPv6 networks will display IPv6 addresses automatically, with
no additional configuration required.

Monitoring MathLM
What Is MonitorLM?
MonitorLM gives information on the total number of licenses available and checked out, the fully
qualified domain name and username of those who have them checked out, and so on. Moni-
torLM can send output to the terminal, open a web browser, or write to a file. The output for
MonitorLM is customizable by means of a configuration file. MonitorLM automatically supports
IPv4 and IPv6 environments.

Starting MonitorLM
To start MonitorLM, change directory to the location in which MathLM is installed, and type
.\monitorlm servername (on Windows) or ./monitorlm servername (on Unix, Linux, or Mac OS
X). The first argument of the monitorlm command specifies the name of the license server
running MathLM. If you do not specify a server name explicitly, the local machine name is
chosen as the default.

MonitorLM Command-Line Options


The following options are available using the monitorlm command. The syntax for specifying
an option is monitorlm servername options.

-file file specify file to which output should be directed


-format f specify the format for the output of MonitorLM
-localtime specify that all time references are in local time instead of
GMT
-template file specify the template file for the output of MonitorLM

monitorlm command-line options.

If -file is not set, MonitorLM will write to stdout.

The three possible output formats in -format are as follows:


System Administration for Network Licenses 21

text send output in text format to stdout (default on Unix and


Linux)
html send output in HTML format and launch a web browser
(default on Windows and Mac OS X)
cgi send output in HTML format to stdout

-format output formats.

The cgi format is used when MonitorLM is launched directly by a web browser.

This shows what the output of MonitorLM looks like, with -format set to text.

Online help is available at


http://reference.wolfram.com/network

MathLM Version 7.0


MathLM Server hostname.domain.com
Date : Thursday, October 17 2008 21:11:59

License Usage Summary:

License Total Total


Program Class in Use Authorized
------------------------------------------------------

Mathematica A 2 20
MathKernel A 4 40

Sub Mathematica A 0 80
Sub MathKernel A 0 80

Licenses in Use:

License
Program Version Class Username Hostname
Duration
---------------------------------------------------------------------------
-
Mathematica 6.0 A username client1.domain.com 08:49
Mathematica 7.0 A username client2.domain.com 06:33
MathKernel 6.0 A username client1.domain.com 08:44
MathKernel 7.0 A username client2.domain.com 06:52
MathKernel 7.0 A username client2.domain.com 06:52
MathKernel 7.0 A username client2.domain.com 06:30
22 System Administration for Network Licenses

This shows what the output of MonitorLM looks like in a web browser, with -format set to html.

Note that when -format is set to cgi, the output of MonitorLM is sent to stdout in HTML
format. This shows what that output looks like when displayed in a web browser.
System Administration for Network Licenses 23

Customizing the Output of MonitorLM


You can customize the content and format of the output from MonitorLM by editing a template
file. This is a plain text file, which can contain the following types of elements.

† Constant tags~These tags represent data that is static during the execution of MonitorLM
and license-independent, such as the current date. Each of these tag names has the prefix
CONST.

† Variable tags~These tags act as wrappers to constant tags. They are useful in defining the
format for data to be output in series, such as a table of current MathLM users. They are
useful for improving readability of the template file. Each of these tag names has the prefix
VAR.

† Process-dependent tags~The value of these tags depends upon which Mathematica process
is being displayed and includes data like the process owner’s username and IP address.
Each of these tag names has the prefix PROC.

† Repeated tags~These tags serve as placeholders for information regarding an unknown


number of licenses. They are the only tags whose size is not predetermined. Only the
checkout lines are repeated, and there is one checkout line per license. Each of these tag
names has the prefix REP.

† Text wrappers~This is the text that a user can wrap around the tags, for presentation and
formatting.

Each tag in the template file has the form %var#, where

† var represents a variable whose value is provided by the server.

† # is a number defining a specific format for the display of the variable var.

In addition to the %var# commands, the template file can also include plain text such as brack-
ets, dashes, quotation marks, and arbitrary comments. The text can be used to include com-
ments and separators in the server messages for formatting purposes. All text included in the
string appears literally in the server message with the following two exceptions: use %q to
include a double quote ("), and use %% to include a percentage sign (%).

Predefined Constant Tags


Here are two tables of constant tag names that can be included in the template file along with
the numeric values for their possible formats.
24 System Administration for Network Licenses

Date Constant Tags

The following are Date Constant Tags for MonitorLM.

Tag Name Possible Values Description


%CONST_DATE_D# [1...31] Day of Month
%CONST_DATE_W# 1 | Numeric [ 1 ... 7 ] Day of Week
2 | Abbreviated [ Sun ... Sat ]
3 | Verbose [ Sunday ... Saturday
]
%CONST_DATE_M# 1 | Numeric [ 1 ... 12 ] Month
2 | Abbreviated [ Jan ... Dec ]
3 | Verbose [ January ... Decem-
ber ]
%CONST_DATE_Y# 1 | Two-digit [ 08 ] Year
2 | Four-digit [ 2008 ]
%CONST_DATE_T# 1 | Twelve-hour [ 10:20:15 ] Time

MonitorLM Date Constant Tags.

Server and Process Constant Tags

The following are Server and Process Constant Tags for MonitorLM.

Tag Name Description


%CONST_SERVER_IP MathLM IP address
%CONST_SERVER_HOST MathLM hostname
%CONST_SERVER_DOMAIN MathLM domain
%CONST_SERVER_FQDN MathLM fully qualified domain name
%CONST_SERVER_VERSION MathLM version
%CONST_CA_FE_AUTHORIZED Number of class A front ends authorized
%CONST_CA_SUB_FE_AUTHORIZED Number of class A sub-front end processes authorized
%CONST_CB_FE_AUTHORIZED Number of class B front ends authorized
%CONST_CB_SUB_FE_AUTHORIZED Number of class B sub-front end processes authorized
%CONST_TOTAL_FE_AUTHORIZED Total number of front ends authorized
%CONST_TOTAL_SUB_FE_AUTHORIZED Total number of sub-front end processes authorized
%CONST_CA_KE_AUTHORIZED Number of class A kernels authorized
%CONST_CA_SUB_KE_AUTHORIZED Number of class A sub-kernels processes authorized
%CONST_CB_KE_AUTHORIZED Number of class B kernels authorized
System Administration for Network Licenses 25

%CONST_CB_SUB_KE_AUTHORIZED Number of class B sub-kernel processes authorized


%CONST_TOTAL_KE_AUTHORIZED Total number of kernels authorized
%CONST_TOTAL_SUB_KE_AUTHORIZED Total number of sub-kernel processes authorized
%CONST_CA_FE_AVAILABLE Number of class A front ends available
%CONST_CA_SUB_FE_AVAILABLE Number of class A sub-front end processes available
%CONST_CB_FE_AVAILABLE Number of class B front ends available
%CONST_CB_SUB_FE_AVAILABLE Number of class B sub-front end processes available
%CONST_TOTAL_FE_AVAILABLE Total number of front ends available
%CONST_TOTAL_SUB_FE_AVAILABLE Total number of sub-front end processes available
%CONST_CA_KE_AVAILABLE Number of class A kernels available
%CONST_CA_SUB_KE_AVAILABLE Number of class A sub-kernel processes available
%CONST_CB_KE_AVAILABLE Number of class B kernels available
%CONST_CB_SUB_KE_AVAILABLE Number of class B sub-kernels processes available
%CONST_TOTAL_KE_AVAILABLE Total number of kernels available
%CONST_TOTAL_SUB_KE_AVAILABLE Total number of sub-kernel processes available
%CONST_CA_FE_OUT Number of class A front ends in use
%CONST_CA_SUB_FE_OUT Number of class A sub-front end processes in use
%CONST_CB_FE_OUT Number of class B front ends in use
%CONST_CB_SUB_FE_OUT Number of class B sub-front end processes in use
%CONST_TOTAL_FE_OUT Total number of front ends in use
%CONST_TOTAL_SUB_FE_OUT Total number of sub-front end processes in use
%CONST_CA_KE_OUT Number of class A kernels in use
%CONST_CA_SUB_KE_OUT Number of class A sub-kernel processes in use
%CONST_CB_KE_OUT Number of class B kernels in use
%CONST_CB_SUB_KE_OUT Number of class B sub-kernel processes in use
%CONST_TOTAL_KE_OUT Total number of kernels in use
%CONST_TOTAL_SUB_KE_OUT Total number of sub-kernels processes in use

MonitorLM Server and Process Constant Tags.

Note: A subprocess is equivalent to a computational process. See your electronic or


printed license agreement for more details.
26 System Administration for Network Licenses

Customizable Variable Tags


The following are Customizable Variable Tags for MonitorLM.

Tag Name Possible Values Description


%VAR_DATE_AMPM "A.M." "P.M." Text to use for a.m. and p.m. when
displaying time.
%VAR_MPROCESS "Mathematica" "MathKernel" Title for Mathematica processes. The
"SubMathematica" first string in quotes is the front end
"SubMathKernel" title, the second is the kernel title, the
third is the sub-front end process
title, and the fourth is the sub-kernel
process title.
%VAR_LIC_CLASS "Class A" "Class B" Labels for each license class.
%VAR_CA_AUTHORIZED "Class A Authorized \t Header for number of authorized class
_HEADER Front End \t Kernel" A licenses. Use with the predefined
constant tags
%CONST_CA_FE_AUTHORIZED and
%CONST_CA_KE_AUTHORIZED.
%VAR_CA_SUB_AUTHORÖ "Class A Authorized \t Header for number of authorized class
IZED_HEADER Front End \t Kernel" A sub-process licenses. Use with the
predefined constant tags %CONST_CA
SUB_FE_AUTHORIZED and %CONST_CA
SUB_KE_AUTHORIZED.
%VAR_CB_AUTHORIZED "Class B Authorized \t Header for number of authorized class
_HEADER Front End \t Kernel" B licenses. Use with the predefined
constant tags
%CONST_CB_FE_AUTHORIZED and
%CONST_CB_KE_AUTHORIZED.
%VAR_CB_SUB_AUTHORÖ "Class B Authorized \t Header for number of authorized class
IZED_HEADER Front End \t Kernel" B sub-process licenses. Use with the
predefined constant tags
%CONST_CB_SUB FE_AUTHORIZED and
%CONST_CB_SUB KE_AUTHORIZED.
%VAR_TOTAL_AUTHORÖ "Total Authorized \t Front Header for total number of authorized
IZED_HEADER End \t Kernel" licenses. Use with the predefined
constant tags
%CONST_TOTAL_FE_AUTHORIZED and
%CONST_TOTAL_KE_AUTHORIZED.
System Administration for Network Licenses 27

%VAR_TOTAL_SUB_ "Total Authorized \t Front Header for total number of authorized


AUTHORIZED_HEADER End \t Kernel" sub-process licenses. Use with the
predefined constant tags
%CONST_TOTAL_SUB FE_AUTHORIZED
and %CONST_TOTAL_SUB
KE_AUTHORIZED.
%VAR_CA_CHECKEDOUT "Class A Licenses in Header for information about class A
_HEADER Use\nUsername \t Hostname licenses in use. Use with the repeated
\t Program \t Slot # \t tag %REP_CA_CHECKOUT_LINE.
Duration"
%VAR_CA_SUB_ "Class A Licenses in Header for information about class A
CHECKEDOUT_HEADER Use\nUsername \t Hostname sub-process licenses in use. Use with
\t Program \t Slot # \t the repeated tag
Duration"
%REP_CA_CHECKOUT_LINE.
%VAR_CB_CHECKEDOUT "Class B Licenses in Header for information about class B
_HEADER Use\nUsername \t Hostname licenses in use. Use with the repeated
\t Program \t Slot # \t tag %REP_CB_CHECKOUT_LINE.
Duration"
%VAR_CB_SUB_ "Class B Licenses in Header for information about class B
CHECKEDOUT_HEADER Use\nUsername \t Hostname sub-process licenses in use. Use with
\t Program \t Slot # \t the repeated tag %REP_CB_SUB
Duration"
CHECKOUT_LINE.
%VAR_CHECKEDOUT_ "Licenses in Use\nUsername Header for information about all
HEADER \t Hostname \t Program \t licenses in use. Use with the repeated
License Class \t Slot # \t tag %REP_GENERAL_CHECKOUT_LINE.
Duration"
%VAR_SUB_CHECKEDÖ "Licenses in Use\nUsername Header for information about all sub-
OUT_HEADER \t Hostname \t Program \t process licenses in use. Use with the
License Class \t Slot # \t repeated tag %REP_GENERAL_SUB
Duration"
CHECKOUT_LINE.

MonitorLM Customizable Variable Tags.

Note: The strings provided in this section are examples of possible values, not default
settings. To use these tags, you must define them in your template.

Process-Dependent Tags
The following are Process-Dependent Tags for MonitorLM.

Tag Name Description


%PROC_UID User ID of Mathematica process owner
%PROC_USER Username of Mathematica process owner
%PROC_IP IP address of machine using Mathematica process
%PROC_HOST Hostname of machine using Mathematica process
28 System Administration for Network Licenses

%PROC_DOMAIN Domain of machine using Mathematica process


%PROC_FQDN Fully qualified domain name of machine using Mathematica
process
%PROC_SLOTNUM Slot number of Mathematica process
%PROC_VERSION Version of client
%PROC_DURATION Time client has been running

MonitorLM Process-Dependent Tags.

Repeated Tags
The following are Repeated Tags for MonitorLM.

Tag Name Possible Values Description


% REP_CA_CHECKOUT_ "%PROC_USER \t %PROC_HOST Class A checkout line. This specifies
LINE \t %VAR_MPROCESS \t the format of each line in the table or
%PROC_SLOTNUM \t block that lists the class A processes
%PROC_DURATION\n"
in use. Corresponds to the customiz-
able variable tag
%VAR_CA_CHECKEDOUT_HEADER.
%REP_CA_SUB_CHECKÖ "%PROC_USER \t %PROC_HOST Class A sub-process checkout line.
OUT_LINE \t %VAR_MPROCESS \t This specifies the format of each line
%PROC_SLOTNUM \t in the table or block that lists the
%PROC_DURATION\n"
class A sub-processes in use. Corre-
sponds to the customizable variable
tag
%VAR_CA_SUB_CHECKEDOUT_HEADER.
%REP_CB_CHECKOUT_ "%PROC_USER \t %PROC_HOST Class B checkout line. This specifies
LINE \t %VAR_MPROCESS \t the format of each line in the table or
%PROC_SLOTNUM \t block that lists the class B processes
%PROC_DURATION\n"
in use. Corresponds to the customiz-
able variable tag
%VAR_CB_CHECKEDOUT_HEADER.
System Administration for Network Licenses

%REP_CB_SUB_CHECKÖ "%PROC_USER \t %PROC_HOST Class B sub-process checkout line.


OUT_LINE \t %VAR_MPROCESS \t This specifies the format of each line
%PROC_SLOTNUM \t in the table or block that lists the
%PROC_DURATION\n"
class B sub-processes in use. Corre-
sponds to the customizable variable
tag
%VAR_CB_SUB_CHECKEDOUT_HEADER.
%REP_GENERAL_CHECKÖ "%PROC_USER \t %PROC_HOST General checkout line. Use this if you
OUT_LINE \t %VAR_MPROCESS \t do not want to separate classes.
%VAR_LIC_CLASS \t Corresponds to the customizable
%PROC_SLOTNUM \t
%PROC_DURATION\n" variable tag
%VAR_CHECKEDOUT_HEADER.
%REP_GENERAL_SUB_ "%PROC_USER \t %PROC_HOST General sub-process checkout line.
CHECKOUT_LINE \t %VAR_MPROCESS \t Use this if you do not want to sepa-
%VAR_LIC_CLASS \t rate classes. Corresponds to the
%PROC_SLOTNUM \t
%PROC_DURATION\n" customizable variable tag
%VAR_SUB_CHECKEDOUT_HEADER.

MonitorLM Repeated Tags.

Note: The strings provided in this section are examples of possible values, not default
settings. To use these tags, you must define them in your template.

Note: In the template file, the text wrappers and tags that make up the output to Moni-
torLM must follow a line containing only the keyword %TEXT with no whitespace before or
after it. Definitions for customized variable tags must precede the %TEXT line. If no vari-
able tags are customized, the %TEXT line can be the first line of the file.

Samples and Behavior


Here is a simple text file that shows only the number of processes authorized, available, and in
use. This example does not need to define any variable definition tags.

%TEXT
Time/Date : [%CONST_DATE_T2] [%CONST_DATE_M3 %CONST_DATE_D, %CONST_DATE_Y2]
Front End Processes Authorized: %CONST_TOTAL_FE_AUTHORIZED
Kernel Processes Authorized: %CONST_TOTAL_KE_AUTHORIZED
Front End Processes Available: %CONST_TOTAL_FE_AVAILABLE
Kernel Processes Available: %CONST_TOTAL_KE_AVAILABLE
Front End Processes In Use: %CONST_TOTAL_FE_OUT
Kernel Processes In Use: %CONST_TOTAL_KE_OUT
30 System Administration for Network Licenses

The resulting output has the form shown here.

Time/Date : [00:05:26] [October 20, 2008]


Front End Processes Authorized: 5
Kernel Processes Authorized: 5
Front End Processes Available: 4
Kernel Processes Available: 4
Front End Processes In Use: 1
Kernel Processes In Use: 1

Here is a slightly more sophisticated example. It is identical to the preceding example except
that it also lists the processes in use and customizes variable tags.

# Begin variable tag definitions


%VAR_MPROCESS = "FE" "KE"
%VAR_TOTAL_CHECKEDOUT_HEADER = "Slot\t Program\t User\t Host\n"
%REP_GENERAL_CHECKOUT_LINE = "%PROC_SLOTNUM\t %VAR_MPROCESS\t %PROC_USER\t
%PROC_HOST\n"

%TEXT
Time/Date : [%CONST_DATE_T2] [%CONST_DATE_M3 %CONST_DATE_D, %CONST_DATE_Y2]
Front End Processes Authorized: %CONST_TOTAL_FE_AUTHORIZED
Kernel Processes Authorized: %CONST_TOTAL_KE_AUTHORIZED
Front End Processes Available: %CONST_TOTAL_FE_AVAILABLE
Kernel Processes Available: %CONST_TOTAL_KE_AVAILABLE
Front End Processes In Use: %CONST_TOTAL_FE_OUT
Kernel Processes In Use: %CONST_TOTAL_KE_OUT

%VAR_TOTAL_CHECKEDOUT_HEADER
%REP_GENERAL_CHECKOUT_LINE

The resulting output has the form shown here.

Time/Date : [00:05:26] [October 20, 2008]


Front End Processes Authorized: 5
Kernel Processes Authorized: 5
Front End Processes Available: 4
Kernel Processes Available: 4
Front End Processes In Use: 1
Kernel Processes In Use: 1

Slot Program User Host


6 FE username hostname
1 KE username hostname
System Administration for Network Licenses 31

The following example demonstrates HTML output. This is useful, for example, if you want to
view the MonitorLM output in a web browser.

%VAR_MPROCESS = "Front End" "Kernel"


%VAR_TOTAL_CHECKEDOUT_HEADER = "<TR><TD><B>Slot</B></TD>
<TD><B>Program</B></TD> <TD><B>User</B></TD> <TD><B>FQDN</B></TD> </TR>\n"
%REP_GENERAL_CHECKOUT_LINE = "<TR> <TD>%PROC_SLOTNUM</TD>
<TD>%VAR_MPROCESS</TD> <TD>%PROC_USER</TD> <TD>%PROC_FQDN</TD> </TR>\n"

%TEXT
<HTML>
<HEAD> <TITLE> MathLM Status </TITLE> </HEAD>
<BODY>
<TABLE BORDER=1 CELLPADDING=5>
<TR><TD COLSPAN=2><B>MathLM Server</B></TD> <TD
COLSPAN=2><B>%CONST_SERVER_FQDN</B></TD> </TR>
<TR><TD COLSPAN=2>Time/Date</TD> <TD COLSPAN=2>[%CONST_DATE_T2]
[%CONST_DATE_M3 %CONST_DATE_D, %CONST_DATE_Y2]</TD> </TR>
<TR><TD COLSPAN=2>Authorized</TD> <TD>%CONST_TOTAL_FE_AUTHORIZED</TD>
<TD>%CONST_TOTAL_KE_AUTHORIZED</TD></TR>
<TR><TD COLSPAN=2>Available</TD> <TD>%CONST_TOTAL_FE_AVAILABLE</TD>
<TD>%CONST_TOTAL_KE_AVAILABLE</TD></TR>
<TR><TD COLSPAN=2>In Use</TD> <TD>%CONST_TOTAL_FE_OUT</TD>
<TD>%CONST_TOTAL_KE_OUT</TD></TR>

%VAR_TOTAL_CHECKEDOUT_HEADER
%REP_GENERAL_CHECKOUT_LINE

</TABLE>
</BODY>
</HTML>

The resulting output has the form shown here.


32 System Administration for Network Licenses

Restricting and Reserving Licenses


Writing a Restriction Script
Restriction scripts can be very useful in managing sitewide installations of Mathematica. They
can be used to prevent access to Mathematica by unauthorized users on the network and to
guarantee license availability to particular users. Restriction scripts are cross-platform compati-
ble, support both IPv4 and IPv6, provide unambiguous control, and require no programming
experience to write. The syntax of the restriction scripts is very similar to that of the
.htaccess files used in web servers for controlling access to HTML files.

Reserved licenses are always reserved. They are inaccessible to all other users or machines,
regardless of whether they are in use. Even if none of the specified users or machines are
running Mathematica, the license pool for all other users and machines is effectively reduced by
the number of reserved licenses.

The layout of a typical restriction script is as follows. Sample restriction scripts follow the
definitions.

AuthName Sample
AuthGroupFile mathlmgroup.txt

# Precedence
order ( allow,deny | deny,allow )

# Machine restriction
allow from ( all | machines ... )
allow hostgroup machinegroups ...
deny from ( all | machines ... )
deny hostgroup machinegroups ...

# User restriction
allow user ( all | users ... )
allow group usergroups ...
deny user ( all | users ... )
deny group usergroups ...

# License reservation
reserve [count] from machines ...
reserve [count] hostgroup machinegroups ...
System Administration for Network Licenses 33

reserve [count] user users ...


reserve [count] group usergroups ...
reservesub [count] user users ...
reservesub [count] group usergroups ...

Defining the Terms


The following are terms for reserving and restricting Mathematica licenses.

Name Description
AuthName Sample Defines the name of the script.
AuthGroupFile mathlmgroup.txt Specifies the file containing definitions for groups of users
or machines. This line is only required in conjunction with
the group or hostgroup keywords.
order ( allow,deny | deny,allow Defines the precedence of these two directives. The latter
) term takes precedence over the former.
Also sets the default access state as the latter term. The
default access state is applied to requests that do not
match an explicit rule. The default value is order
deny,allow.
allow from ( all | machines ... ) Allows license requests from the listed hostnames,
domains, IP addresses, and ranges of IP addresses.
allow hostgroup machinegroups ... Allows license requests from members of the listed
machine groups.
deny from ( all | machines ... ) Denies license requests from the listed hostnames,
domains, IP addresses, and ranges of IP addresses.
deny hostgroup machinegroups ... Denies license requests from members of the listed
machine groups.
allow user ( all | users ... ) Allows license requests from the listed users.
allow group usergroups ... Allows license requests from members of the listed user
groups.
deny user (all | users ... ) Denies license requests from the listed users.
deny group usergroups ... Denies license requests from members of the listed user
groups.
reserve [count] from machines ... Reserves count front end licenses and count kernel licenses
for each of the listed hostnames, domains, IP addresses,
and ranges of IP addresses.
reserve [count] hostgroup machine - Reserves count front end licenses and count kernel licenses
groups ... for each member of the listed machine groups.
34 System Administration for Network Licenses

reserve [count] user users ... Reserves count front end licenses and count kernel licenses
for each user in the list.
reserve [count] group usergroups ... Reserves count front end licenses and count kernel licenses
for each user in the listed user groups.
reservesub [count] from machines Reserves count sub-front end licenses and count sub-kernel
... licenses for each of the listed hostnames, domains, IP
addresses, and ranges of IP addresses.
reservesub [count] hostgroup Reserves count sub-front end licenses and count sub-kernel
machinegroups ... licenses for each member of the listed machine groups.
reservesub [count] user users ... Reserves count sub-front end licenses and count sub-kernel
licenses for each user in the list.
reservesub [count] group usergroups Reserves count sub-front end licenses and count sub-kernel
... licenses for each user in the listed user groups.

Terms for reserving and restricting licenses.

All the restriction script directives above automatically support IPv4 and IPv6 environments
with no additional configuration required.

Note: A subprocess or computation process is defined to be a process that does computa-


tions and only accepts or returns input to a controlling process. For more information see
your electronic or printed license agreement.

License Reservations
The reserve and reservesub directives allow you to guarantee license availability to particular
users or machines. It is important to note that reserved licenses are always reserved and are
inaccessible to all other users or machines.

In some situations, it may be necessary to reserve unequal numbers of front end and kernel
licenses. This can be accomplished by using the following additional directives: reservefe,
reservesubfe, reservekernel, and reservesubkernel. The syntax for reservefe and
reservekernel is identical to the syntax for reserve and the syntax for reservesubfe and
reservesubkernel is identical to the syntax for reservesub.

Sub-process reservations such as reservesub, reservesubfe, and reservesubkernel are


necessary when reserving kernels and front ends for either parallel or grid computing. Suppose
a user on your network requires 16 parallel kernels to model a large dataset. Use the
reservesubkernel directive to prevent other users from inadvertently disrupting the modeling
process.
System Administration for Network Licenses 35

Sample Restriction Scripts


The following examples illustrate key features of restriction scripts.

Scripts without Groups


The following script will deny Mathematica license requests from user1 and hostname1.
License requests from all other users and machines will be allowed.

AuthName Sample1

order allow,deny
allow from all
deny from hostname1
allow user all
deny user user1

The following script will only allow license requests from users user1 through user5 in the
range of 192.168.2.1 to 192.168.2.12, as well as 192.168.0.1 and 192.168.0.5. License
requests from any other users or machines will be denied.

AuthName Sample2

order deny,allow
deny from all
allow from [192.168.2.1 192.168.2.12] 192.168.0.1 192.168.0.5
deny user all
allow user user1 user2 user3 user4 user5

Scripts with Groups


The following script imposes the same restrictions as the preceding script, but the users and
machines are specified via groups and hostgroups.

AuthName Sample3
AuthGroupFile mathlmgroup1.txt

order deny,allow
deny from all
allow hostgroup group1
deny user all
allow group group2 group3
36 System Administration for Network Licenses

This is the file mathlmgroup1.txt. It defines one machine group and two user groups.

group1: 192.168.0.1 192.168.0.5 [192.168.2.1 192.168.2.12]


group2: user1 user2 user3
group3: user4 user5

Scripts Demonstrating Default Access State


The following script will allow license requests from all users and all machines except host1. If
user1 requests a license while logged on to host1, the request will be allowed. This request
matches both rules in this script, but the value of the order directive specifies that the allow
directive has precedence. Note that a license request from user2 logged on to host1 would be
denied.

AuthName Sample4

order deny,allow
deny from host1
allow user user1

The value of the order directive is the only difference between the preceding script and the
following script, but the meaning of the script is reversed. This script only allows license
requests from user1. A license request from user1 logged on to host1 will be denied. Such a
request matches both rules, but the request is denied because the deny rule has precedence.

AuthName Sample5

order allow,deny
deny from host1
allow user user1

Scripts with License Reservations


The following script will allow all license requests. It reserves three kernel licenses for the
address 192.168.0.1, and one front end license and one kernel license for user1. These
licenses are always reserved and inaccessible to all other machines or users."

AuthName Sample6

order allow,deny
allow from all
allow user all
reservekernel 3 from 192.168.0.1
reserve user user1
System Administration for Network Licenses 37

The following script will allow all license requests. It reserves two front end licenses, two kernel
licenses, and four kernel subprocess licenses for user1. This will guarantee user1 the neces-
sary resources for parallel computations. For more information on parallel computing see the
"Parallel Computing Tools User Guide".

AuthName Sample7

order allow,deny
allow from all
allow user all
reservefe 2 user user1
reservekernel 2 user user1
reservesubkernel 4 user user1

The following script will only allow license requests from user1, user2, hostname1, hostÖ
name2, domain1.com, and addresses in the range 192.168.1.1 through 192.168.2.9. It
reserves three kernel licenses and three front end licenses for hostname2, another three kernel
licenses and three front end licenses for the addresses from 192.168.1.1 to 192.168.2.9,
one kernel license and one front end license for user1, and one kernel license and one front
end license for user2. In this script, a total of eight front end licenses and eight kernel licenses
are reserved.

AuthName Sample8

order deny,allow
deny from all
allow from hostname1 hostname2 .domain1.com [192.168.1.1 192.168.2.9]
deny user all
allow user user1 user2

reserve 3 from hostname2 [192.168.1.1 192.168.2.9]


reserve user user1 user2

It may be easier to visualize the number of licenses being restricted in Sample8 if you notice
that the first instance of reserve can also be written in the following form.

reserve 3 from hostname2


reserve 3 from [192.168.1.1 192.168.2.9]
38 System Administration for Network Licenses

Scripts with License Reservations and Groups


The following script imposes the same restrictions and reservations as the Sample6 script, but
the users and machines are specified via groups and hostgroups.

AuthName Sample9
AuthGroupFile mathlmgroup2.txt

order deny,allow
deny from all
allow hostgroup group1 group2
deny user all
allow group group3

reservekernel 3 hostgroup group2


reserve group group3

This is the file mathlmgroup2.txt. It defines two machine groups and one user group.

group1: hostname1 .domain1.com


group2: hostname2 [192.168.1.1 192.168.2.9]
group3: user1 user2

Using a Restriction Script


To use a restriction script, run MathLM with the option -restrict followed by the pathname of
the script. You can give the restriction script any filename (and extension) that you want. See
"Launching MathLM" for details about command-line options.

MathLM must be restarted if the restriction script or AuthGroupFile is changed.

Troubleshooting MathLM
Diagnostics
The following techniques are useful for debugging problems with client connections to the
license server.

† Launch MathLM with the option -foreground. This option allows you to see how requests
are handled by MathLM in real time.
System Administration for Network Licenses 39

† Log MathLM messages to a file with an increased level of verbosity by launching MathLM
with the options -logfile and -loglevel. This allows you to see how requests are handled
by MathLM over a certain period of time.

† From a command line on the client, run the Mathematica kernel with the option -lmverbose
and examine the messages produced. This option prints diagnostic information on connect-
ing to the license manager.

Problems and Solutions


MathLM Cannot Find the Password File.
MathLM will not start if it cannot find the password file. In that case, the following error
message will be displayed on your screen.

Faulty license entry.


No valid mathlm password entry or file found.

To successfully start MathLM, use the option -pwfile followed by the full pathname of the
mathpass file.

The Client Cannot Connect to the License Server when Mathematica Is


First Launched.
If this happens, the following dialog box appears.

You can choose one of two options:

Enter Password~brings up the front end password dialog box. See "Entering a Single-
Machine Password" for details.

Quit~exits Mathematica. You are given the option of saving your work.
40 System Administration for Network Licenses

If you are running the kernel only, the following message will be displayed.

A password entry for a network license server was found,


but no license was returned. The license server may not be
responding, or no licenses are available from the server.
You may need to contact your system administrator to
start the license server, or wait until a license is
available.

You can press Ctrl+C to quit, or follow the instructions in "Entering a Single-Machine Password"
to enter a single-machine password.

If these error messages are displayed, check that MathLM is running on the license server. If
MathLM quits, it must be restarted in order to serve licenses. If there is a firewall between the
license server and the client, verify that the firewall is configured to allow traffic through the
proper port.

The Client Can Connect to the License Server, but Is Denied a License
because the Process Limit Has Been Reached.
If this happens, the following dialog box appears to notify you of an error.

You can choose one of two options:

Enter Password~brings up the front end password dialog box. See "Entering a Single-
Machine Password" for details.

Quit~exits Mathematica.
System Administration for Network Licenses 41

If you are running the kernel only, the following message will be displayed.

The n-process limit on the license you are trying


to run has been reached. Contact Wolfram Research or
an authorized Mathematica distributor for information
on upgrading your license configuration.

You can press Ctrl+C to quit, or follow the instructions in "Entering a Single-Machine Password"
to enter a single-machine password.

You can purchase additional licenses by contacting Wolfram Research.

The Client Can Connect to the License Server, but Is Denied a Kernel
because the Kernel Process Limit Has Been Reached.

You can choose one of two options:

Purchase~links to the Wolfram Mathematica Process Increment Request Form web page.

Cancel~aborts the kernel launch.

If you are running the kernel only, the following message will be displayed.

The n-process limit on the license you are trying


to run has been reached. Contact Wolfram Research or
an authorized Mathematica distributor for information
on upgrading your license configuration.

You can press Ctrl+C to quit, or follow the instructions in "Entering a Single-Machine Password"
to enter a single-machine password.

You can purchase additional licenses by contacting Wolfram Research. See the Increment
Request form on the web at wolfram.com/products/mathematica/processes for more informa-
tion on increasing your process increments.

If you are running Mathematica using a network license, see "Restricting and Reserving
Licenses" for more information on guaranteeing kernel availability to particular users.
42 System Administration for Network Licenses

MonitorLM Shows that There Are Available Licenses, but the Client Is
Denied a License because the Process Limit Has Been Reached.
If this happens, there are reserved licenses that are not in use. If necessary, you can reclaim
an unused reserved license by removing the relevant line from the restriction script and restart-
ing MathLM.

The Client Can Connect to the License Server, but Is Denied a License
Based on a Restriction Script.
If MathLM is configured to use a restriction script and an unauthorized client requests a license,
the following message will be displayed.

You can choose one of two options:

Enter Password~brings up the front end password dialog box. See "Entering a Single-
Machine Password" for details.

Quit~exits Mathematica.

If you are running the kernel only, the following message will be displayed.

A password entry for a network license server was found,


but no license was returned. The license server may not be
responding, or no licenses are available from the server.
You may need to contact your system administrator to
start the license server, or wait until a license is
available.

You can press Ctrl+C to quit, or follow the instructions in "Entering a Single-Machine Password"
to enter a single-machine password.
System Administration for Network Licenses 43

If the client that was denied should be allowed to request a license, edit the restriction script
and restart MathLM.

The Connection to the License Server Is Lost after the Client Is


Connected to It.
Once Mathematica is running, the client contacts the license server every two minutes to
refresh its license. If three successive attempts to contact the license server are unsuccessful, a
dialog box will appear informing you that the license server could not be contacted. This hap-
pens six to eight minutes after the connection to the license server is lost.

If you are running the front end, the following dialog box appears.

You can choose one of two options:

Enter Password~brings up the front end password dialog box. See "Entering a Single-
Machine Password" for details.

Quit~exits Mathematica. You are given the option of saving your work.

If you are running the kernel only, you will receive the following prompt to indicate that the
connection has been lost.

Lost connection to server>

You may attempt to connect to the license server again, or you may exit Mathematica.

Your options are:


retry (or r) to retry server
exit (or quit) to exit Mathematica
44 System Administration for Network Licenses

Technical Support
For further assistance, check the Technical Support FAQs on the web at support.wolfram.com.
If you are a Site License Administrator, additional Site License Documentation is available at
site.wolfram.com. If you do not find the information you need, please contact Technical Support
by sending email to support@wolfram.com or by calling +1-217-398-6500. Include your license
number in all correspondence. Your license number is located on your electronic or printed
license certificate. It is also available after installation by going to the Help menu and clicking
About Mathematica. You must be a registered user in order to receive installation support.
You must have a current Premier Service subscription to receive Technical Support.

Mathematica
Windows
Installing Mathematica on Windows
Installing Mathematica for Network Licenses
Requirements

Mathematica is available for Windows, Unix, Linux, and Mac OS X. For a complete list of plat-
form availability, visit www.wolfram.com/products/mathematica/platforms.html. Any supported
machine can act as a client for running Mathematica, provided the following two conditions are
met:

† The client has access to the Mathematica files, either locally or from a file server on the
network.

† The license server running MathLM is available on the TCP/IP network.

A license server can also function as its own client. However, this is not recommended. If the
machine has to be rebooted for any reason, the serving of licenses to all other clients on the
network may be disrupted.

Before you install Mathematica as a license server client, MathLM should already be installed
and running on a license server on the network (see "Installing MathLM" for details). To com-
plete the Mathematica installation, you will need to know the name or IP address of the license
server running MathLM.
System Administration for Network Licenses 45

To install Mathematica on Windows 2000/XP/Vista, you must have administrative privileges.

To Install Mathematica:

1. Insert the Mathematica DVD. The Wolfram Mathematica 7 window appears on your
screen. Click the button labeled Install Mathematica to a hard disk.

2. The Wolfram Mathematica Setup dialog appears on your screen. Click Next to begin
the installation process.
46 System Administration for Network Licenses

3. By default, Mathematica is installed in the directory C:\Program Files\Wolfram Research\


Mathematica\7.0. To choose another destination directory, click Browse. Click Next to
continue.

4. Mathematica is configured to automatically install all optional components. To chose


another configuration, de-select any components by clicking on the corresponding check
box. Click Next to continue.
System Administration for Network Licenses 47

5. Click Next to add Mathematica shortcuts to the Start menu in the Wolfram Mathematica
folder. If you would like to select a different folder, click Browse.

6. Click Install to install Mathematica.


48 System Administration for Network Licenses

7. Click Finish to complete the installation and launch Mathematica.

8. Mathematica starts up and the following password dialog box appears. Select Network
License. Then enter the name or IP address of the license server running MathLM in the
text field provided.

9. Click OK. You are now ready to start using Mathematica.

Installing Mathematica for Single-Machine Licenses


Follow these instructions to install a standalone copy of Mathematica that does not get a license
from a license server. Depending on your license type, this may require contacting Wolfram
Research to purchase additional licenses.
System Administration for Network Licenses 49

To run Mathematica, you must register with Wolfram Research and receive a password. See
"Registration and Passwords" for further information.

To install Mathematica on Windows 2000/XP/Vista, you must have administrative privileges.

To Install a Single-Machine Copy of Mathematica on Windows:

1. Insert the Mathematica DVD. The Wolfram Mathematica 7 window appears on your
screen. Click the button labeled Install Mathematica to a hard disk.

2. The Wolfram Mathematica Setup dialog appears on your screen. Click Next to begin
the installation process.
50 System Administration for Network Licenses

3. By default, Mathematica is installed in the directory C:\Program Files\Wolfram Research\


Mathematica\7.0. To choose another destination directory, click Browse. Click Next to
continue.

4. Mathematica is configured to automatically install all optional components. To chose


another configuration, de-select any components by clicking on the corresponding check-
box. Click Next to continue.
System Administration for Network Licenses 51

5. Click Next to add Mathematica shortcuts to the Start menu under Wolfram Mathematica.

6. Click Install to install Mathematica.


52 System Administration for Network Licenses

7. Click Finish to complete the installation and launch Mathematica.

8. Mathematica starts up and the following password dialog box appears. Select Single
Machine. Then enter your name, the name of your organization, and your license num-
ber (located on your electronic or printed license certificate) in the text fields provided.
Click OK when you are done.
System Administration for Network Licenses 53

9. The following dialog box appears showing the MathID number for your machine. To obtain
your password, click the Web button, go to register.wolfram.com, or contact Wolfram
Research (see "Registration and Passwords" for further information). You will need to
supply your license number and your MathID number.

10. Enter your password and click OK. You are now ready to start using Mathematica.

Installing Mathematica from a File Server


One convenient way to install Mathematica is to run the installer remotely from a file server.
This is an efficient way of making Mathematica available to a large number of users without
having to supply a DVD to each one.

Installing Mathematica from a file server requires first copying the installer executable and all
files in the Mathematica distribution from the DVD onto the file server.

1. Insert the Mathematica DVD into the drive on the file server. Open a My Computer
window, then right-click the DVD in the list and select Open.

2. An Explorer window appears showing the contents of the DVD. Select the Windows folder.

3. Copy the Windows folder from the DVD to a location on the file server accessible to exter-
nal users over the network.

Once this step is complete, you can install the Mathematica files on each client.

4. From the client, connect to the file server and open the Windows directory that was cre-
ated on the file server.

5. Double-click the file Setup.exe to launch the installer.

6. Follow the same steps as for installing from a DVD (see "Network License" and "Single-
Machine License").
54 System Administration for Network Licenses

Installing Mathematica from a Script


If you are installing Mathematica on multiple machines, it can be time-consuming to respond to
all of the installer prompts on each individual machine. By supplying command-line options to
the installer, you can customize various features of the installation process or automate it
entirely.

/dir="C:\path\here" specify the installation directory


DisableShellVerbs disable file associations for .m, .nb, .nbp, etc. (enabled by
default)
/group="start menu folder name" specify the start menu folder name
/noicons disable creation of start menu folder and shortcuts
/norestart do not restart the system, even if necessary
/restartexitcode=code specify the installer exit code to return if restart is
necessary
/silent force an automatic installation and suppress installation
windows
/suppressmsgboxes suppress installer message boxes (only effective when
used in conjuction with /silent)

Mathematica Installer supported command-line options.

To Create a Script That Performs a Silent Mathematica Installation:

The following instructions explain how to write a simple script to silently install Mathematica
from a file server. These instructions require that you have a mathpass file with a valid pass-
word. See "Registrations and Passwords" for more information on sitewide mathpass
configurations.

1. Follow the instructions in the first part of "Installing Mathematica from a File Server" to
copy the installer and files from the DVD to a file server.

2. Copy your mathpass file to the same directory on the file server as the installer and
Mathematica files.

3. Open Notepad (Start Menu  Programs  Accessories  Notepad) and type the follow-
ing lines into a new file.

@echo off
echo Installing Mathematica...
\\server\math\setup.exe /silent /suppressmsgboxes /log="C:\Windows\Temp\install.log"
echo Creating password file...
copy \\server\math\mathpass "C:\Directory\Name"
echo Mathematica installation complete.
System Administration for Network Licenses 55

4. Change all instances of \\server\math to the pathname of the network share where the
Mathematica installation files and mathpass file were copied.

5. Change "C:\Directory\Name" to the directory listed here for your version of Windows.
Be sure to enclose the name of the directory in quotes.

Windows 2000/XP~
"C:\Documents and Settings\All Users\Application Data\Mathematica"

Windows Vista~"C:\ProgramData\Mathematica"

Note: These directories are the values of $BaseDirectory for different versions of Win-
dows. See "Configuration Files on Windows" for further information.

6. To save the file, choose File  Save. Save the file in the same directory as the Mathemat-
ica installation files. Type the filename install.bat, and choose All Files from the Save as
type popup menu. Click Save, then quit Notepad.

To Perform a Silent Mathematica Installation:

1. On the client, open a Command Prompt window, type the pathname of the install.bat
file, and press Enter. For example, if the network share is called \\server\math, type:

\\server\math\install.bat

The following messages are displayed.

Installing Mathematica...
Creating password file...
Mathematica installation complete.

2. The installation is now complete. If you see any messages other than those printed here,
check the file C:\Windows\Temp\install.log on the client machine for further information.

Installing Mathematica in this way eliminates the need to take the DVD to each client machine,
and saves time by allowing you to run a simple script instead of responding to the installer
questions.

Launching Mathematica on Windows


Launching Mathematica Locally
To run Mathematica using a network license, both the client machine and the license server
must be on the network, and MathLM must be running.
56 System Administration for Network Licenses

To Launch Mathematica:

From the Start menu, choose Programs  Wolfram Mathematica  Mathematica 7.

Alternatively, you can open an Explorer window, go to the Program Files\Wolfram Research\
Mathematica\7.0 directory, and double-click the Mathematica icon.

To Launch Only the Mathematica Kernel:

From the Start menu, choose Programs  Wolfram Mathematica  Mathematica 7 Kernel.

Alternatively, you can open an Explorer window, go to the Program Files\Wolfram Research\
Mathematica\7.0 directory, and double-click the MathKernel icon.

To Launch the Mathematica Kernel inside a Command Prompt Window:

Open a command prompt window and change directory to the top-level Mathematica installa-
tion directory. Type .\math and press Enter.

Launching Mathematica from a File Server


You can also run Mathematica directly from a file server, without installing files locally. To do
this, install Mathematica on the file server and make the installation directory accessible to the
client machines. Running Mathematica from a file server differs from running a local copy in
several ways. These differences and appropriate steps for working around them are listed here.

† The Mathematica fonts will not be available for use by other applications. It is therefore
required that you manually install the fonts on your system. The fonts are found in
SystemFiles\Fonts\Windows in the Mathematica layout. To install these fonts so they can be
used by all other Windows applications, open the Fonts control panel, choose Install New
Font under the File menu, and specify the location of the fonts in the Add Fonts dialog
box that appears.

† The MathLink libraries will not be available for use by other applications. Therefore, you
need to copy the MathLink libraries to the appropriate locations on your system. For 32-bit
Windows systems, the MathLink libraries consist of seven files: ml32i1.dll, ml32i2.dll,
ml32i3.dll, mlmap32.mlp, mlshm32.mlp, mltcp32.mlp, and mltcpip32.mlp, which are
located in SystemFiles\Links\MathLink\DeveloperKit\Windows\SystemAdditions in the Mathe-
matica layout. Copy these files to the WINNT\System32 folder on Windows 2000, or the
Windows\System32 folder on Windows XP/Vista. For 64-bit Windows platforms, the Math-
Link libraries consist of twelve files: ml32i1.dll, ml32i2.dll, ml32i3.dll, mlmap32.mlp,
mlshm32.mlp, mltcp32.mlp, and mltcpip32.mlp, which are located in SystemFiles\
Links\MathLink\DeveloperKit\Windows\SystemAdditions, and ml64i2.dll, ml64i3.dll,
mlshm64.mlp, mltcp64.mlp, mltcpip64.mlp, which are located in SystemFiles\Links\
MathLink\DeveloperKit\Windows-x86-64\SystemAdditions. Copy the first seven files to the
Windows\Syswow64 folder and the other five files to the Windows\System32 folder.
System Administration for Network Licenses 57

† The proper file associations will not be set up for Mathematica. You can set these associa-
tions manually by using the Folder Options dialog box under the Tools menu of the
Explorer window. You will need to specify the MIME type as application/mathematica and
the file extension as .nb.

† A Start menu entry for Mathematica will not be created automatically. You can add this
manually by editing the Start menu settings in the dialog box that appears when you
choose Settings  Taskbar and Start Menu under the Start menu.

Mathematica Command-Line Options


Following are several useful command-line options for the Mathematica kernel. See "Launching
Mathematica on Windows: Locally" for instructions on running the kernel.

Command-Line Options

-lmverbose print diagnostic information to stderr


-mathlink specify that the kernel should be run in MathLink mode
-noprompt specify that no banner or In/Out prompts should be printed
-password str specify a password to use instead of the password or
passwords stored in the mathpass file
-pwfile file specify the name of a file that has a valid password
-run specify a command to be run on startup as an argument

Mathematica command-line options.

The option -lmverbose is usefull for debuggin problems related to the license server

The option -mathlink can also be used as a command-line option for the Mathematica front
end. See www.wolfram.com/solutions/mathlink for additional information about MathLink.

The mode set by -noprompt is useful for running a sequence of commands from a batch file.

The string for -password should have the form "!servername" or "machinename mathid licensenumber
password".
58 System Administration for Network Licenses

Testing the Installation on Windows


The following simple commands allow you to test the installation of Mathematica. Running
these commands does not guarantee that the installation was successful, but a failed command
can indicate that a serious problem occurred during installation.

You should run these tests from a regular user account and not from an account with administra-
tive privileges.

To run Mathematica using a network license, both the client machine and the license server
must be on the network and MathLM must be running.

If you run into problems when doing these tests, see the troubleshooting tips in
"Troubleshooting on Windows". If you do not find the answer there, check the Technical Sup-
port website at support.wolfram.com/mathematica.

To Test the Kernel:


1. To start the kernel, choose Programs  Wolfram Mathematica  Mathematica 7
Kernel from the Start menu.

In[1]:=

2. Type N[Pi, 20] and press Enter. The number in the output should match the output
shown here.

In[1]:= N[Pi, 20]

Out[1]= 3.1415926535897932385

In[2]:=

3. To exit the kernel, type Exit and press Enter.

To Test the Front End:


1. Launch Mathematica by choosing Programs  Wolfram Mathematica  Mathematica
7 from the Start menu.

A splash screen with initialization information appears briefly, after which an empty note-
book and the Welcome Screen appear.

2. Type N[Pi,20]. Then hold down the Shift key and press Enter to evaluate. This should
send the command to the kernel and return the same result as before. The In[1] and
Out[1] labels are prepended once the evaluation is completed.
System Administration for Network Licenses 59

In the notebook window, there should be a horizontal line across the notebook; this is the
horizontal insertion bar. If you do not see one, move the pointer until it becomes a horizon-
tal I-beam and click once to see the insertion bar.

3. Press the Esc key. You should see three small horizontal lines in a column (Ç). Type int
and press Esc again. You should see an integral sign (Ÿ ). As an additional font check,
typing î[CheckmarkedBox] and î[CirclePlus] should print the symbols  and ⊕,
respectively. If the symbols show up correctly, the fonts have been properly installed.

4. From the Help menu, choose Documentation Center. The Mathematica Documentation
Center should appear.

Configuration Files on Windows


Mathematica stores preference settings and initialization data in two directories,
$BaseDirectory and $UserBaseDirectory. Within each of these directories are several possi-
ble subdirectories with titles such as FrontEnd, Kernel, and Licensing.

Global settings that affect all users are stored in subdirectories of the directory
$BaseDirectory. The default value of $BaseDirectory for different versions of Windows is
shown in the following table. To redefine the location of global preference settings and initializa-
tion data, set the environment variable MATHEMATICA_BASE.

Windows 2000/XP C:\Documents and Settings\All Users\Application Data\Mathematica


Windows Vista C:\ProgramData\Mathematica

Location of the directory $BaseDirectory for different versions of Windows.

Settings that only affect a particular user are stored in subdirectories of the directory
$UserBaseDirectory. The default value of $UserBaseDirectory for different versions of Win-
dows is shown in the following table. To redefine the location of user preferences and initializa-
tion data, set the environment variable MATHEMATICA_USERBASE.

Windows 2000/XP C:\Documents and Settings\username\Application Data\Mathematica


Windows Vista C:\Users\username\AppData\Roaming\Mathematica

Location of the directory $UserBaseDirectory for different versions of Windows.

Settings in the directory $UserBaseDirectory override global settings defined in the directory
$BaseDirectory.
60 System Administration for Network Licenses

In the pathnames that follow, replace the variables $BaseDirectory and $UserBaseDirectory
with the appropriate directories for your system. To find their locations on your system, evalu-
ate the command $BaseDirectory (or $UserBaseDirectory) in a Mathematica notebook.

Kernel
The initialization files used by the kernel contain Mathematica commands that are evaluated at
startup, such as function definitions, packages to load, and kernel option settings. These com-
mands are also available to the Mathematica front end.

$BaseDirectory\Kernel\init.m

This file is used to initialize the kernel and therefore should store any kernel commands
that are appropriate for all users running the kernel.

$UserBaseDirectory\Kernel\init.m

This file stores user-specific commands used to initialize the kernel.

Kernel initialization files are not created automatically.

Front End
Front end initialization files store preference settings such as the values of global options in the
Option Inspector. These files are automatically updated by Mathematica when you change a
setting in the front end. To make changes to this file, make your changes from within Mathemat-
ica rather than editing the file directly.

$BaseDirectory\FrontEnd\init.m

This file stores systemwide defaults used by all Mathematica front ends. The settings in
this file affect all users. "Systemwide Defaults on Windows" explains how to implement
changes to this global file.

$UserBaseDirectory\FrontEnd\init.m

This file defines settings within the front end that are specific to each user.

Front end initialization files are created automatically.


System Administration for Network Licenses 61

Front End Caches


The front end stores certain information about system settings in caches specific to each user.
The default location for front end caches is shown here.

Windows 2000/XP C:\Documents and Settings\username\Local Settings\


Application Data\Mathematica\FrontEnd\7.0 Caches
Windows Vista C:\Users\username\AppData\Local\Mathematica\FrontEnd\7.0 Caches

Location of the front end caches for different versions of Windows.

Passwords
Passwords are stored in the mathpass file, described in further detail in "Registration and Pass-
words". In the following pathname, replace the variable $InstallationDirectory with the
directory where you installed Mathematica. The default value of $InstallationDirectory on
Windows is C:\Program Files\Wolfram Research\Mathematica\7.0. To find the value of
$InstallationDirectory on your system, evaluate the command $InstallationDirectory
in a Mathematica notebook.

$BaseDirectory\Licensing\mathpass

This is the default location for the global password file.

$InstallationDirectory\Configuration\Licensing\mathpass

This is an alternative location for the global password file.

$UserBaseDirectory\Licensing\mathpass

While this is not normally the location for the password file, a user-specific mathpass file
can be stored here.

Systemwide Defaults on Windows


If you have installed Mathematica in a location where multiple users can run it (for example, on
a file server or multi-user machine), then you can set up systemwide defaults for the Mathemat-
ica front end and kernel. This is ideal for setting up Mathematica for use in computer labs and
classrooms. If you share the directory $BaseDirectory across the network, these defaults will
also take effect on local installations that use the shared $BaseDirectory.
62 System Administration for Network Licenses

In the pathnames that follow, replace the variables $BaseDirectory and


$UserBaseDirectory with the appropriate directories for your system. To find their locations
on your system, evaluate the command $BaseDirectory (or $UserBaseDirectory) in a
Mathematica notebook.

To Set Up a Configuration File for the Front End:


1. Launch Mathematica, and set up any changes to the front end that you need. For exam-
ple, you may want to modify default file locations, language options, or menu settings.

2. Quit Mathematica.

3. Copy the file $UserBaseDirectory\FrontEnd\init.m to the directory $BaseDirectory\


FrontEnd.

These settings will now be used by the front end unless overridden by the local init.m file stored
in the user’s $UserBaseDirectory\FrontEnd directory.

To Set Up a Configuration File for the Kernel:


1. Launch Mathematica, and create a new file.

2. Add any Mathematica commands that should be evaluated on startup. For example, you
may want to add a function definition or display a message at startup. Enter all the com-
mands in the same cell, separating commands with semicolons.

3. Make this cell an initialization cell by selecting the cell bracket and then choosing Cell 
Cell Properties  Initialization Cell.

4. When you have finished making your changes, choose File  Save and select Mathemat-
ica Package from the Save as type popup menu. Then save the file as
$BaseDirectory\Kernel\init.m.

These commands will be evaluated when users launch Mathematica. If you added a function
definition, that function will be available to all users.

If you have created systemwide defaults you want to carry over to new local installations, you
can add lines to an installation script to copy preconfigured init.m files as part of a new installa-
tion. For information about installation scripts, see "Installing Mathematica on Windows". To
copy systemwide defaults, add a line to the script similar to the line that copies the mathpass
file.
System Administration for Network Licenses 63

Troubleshooting on Windows
Passwords
If the front end password dialog box appears when you launch Mathematica, either
Mathematica could not locate the mathpass file or there was no valid password in the math-
pass file. To resolve this problem, first check that there is a mathpass file in one of these
directories: $BaseDirectory\Licensing, $InstallationDirectory\Configuration\Licensing,
or $UserBaseDirectory\Licensing. To find the exact location of these directories on your
machine, evaluate the command $BaseDirectory (or $InstallationDirectory or
$UserBaseDirectory) in a notebook. If you did not find a mathpass file in these locations,
follow the instructions in "Entering a Single-Machine Password" to reenter your password.

If there is a mathpass file in one of those directories, the password or passwords are invalid.
Make sure that your MathID number matches the MathID number used to issue your password.
If your MathID number changes, you will need to contact Customer Service to get a new pass-
word. Contact information is provided in "Registration and Passwords".

Front End Preferences


Front end preferences, such as the locations of recently opened and saved files, are stored in a
front end initialization file called init.m. This file is located in $UserBaseDirectory\FrontEnd.
The default value of $UserBaseDirectory for different versions of Windows is listed in
"Configuration Files on Windows". To find the exact location of this directory on your machine,
evaluate the command $UserBaseDirectory in a notebook.

If you need to reset the front end preferences to their default values, hold down Shift+Ctrl
during startup. This will cause the initialization file to be rebuilt automatically.

Caches
Information about your Mathematica system layout, such as the locations of text resource files,
is stored in caches. These caches are located in C:\Documents and Settings\username\Local
Settings\Application Data\Mathematica\FrontEnd\7.0 Caches\ on Windows 2000/XP and in
C:\Users\username\AppData\Local\Mathematica\FrontEnd\7.0 Caches\ on Vista.

A corrupted cache may cause the front end to produce an error or quit immediately on startup.
The most convenient way to restore the caches to their default values is to hold down
64 System Administration for Network Licenses

Shift+Ctrl during startup. This will cause the Mathematica caches and the initialization file to be
rebuilt automatically. If you want to rebuild your caches but retain your preferences, hold down
Shift during startup. This will delete and rebuild the cache without rebuilding your front end
initialization file.

Technical Support
For further assistance, check the Technical Support FAQs on the web at support.wolfram.com.
If you are a Site License Administrator, additional Site License Documentation is available at
site.wolfram.com. If you do not find the information you need, please contact Technical Support
by sending email to support@wolfram.com or by calling +1-217-398-6500. Include your license
number in all correspondence. Your license number is located on your electronic or physical
copy of the license certificate. It is also available after installation by going to the Help menu
and clicking About Mathematica. You must be a registered user in order to receive installation
support. You must have a current Premier Service subscription to receive Technical Support.

Unix and Linux


Installing Mathematica on Unix and Linux
Installing Mathematica for Network Licenses
Requirements

Mathematica is available for Windows, Unix, Linux, and Mac OS X. For a complete list of plat-
form availability, visit www.wolfram.com/products/mathematica/platforms.html. Any supported
machine can act as a client for running Mathematica, provided the following two conditions are
met:

† The client has access to the Mathematica files, either locally or from a file server on the
network.

† The license server running MathLM is available on the TCP/IP network.

A license server can also function as its own client. However, this is not recommended. If the
machine has to be rebooted for any reason, the serving of licenses to all other clients on the
network may be disrupted.

Before you install Mathematica as a license server client, MathLM should already be installed
and running on a license server on the network (see "Installing MathLM on Windows", and
"Installing MathLM on Unix, Linux, and Mac OS X" for details). To complete the Mathematica
installation, you will need to know the name or IP address of the license server running MathLM.
System Administration for Network Licenses 65

To install Mathematica on Unix and Linux, you may need root privileges.

To Install Mathematica:

1. Mount the CD or DVD. For information on mounting a CD/DVD, see "Mounting a CD or


DVD on Unix and Linux".

Note: This step may not be required on some Linux and Unix platforms, as some operat-
ing systems automatically handle mounting.

2. Change directory to /cdrom/Unix/Installer. Note that the exact location of the CD/DVD
mount point might be different for your platform.

cd /cdrom/Unix/Installer

3. Run the installer.

./MathInstaller

--------------------------------------------------------------
Wolfram Mathematica 7 Installer
--------------------------------------------------------------

Copyright (c) 1988-2008 Wolfram Research, Inc. All rights reserved.

WARNING: Wolfram Mathematica is protected by copyright law and


international treaties. Unauthorized reproduction or distribution may
result in severe civil and criminal penalties and will be prosecuted to
the maximum extent possible under law.

4. (Unix only) You are asked to select the platforms for which you are doing the installation.
Select one or more of the available options and press Enter to continue.

For which of the following platforms would you like to install


Mathematica?

Type your selection (multiple choices can be separated with spaces), or


press
ENTER to select (1):

5. The installer prompts you to specify the directory in which Mathematica should be in-
stalled. The default location is /usr/local/Wolfram/Mathematica/7.0. Press Enter to
accept the default, or type in a new location and then press Enter.

Enter the installation directory, or press ENTER to select


/usr/local/Wolfram/Mathematica/7.0:

Note: If you specify a directory that does not exist, the installer will give you the option
of creating the directory. If a copy of Mathematica already exists in the directory you
specify, the installer will inform you before overwriting the files.
66 System Administration for Network Licenses

Note: If you are installing over a previous version of Mathematica, your existing math-
pass file and custom settings will not be deleted.

6. Once you have answered all the questions, the installer begins copying files from the
CD/DVD to the directory you specified. The progress is indicated by a progress bar on the
screen.

Now installing...

[*************** ]

7. You are asked for the location in which to copy the executable scripts. You should choose
a directory that is present on each user’s PATH. The scripts are also installed in the ExeÖ
cutables subdirectory of the Mathematica installation directory. Type a location or accept
the default and press Enter.

Type the directory path in which the Mathematica scripts will be created,
or press ENTER to select /usr/local/bin:

Note: The installer checks to see if any other Mathematica scripts exist in the specified
directory. If they do, you are given the chance to rename the scripts.

8. You are given several options for configuring the password. Type 2 and press Enter to run
Mathematica using a network license.

Please choose how you want to configure the password for Mathematica 7.0.

(1) Single machine


Install a password specific to this machine. Mathematica will launch
and you can enter your password.

(2) Network license


Obtain a license from a MathLM license server on your network each time
Mathematica is launched.

(3) Enter license information later


Input your password and register when you start Mathematica.

Type your selection, or press ENTER to select (1):2

9. Type the hostname of the server running MathLM, as given by the hostname command.
In some cases, this includes the domain name. Or, enter the IP address of the MathLM
server. Press Enter to continue.

Enter the hostname of the machine on which your MathLM license manager
is running:
System Administration for Network Licenses 67

Note: The installer does not attempt to verify the server name you type. If you prefer,
you may type any arbitrary text here and press Enter. This creates the mathpass file with
an invalid password entry. You may then edit the mathpass file manually to add a correct
password later. More information on the mathpass file is given in "Registration and
Passwords".

10. The installer creates the mathpass file and displays its location. The installation is now
complete.

Configuring Network Password...

Adding password file entry to /usr/share/Mathematica/Licensing/mathpass...

Installation complete.

The installer also adds an additional menu folder named Wolfram to the desktop menu. Inside
the folder is an item named Mathematica that points to the most recently installed version of
Mathematica. File associations are also modified such that .nb files are now associated with the
most recently installed version of Mathematica.

Installing Mathematica for Single-Machine Licenses


Follow these instructions to install a standalone copy of Mathematica that does not get a license
from the license server. Depending on your license type, this may require contacting Wolfram
Research to purchase additional licenses.

To run Mathematica, you must register with Wolfram Research and receive a password. See
"Registration and Passwords" for further information.

To install Mathematica on Unix and Linux, you may need root privileges.

To Install a Single-Machine Copy of Mathematica on Unix and Linux:

1. Mount the CD or DVD. For information on mounting a CD/DVD, see "Mounting a CD or


DVD on Unix and Linux".

Note: This step may not be required on some Linux and Unix platforms, as some operat-
ing systems automatically handle mounting.

2. Change directory to /cdrom/Unix/Installer. Note that the exact location of the CD/DVD
mount point might be different for your platform.

cd /cdrom/Unix/Installer

3. Run the installer.

./MathInstaller
68 System Administration for Network Licenses

--------------------------------------------------------------
Wolfram Mathematica 7 Installer
--------------------------------------------------------------

Copyright (c) 1988-2008 Wolfram Research, Inc. All rights reserved.

WARNING: Wolfram Mathematica is protected by copyright law and


international treaties. Unauthorized reproduction or distribution may
result in severe civil and criminal penalties and will be prosecuted to
the maximum extent possible under law.

4. (Unix only) You are asked to select the platform for which you are doing the installation.
Select one of the available options and press Enter to continue.

For which of the following platforms would you like to install


Mathematica?

Type your selection (multiple choices can be separated with spaces), or


press
ENTER to select (1):

5. The installer prompts you to specify the directory in which Mathematica should be in-
stalled. The default location is /usr/local/Wolfram/Mathematica/7.0. Press Enter to
accept the default, or type in a new location and then press Enter.

Enter the installation directory, or press ENTER to select


/usr/local/Wolfram/Mathematica/7.0:

Note: If you specify a directory that does not exist, the installer will give you the option
of creating the directory. If a copy of Mathematica already exists in the directory you
specify, the installer will inform you before overwriting the files.

Note: If you are installing over a previous version of Mathematica, your existing math-
pass file and custom settings will not be deleted.

6. Once you have answered all the questions, the installer begins copying files from the
CD/DVD to the directory you specified. The progress is indicated by a progress bar on the
screen.

Now installing...
[*************** ]

7. You are asked for the location in which to copy the executable scripts. You should choose
a directory that is present on each user’s PATH. The scripts are also installed in the ExeÖ
cutables subdirectory of the Mathematica installation directory. Type a location or accept
the default and press Enter.

Type the directory path in which the Mathematica scripts will be created,
or press ENTER to select /usr/local/bin:
System Administration for Network Licenses 69

Note: The installer checks to see if any other Mathematica scripts exist in the specified
directory. If they do, you are given the chance to rename the scripts.

8. You are given several options for configuring the password. Type 1 and press Enter to run
Mathematica using a single-machine license.

Please choose how you want to configure the password for Mathematica 7.0.

(1) Single machine


Install a password specific to this machine. Mathematica will launch
and you can enter your password.

(2) Network license


Obtain a license from a MathLM License Server on your network each
time
Mathematica is launched.

(3) Enter license information later


Input your password and register when you start Mathematica.

Type your selection, or press ENTER to select (1):1

9. Your machine name and MathID number are displayed. To obtain your password, contact
Wolfram Research (see "Registration and Passwords" for details). You will need to supply
your MathID number and the license number located on your electronic or physical copy
of the license certificate.

Configuring Single-Machine Password...

Mathematica 7.0 for operating system


Copyright 1988-2008 Wolfram Research, Inc.

You will need to get a password from your


license certificate or from Wolfram Research
(register.wolfram.com).
Machine name: hostname
MathID: xxxx-xxxxx-xxxxx

You will need a valid license ID and password in order


to proceed. Go to http://register.wolfram.com or
http://reference.wolfram.com/singlemachine for more
information.

10. Enter your name, the name of your organization, your license number (located on your
electronic or physical copy of the license certificate), and your password, and press Enter
when you are done.
70 System Administration for Network Licenses

Enter your name:

Enter the name of your organization:

Enter your license ID [format Lxxxx-xxxx]:

Enter your password:

11. The installer creates the mathpass file and displays its location. The installation is now
complete.

Creating password file entry in


/usr/share/Mathematica/Licensing/mathpass.

See http://reference.wolfram.com/password if
Mathematica is installed on multiple machines
and you need to set up a single, sitewide
password file.

The installer also adds an additional menu folder named Wolfram to the desktop menu. Inside
the folder is an item named Mathematica that points to the most recently installed version of
Mathematica. File associations are also modified such that .nb files are now associated with the
most recently installed version of Mathematica.

Installing Mathematica from a File Server


One convenient way to install Mathematica on a client is to run the installer remotely from a file
server. This is an efficient way of making Mathematica available to a large number of users
without having to supply a CD/DVD to each one. You can install Mathematica from a file server
on a client running any supported Unix or Linux platform. It is not necessary that the client
platform be the same as the file server platform.

To install Mathematica from a file server, you first must make the installer and Mathematica
files available to the clients. You can do this by copying the contents of the CD/DVD to the file

server and exporting the directory, or by exporting the CD/DVD mount point on the file server.
Then, mount the directory with the Mathematica distribution on the client and change to this
directory, and run MathInstaller to install Mathematica on the client machines. (Note that
you must run MathInstaller from the directory in which it is located.) If you are installing
Mathematica in a mixed-platform environment, you may need to use the MathInstaller
option -platform to ensure that the correct files for your platform are installed.
System Administration for Network Licenses 71

Installing Mathematica from a Script


If you are installing Mathematica on multiple machines, it can be time-consuming to respond to
all of the installer prompts on each individual machine. By supplying command-line options to
the MathInstaller command, you can customize various features of the installation process
or automate it entirely.

-auto force the installation to proceed automatically without


prompting the user for any information
-createdir=value specify whether or not to create the directories specified by
the options -targetdir and -execdir
-execdir=dir specify the path to be used for the symbolic links to the
executable scripts
-help display information about the installer options
-method=type define the type of installation you would like to perform
-overwrite=value specify whether the installer should overwrite any files that
already exist in the target directory
-platforms=value specify the system ID of the Unix platform or platforms
(e.g., Linux, Solaris, and so forth) for which you want to
do the installation
-selinux=value specify whether the installer should attempt to modify the
security context of any included libraries so that it will
function properly
-silent force an automatic installation (equivalent to the -auto
option)
-targetdir=dir specify the installation directory
-verbose display detailed information about the files and directories
being installed

MathInstaller command-line options.

Note: Default values are used for any options that are not specified explicitly on the
command line.

Valid input for -createdir is y for yes or n for no. By default, this value is set to y.

The default directory for -execdir is /usr/local/bin. This option only works with an auto-
matic installation.

The values for -method may vary by product. When this option is applicable, the values can be
determined by running the installer. The default value for this option is Full.
72 System Administration for Network Licenses

Valid input for -overwrite is y for yes or n for no. By default, this value is set to y. This option
only works with an automatic installation.

The default for -platforms is the system you are installing on, if that information is available
to the installer. This option only works with an automatic installation.

Valid input for -selinux is y for yes or n for no. By default, this value is set to n.

The option -silent suppresses any output from being displayed on the screen. The output is
instead written to a file named InstallerLog-number. If the installation is unsuccessful, the log
file is saved in the /tmp directory. Otherwise, the file is moved to the target directory and
renamed InstallerLog.

The directory specified for -targetdir corresponds to the value of the global variable
$InstallationDirectory. The default value is /usr/local/Wolfram/Mathematica/7.0.
This option only works with an automatic installation.

To complete the installation in one step, run a command like the following.

./MathInstaller -auto -targetdir=/home/mathematica

This allows you to complete the installation automatically in one step, while still being able to
customize various details such as the directory to install to. You are not prompted to enter your
password using this method, so you will need to enter a password the first time Mathematica is
launched.

If you are doing many installations, you might find it convenient to include the MathInstaller
command with all the relevant options in a shell script. Running the shell script is then an easy
way to do an identical customized installation on multiple machines. You can further simplify
the installation process by including a line in your script that copies an existing mathpass file to
the appropriate location on the newly installed machine. Note that MathInstaller must be run
from the directory in which it is located, so your script may require a command to change
directory. See "Registrations and Passwords" for information on sitewide mathpass
configurations.

Launching Mathematica on Unix and Linux


Launching Mathematica Locally
To run Mathematica using a network license, both the client machine and the license server
must be on the network and MathLM must be running.
System Administration for Network Licenses 73

To Launch Mathematica:

Make sure that you are running MathLM. Then, from a shell, type mathematica and press Enter.

Alternatively, if you are running X, an additional menu folder named Wolfram has already been
added to the desktop menu. In the folder, an item named Mathematica points to the most
recently installed version of Mathematica. File associations have also been modified such that
.nb files now associate with the most recently installed version of Mathematica.

To Launch Only the Mathematica Kernel:

From a shell, type math and press Enter.

Launching Mathematica from a File Server


Rather than installing Mathematica on every client machine, you can install Mathematica on a
file server and export the installation directory to the clients. To display the front end, the
clients must have access to the Mathematica fonts. For information about configuring the X
server on the client machines to find the Mathematica fonts, see "Fonts on Unix and Linux".
Once the fonts are properly configured, the client machines can run Mathematica as though it
were a local installation.

Mathematica Command-Line Options


math

The math command starts the kernel from within a shell. The kernel is the part of Mathematica
that handles calculations. This is also used by the front end.

Command-Line Options

-initfile file specify the name of a file containing startup commands


-lmverbose print diagnostic information to stderr
-mathlink specify that the kernel should be run in MathLink mode
-noinit specify that no initialization file should be read at startup
-password str specify a password to use instead of the password or
passwords stored in the mathpass file
-pwfile file specify the name of a file that has a valid password
-run specify a command to be run on startup as an argument

math command-line options.


74 System Administration for Network Licenses

The option -lmverbose is usefull for debuggin problems related to the license server

The option -mathlink can also be used as a command-line option for the Mathematica front
end. See www.wolfram.com/solutions/mathlink for additional information about MathLink.

The string for -password should have the form "!servername" or "machinename mathid licensenumber
password".

mathematica

The mathematica command runs the X front end. In order for the front end to run, the DISÖ
PLAY environment variable must be set and the front end must be able to locate the fonts
included with Mathematica.

Command-Line Options

-backgroundTaskDelay n specify the time (in milliseconds) that the front end delays
background tasks while waiting for input
-cleanStart ignore stored caches and rebuild the front end preferences
file
-copyright display copyright information on the command line
-dontUpdatePrefs prevent changes to the user's preference settings
-font f specify the font used in menus, buttons, etc.
-help display a list of all command-line options
-lmverbose print diagnostic information to stderr when connecting to
MathLM
-mathlink make the front end run as a child process that is capable of
accepting MathLink packets
-nogui prevent the display of any kind of window or dialogs
-noSplashScreen prevent the splash screen from being displayed on startup
-noTrueTypeFont prevent the use of TrueType font in the display
-preferencesDirectory dir specify the location where preference settings are stored
-primaryModifierMask mask specify the primary mask to be used as the command key
-pwfile file specify a file in which to look for Mathematica passwords
-pwpath p specify the search path for a password file
-secondaryModifierMask mask specify the secondary mask to be used as the command
key
-singleLaunch allow only one copy of the front end per display
System Administration for Network Licenses 75

-stderrWindow send stderr to a popup window instead of a terminal


-style s specify the widget style used by the front end
-topDirectory dir specify the location of the Mathematica installation direc -
tory
-version print the current version of the front end on the command
line

mathematica command-line options.

The default for -backgroundTaskDelay is 100 milliseconds.

The option -cleanStart will ignore the caches stored in the directory
$UserBaseDirectory /FrontEnd/7.0_Caches, and will rebuild the front end preferences
file, $UserBaseDirectory /FrontEnd/init.m. This option can also be abbreviated as
-clean.

When using -font, a list of possible font names can be found by using xfontsel. The name
can be expressed either as an X Logical Font Description or as a valid font alias.

The option -lmverbose is usefull for debuggin problems related to the license server

The option -mathlink may be useful when the front end is used as a typesetting or graphics
rendering service. See www.wolfram.com/solutions/mathlink for additional information about
MathLink.

The default directory for -preferencesDirectory is ~/.Mathematica.

The option -singleLaunch will prohibit multiple front end launches only if the current front end
was launched with the -singleLaunch option.

Valid styles for -style are motif, motifplus, windows, cde, platinum, sgi, and compact.

The defaut location for -topDirectory is /usr/local/Wolfram/Mathematica/7.0.

Testing the Installation on Unix and Linux


The following simple commands allow you to test the installation of Mathematica. Running
these commands does not guarantee that the installation was successful, but a failed command
can indicate that a serious problem occurred during installation.

You should run these tests from a regular user account and not from an account with administra -
tor privileges.
76 System Administration for Network Licenses

To run Mathematica using a network license, both the client machine and the license server
must be on the network and MathLM must be running.

If you run into problems when doing these tests, see the troubleshooting tips in "Trouble-
shooting on Unix and Linux". If you do not find the answer there, check the Technical Support
website at support.wolfram.com/mathematica.

To Test the Kernel:


1. To start the kernel, type math in a shell and press Enter.

In[1]:=

2. Type N[Pi, 20] and press Enter. The number in the output should match the output
shown here.

In[1]:= N[Pi, 20]

Out[1]= 3.1415926535897932385

In[2]:=

3. To exit the kernel, type Exit and press Enter.

On Unix and Linux, you can test the kernel on a remote machine by using the command ssh
hostname /usr/local/bin/math. (The exact pathname could be different depending on how
Mathematica was installed.) This command will launch the kernel on the remote machine host-
name. When you see the In[1] label, follow step 2 and step 3 in the previous instructions.

To Test the Front End:


1. Make sure that you are running X. Launch Mathematica by typing mathematica in a shell
and pressing Enter.

Alternatively, you can select Mathematica from the menu folder Wolfram.

A splash screen with initialization information appears briefly, after which an empty note-
book and the Welcome Screen appear.

2. Type N[Pi,20]. Then hold down the Shift key and press Enter to evaluate. This should
send the command to the kernel and return the same result as before. The In[1] and
Out[1] labels are prepended once the evaluation is completed.

In the notebook window, there should be a horizontal line across the notebook; this is the
horizontal insertion bar. If you do not see one, move the pointer until it becomes a horizon -
tal I-beam and click once to see the insertion bar.
System Administration for Network Licenses 77

3. Press the Esc key. You should see three small horizontal lines in a column (Ç). Type int
and press Esc again. You should see an integral sign (Ÿ ). As an additional font check,
typing î[CheckmarkedBox] and î[CirclePlus] should print the symbols  and ⊕,
respectively. If the symbols show up correctly, the fonts have been properly installed.

4. From the Help menu, choose Documentation Center. The Mathematica Documentation
Center should appear.

On Unix and Linux, you can test the X front end remotely, provided the ssh server on the
remote machine allows X forwarding. You must be running X on the local machine to do this. In
a shell, type ssh -X hostname /usr/local/bin/mathematica. (The exact pathname could be
different depending on how Mathematica was installed.) This command will launch Mathematica
on the remote machine hostname. When the splash screen appears on your screen, follow step 2
and step 3 in the previous instructions.

Configuration Files on Unix and Linux


Mathematica stores preference settings and initialization data in two directories,
$BaseDirectory and $UserBaseDirectory. Within each of these directories are several possi-
ble subdirectories with titles such as FrontEnd, Kernel, and Licensing.

† Global settings that affect all users are stored in subdirectories of the directory
$BaseDirectory. The default value of $BaseDirectory on Unix and Linux is
/usr/share/Mathematica. To redefine the location of global preference settings and
initialization data, set the environment variable MATHEMATICA_BASE.

† Settings that only affect a particular user are stored in subdirectories of the directory
$UserBaseDirectory, which is typically a subdirectory of the user’s home directory. The
default value of $UserBaseDirectory on Unix and Linux is ~/.Mathematica. To redefine
the location of user preferences and initialization data, set the environment variable
MATHEMATICA_USERBASE.

Settings in the directory $UserBaseDirectory override global settings defined in the directory
$BaseDirectory.

In the pathnames that follow, replace the variables $BaseDirectory and $UserBaseDirectory
with the appropriate directories for your system. To find their locations on your system, evalu-
ate the command $BaseDirectory (or $UserBaseDirectory) in a Mathematica notebook.

Kernel
The initialization files used by the kernel contain Mathematica commands that are evaluated at
startup, such as function definitions, packages to load, or kernel option settings. These com-
mands are also available to the Mathematica front end.
78 System Administration for Network Licenses

$BaseDirectory /Kernel/init.m

This file is used to initialize the kernel and therefore should store any kernel commands
that are appropriate for all users running the kernel.

$UserBaseDirectory /Kernel/init.m

This file stores user-specific commands used to initialize the kernel.

Kernel initialization files are not created automatically.

Front End
Front end initialization files store preference settings such as the values of global options in the
Option Inspector. These files are automatically updated by Mathematica when you change a
setting in the front end. To make changes to this file, make your changes from within Mathemat-
ica rather than editing the file directly.

$BaseDirectory /FrontEnd/init.m

This file stores systemwide defaults used by all Mathematica front ends. The settings in
this file affect all users. "Systemwide Defaults on Unix and Linux" explains how to imple-
ment changes to this global file.

$UserBaseDirectory /FrontEnd/init.m

This file defines settings within the front end that are specific to each user.

$UserBaseDirectory /FrontEnd/7.0_Caches/

This directory within the user’s home directory stores information on system settings that
are read by the front end.

Front end initialization files are created automatically.

Passwords
Passwords are stored in the mathpass file, described in further detail in "Registration and
Passwords". In the following pathname, replace the variable $InstallationDirectory with the
directory where you installed Mathematica. The default value of $InstallationDirectory on
Unix and Linux is /usr/local/Wolfram/Mathematica/7.0. To find the value of
$InstallationDirectory on your system, evaluate the command $InstallationDirectory
in a Mathematica notebook.
System Administration for Network Licenses 79

$BaseDirectory /Licensing/mathpass

This is the default location for the global password file.

$InstallationDirectory /Configuration/Licensing/mathpass

This is an alternative location for the global password file.

$UserBaseDirectory /Licensing/mathpass

While this is not normally the location for the password file, a user-specific mathpass file
can be stored here.

Systemwide Defaults on Unix and Linux


If you have installed Mathematica in a location where multiple users run it (for example, on a
file server or multi-user machine), then you can set up systemwide defaults for the Mathemat-
ica front end and kernel. This is ideal for setting up Mathematica for use in computer labs and
classrooms. If you share the directory $BaseDirectory across the network, these defaults will
also take effect on local installations that use the shared $BaseDirectory.

The following instructions assume that $BaseDirectory and $UserBaseDirectory have their
default values, /usr/share/Mathematica and ~/.Mathematica respectively.

To Set Up a Configuration File for the Front End:


1. Launch Mathematica, and set up any changes to the front end that you need. For exam-
ple, you may want to modify default file locations, language options, or menu settings.

2. Quit Mathematica.

3. Copy the file ~/.Mathematica/FrontEnd/init.m to the directory /usr/share/


Mathematica/FrontEnd.

These settings will now be used by the front end unless overridden by the local init.m file stored
in the user’s directory ~/.Mathematica/FrontEnd.

To Set Up a Configuration File for the Kernel:


1. Launch Mathematica, and create a new file.

2. Add any Mathematica commands that should be evaluated on startup. For example, you
may want to add a function definition or display a message at startup. Enter all the com-
mands in the same cell, separating commands with semicolons.
80 System Administration for Network Licenses

3. Make this cell an initialization cell by selecting the cell bracket and then choosing Cell 
Cell Properties  Initialization Cell.

4. When you have finished making your changes, choose File  Save and select
Mathematica Package from the Save as type popup menu. Then save the file as
/usr/share/Mathematica/Kernel/init.m.

These commands will be evaluated when users launch Mathematica. If you added a function
definition, that function will be available to all users.

Fonts on Unix and Linux


Dealing with fonts under Unix and Linux can sometimes be tricky. The important issues in
dealing with fonts in Mathematica are presented here for your convenience.

Font Formats
The Mathematica front end supports BDF, TrueType, and Type1 fonts. These fonts are automati-
cally installed by MathInstaller during installation.

Font Installation
All machines that display the front end must have access to the fonts included with Mathemat-
ica. If the Mathematica process is running on a remote machine and the front end is displayed
on the local machine, the X server on the local machine must know where to find the Mathemat-
ica fonts. To do this, add the Mathematica fonts to the local font path by running a command
like the following on the local machine.

xset fp+ /usr/local/Wolfram/Mathematica/7.0/SystemFiles/Fonts/Type1; xset fp


rehash

Be sure to execute xset fp rehash to make the fonts available to the local X server.

For optimal onscreen performance, Type1 fonts should appear before BDF fonts in the font
path. Hence, $InstallationDirectory/SystemFiles/Fonts/Type1 should appear before
$InstallationDirectory/SystemFiles/Fonts/BDF. You can check the order of the font
path by executing the command xset q.

Note: TrueType fonts are automatically loaded and do not require an xset command.
System Administration for Network Licenses 81

Font Servers
You may prefer not to install local copies of the Mathematica fonts on all machines. You can
instead set up a font server with all the necessary Mathematica fonts. The other machines on
the network can then find the fonts as needed by reading them from the Mathematica directory
on the font server. Consult your operating system’s documentation for further information.

Common Font Errors


On some systems, the font path is limited in length, and it is possible to receive xset: bad
font path element errors even if the fonts are available to the server. In this case, try reorder-
ing the font path and adding the directories for the Mathematica fonts earlier in the path. The
directory $InstallationDirectory/SystemFiles/Fonts/Type1 must be listed before
$InstallationDirectory/SystemFiles/Fonts/BDF on the font path for optimal onscreen
performance.

Fonts and Printing


When the X front end prints a notebook, it uses AFM files for the font metrics needed
for printing. If you want to print using a particular font not included with Mathematica,
you will need the AFM files for the font. These files are installed in either
$InstallationDirectory/Configuration/Fonts/AFM, /usr/lib/AFM, or /usr/lib/afm.
Fonts are normally downloaded to the printer by the front end when printing. You may be able
to download the fonts and store them on the printer. See the documentation and programs that
came with your printer for more information.

GhostScript
If you want to view Mathematica graphics using GhostScript, you need to make GhostScript
aware of the Mathematica fonts. For more information, contact Technical Support by sending
email to support@wolfram.com, or visit support.wolfram.com/mathematica/graphics/export
/ghostscript.html.
82 System Administration for Network Licenses

Troubleshooting on Unix and Linux


If you have problems using Mathematica on Unix or Linux, check this list for solutions.

CD or DVD
† Make sure the CD or DVD is properly mounted with the correct mount command (see
"Mounting a CD or DVD on Unix and Linux"). If the filenames on the CD/DVD appear in the
wrong case, it means the CD/DVD is mounted incorrectly.

Installation
Make sure to run the installer from the directory in which it is located.

Passwords
If the front end password dialog box appears when you launch Mathematica, either Mathemat-
ica could not locate the mathpass file or there was no valid password in the mathpass file.
To resolve this problem, first check that there is a mathpass file in one of these directories:
/usr/share/Mathematica/Licensing, $InstallationDirectory/Configuration/Licensing,
or ~/.Mathematica/Licensing. If you did not find a mathpass file in these locations, follow
the instructions in "Entering a Single-Machine Password" to reenter your password.

If there is a mathpass file in one of those directories, the password or passwords are invalid.
Make sure that your MathID number matches the MathID number used to issue your password.
If your MathID number changes, you will need to contact Customer Service to get a new pass-
word. Contact information is provided in "Registration and Passwords".

Paths

Front End Preferences


Front end preferences, such as the names of recently opened and saved files, are stored in
~/.Mathematica/FrontEnd. The most convenient way to reset the front end preferences to
their default values is to restart Mathematica using the command mathematica -cleanStart.
This will cause the initialization file to be rebuilt automatically.
System Administration for Network Licenses 83

Caches
Information about your Mathematica layout, such as the locations of text resource files, is
stored in caches. These caches are located in the directory ~/.Mathematica/FrontEnd/
7.0_Caches. A corrupted cache may cause the front end to produce an error or quit immedi-
ately on startup. The most convenient way to reset the caches to their default values is to use
the option -cleanStart at startup. This will cause the Mathematica caches and the initializa-
tion file to be rebuilt automatically. If you want to rebuild your caches but retain your prefer-
ences, hold down Shift during startup. This will delete and rebuild the cache without rebuilding
the front end initialization file.

Fonts
† Make sure that the fonts are installed on the machine that displays the front end or on a
font server.

† If you see the error xset: bad font path element, either the fonts are not properly
installed on your machine, or your font path is too long and exceeds the allowable limit.
Make sure the fonts are properly installed, or copy the fonts to a directory that is already on
the font path.

Technical Support
For further assistance, check the Technical Support FAQs on the web at support.wolfram.com.
If you are a Site License Administrator, additional Site License Documentation is available at
site.wolfram.com. If you do not find the information you need, please contact Technical Support
by sending email to support@wolfram.com or by calling +1-217-398-6500. Include your license
number in all correspondence. Your license number is located on your electronic or printed
license certificate. It is also available after installation by going to the Help menu and clicking
About Mathematica. You must be a registered user in order to receive installation support.
You must have a current Premier Service subscription to receive Technical Support.
84 System Administration for Network Licenses

Mac OS X
Installing Mathematica on Mac OS X
Installing Mathematica for Network Licenses
Requirements

Mathematica is available for Windows, Unix, Linux, and Mac OS X. For a complete list of plat-
form availability, visit www.wolfram.com/products/mathematica/platforms.html. Any supported
machine can act as a client for running Mathematica, provided the following two conditions are
met:

† The client has access to the Mathematica files, either locally or from a file server on the
network.

† The license server running MathLM is available on the TCP/IP network.

A license server can also function as its own client. However, this is not recommended. If the
machine has to be rebooted for any reason, the serving of licenses to all other clients on the
network may be disrupted.

Before you install Mathematica as a license server client, MathLM should already be installed
and running on a license server on the network (see "Installing MathLM" for details). To com-
plete the Mathematica installation, you will need to know the name or IP address of the license
server running MathLM.

To install Mathematica on Mac OS X in the Applications folder, you must log on as


administrator.

To Install Mathematica:

1. Insert the DVD. A new window appears on your screen.


System Administration for Network Licenses 85

2. Drag the Mathematica icon from this window to the location on your hard drive where you
want to install Mathematica. In order for all users to have access to Mathematica, you
should install it in the systemwide Applications folder. You must have administrative
privileges to do this.

Note: If you are installing over a previous version of Mathematica, your existing math-
pass file and custom settings will not be deleted.

3. When all files have been copied, launch Mathematica by opening the folder where you
installed Mathematica and double-clicking the Mathematica icon.

4. Mathematica starts up and the following dialog box appears. Select Network license.
Then enter the name or IP address of the MathLM license server in the text field provided.

5. Click OK. Mathematica launches and is ready for use.

After you install Mathematica you can place the Mathematica icon into the Dock for easier
access. To do this, start Mathematica, and hold down the Ctrl key while clicking the Mathemat-
ica icon in the Dock. In the popup menu that appears, choose Keep in Dock.

Installing Mathematica for Single-Machine Licenses


Follow these instructions to install a standalone copy of Mathematica that does not get a license
from the license server. Depending on your license type, this may require contacting Wolfram
Research to purchase additional licenses.

To run Mathematica, you must register with Wolfram Research and receive a password. See
"Registration and Passwords" for further information.
86 System Administration for Network Licenses

To Install a Single-Machine Copy of Mathematica on Mac OS X:

1. Insert the Mathematica DVD. A new window appears on your screen.

2. Drag the Mathematica icon from the window to the location on your hard drive where you
want to install Mathematica.

Note: If you are installing over a previous version of Mathematica, your existing math-
pass file and custom settings will not be deleted.

3. When all files have been copied, launch Mathematica by opening the folder where you
installed Mathematica and double-clicking the Mathematica icon.

4. Mathematica starts up and the following dialog box appears. Select Single machine.
Enter your name, the name of your organization, and your license number (located on
your electronic or printed certificate) in the text fields provided. Click OK when you are
done.
System Administration for Network Licenses 87

5. The following dialog box appears showing the MathID number for your machine. To obtain
your password, click the Web button, go to register.wolfram.com, or contact Wolfram
Research (see "Registration and Passwords" for further information). You will need to
supply your license number and your MathID number.

6. Enter your password and click OK. You are now ready to start using Mathematica.

Installing Mathematica from a File Server


One convenient way to install Mathematica on a client is to copy the files from a file server on
the network. This is an efficient way of making Mathematica available to a large number of
users without having to supply a DVD to each user.

Before following these instructions, Mathematica should be installed on the file server according
to the instructions in "Network License" and "Single-Machine License".

To Install Mathematica from a File Server:

1. On the client machine, select Go  Connect to Server in the Finder menu.

2. In the dialog box that appears, choose a file server from the list or enter the machine
name or IP address of the file server in the text field. Then click Connect.
88 System Administration for Network Licenses

3. Enter your name and password in the dialog box that appears. Then click Connect.

4. A dialog box appears, showing a list of volumes on the file server. Select the volume in
which Mathematica is installed. Then click OK.

5. The volume you selected is mounted on the client machine. Double-click the icon represent-
ing the volume.

6. Navigate to the location where Mathematica is installed. Then drag the Mathematica
package from the file server to the location on the client machine where you want to
install Mathematica. In order for all users to have access to Mathematica, you should
install it in the Applications folder. You must log on as administrator to do this.
System Administration for Network Licenses 89

Launching Mathematica on Mac OS X


Launching Mathematica Locally
To run Mathematica using a network license, both the client machine and the license server
must be on the network and MathLM must be running.

To Launch Mathematica:

Double-click the Mathematica icon in the directory where Mathematica is installed. Alterna-
tively, if you have placed the Mathematica icon in the dock, single-click the icon.

To Launch Only the Mathematica Kernel:

Open the Terminal application and type the full pathname of the MathKernel binary in the
window that appears. For example, if you installed Mathematica in the Applications folder,
type /Applications/Mathematica.app/Contents/MacOS/MathKernel in a Terminal win-
dow and press Return.

Launching Mathematica from a File Server


To maintain a centralized location for preferences and password files or to save disk space, you
can run Mathematica directly from a file server. To do this, the client machine does not need to
have any Mathematica files installed locally.

To Run a Copy of Mathematica Installed on a Remote File Server:

1. Connect to a file server on which Mathematica is installed.

2. Double-click the icon representing the volume with the Mathematica files. Then navigate
to the location where Mathematica is installed.

3. Double-click the Mathematica icon in the directory where Mathematica is installed.

Mathematica Command-Line Options


The commands MathKernel and Mathematica have several command-line options used to
specify certain configuration information and file locations.

MathKernel

The command MathKernel starts the kernel, which is the part of Mathematica that handles
calculations. This command is also used by the Mathematica front end.
90 System Administration for Network Licenses

-initfile file Specifies the name of a file containing commands to be run


on startup.
-lmverbose Prints diagnostic information to stderr on connecting to
the license manager. This is useful for debugging problems
related to the license server.
-mathlink Specifies that the kernel should be run in MathLink mode.
See www.wolfram.com/solutions/mathlink for additional
information about MathLink.
-noinit Specifies that no initialization file should be read at startup.
-password str Specifies a password to use instead of the password or
passwords stored in the mathpass file. The password
should have the form "!servername" or "machinename mathid
licensenumber password".
-pwfile file Specifies the name of a file that has a valid password.
-run Takes a command to be run on startup as an argument.

MathKernel command-line options.

Mathematica

The command Mathematica runs the Mathematica front end. In order to run Mathematica with
a command-line option, you must start it from the command line using the Terminal applica-
tion.

-cleanStart Tells the front end to ignore caches stored in the directory
~/Library/Mathematica/FrontEnd/7.0 Caches, and rebuilds
the front end preferences file,
~/Library/Mathematica/FrontEnd/init.m.
-mathlink Causes the front end to run in MathLink mode. In MathLink
mode, the front end runs as a child process that is capable
of accepting MathLink packets. This option may be useful
when the front end is used as a typesetting or graphics
rendering service.
-preferencesDirectory dir Specifies the location where preference settings are stored.
The default location is ~/Library/Mathematica.
-topDirectory dir Specifies the location of the Mathematica installation
directory.

Mathematica command-line options.


System Administration for Network Licenses 91

Testing the Installation on Mac OS X


The following simple commands allow you to test the installation of Mathematica. Running
these commands does not guarantee that the installation was successful, but a failed command
can indicate that a serious problem occurred during installation.

You should run these tests from a regular user account and not from an account with administra-
tor privileges.

To run Mathematica using a network license, both the client machine and the license server
must be on the network and MathLM must be running.

If you run into problems when doing these tests, see the troubleshooting tips in "Trouble-
shooting on Mac OS X". If you do not find the answer there, check the Technical Support web-
site at support.wolfram.com/mathematica.

To Test the Kernel:


1. To start the kernel, open the Terminal application and type the full pathname of the
MathKernel binary in the window that appears. For example, if you installed Mathematica
in the Applications folder, type /Applications/Mathematica.app/Contents/MacOS/
MathKernel in a Terminal window and press Return.

In[1]:=

2. Type N[Pi, 20] and press Return. The number in the output should match the output
shown here.

In[1]:= N[Pi, 20]

Out[1]= 3.1415926535897932385

In[2]:=

3. To exit the kernel, type Exit and press Return.


92 System Administration for Network Licenses

To Test the Front End:


1. Launch Mathematica by double-clicking the Mathematica icon.

A splash screen with initialization information appears briefly, after which an empty note-
book and the Welcome Screen appear.

2. Type N[Pi,20]. Then hold down the Shift key and press Enter to evaluate. This should
send the command to the kernel and return the same result as before. The In[1] and
Out[1] labels are prepended once the evaluation is completed.

In the notebook window, there should be a horizontal line across the notebook; this is the
horizontal insertion bar. If you do not see one, move the pointer until it becomes a horizon-
tal I-beam and click once to see the insertion bar.

3. Press the Esc key. You should see three small horizontal lines in a column (Ç). Type int
and press Esc again. You should see an integral sign (Ÿ ). As an additional font check,
typing î[CheckmarkedBox] and î[CirclePlus] should print the symbols  and ⊕,
respectively. If the symbols show up correctly, the fonts have been properly installed.

4. From the Help menu, choose Documentation Center. The Mathematica Documentation
Center should appear.

Configuration Files on Mac OS X


Mathematica stores preference settings and initialization data in two directories,
$BaseDirectory and $UserBaseDirectory. Within each of these directories are several possi-
ble subdirectories with titles such as FrontEnd, Kernel, and Licensing.

† Global settings that affect all users are stored in subdirectories of the directory
$BaseDirectory. The default value of $BaseDirectory on Mac OS X is
/Library/Mathematica. To redefine the location of global preference settings and initializa-
tion data, set the environment variable MATHEMATICA_BASE.

† Settings that only affect a particular user are stored in subdirectories of the directory
$UserBaseDirectory, which is typically a subdirectory of the user's home directory. The
default value of $UserBaseDirectory on Mac OS X is ~/Library/Mathematica. To redefine
the location of user preferences and initialization data, set the environment variable
MATHEMATICA_USERBASE.
System Administration for Network Licenses 93

Settings in the directory $UserBaseDirectory override global settings defined in the directory
$BaseDirectory.

In the pathnames that follow, replace the variables $BaseDirectory and $UserBaseDirectory
with the appropriate directories for your system. To find their locations on your system, evalu-
ate the command $BaseDirectory (or $UserBaseDirectory) in a Mathematica notebook.

Kernel
The initialization files used by the kernel contain Mathematica commands that are evaluated at
startup, such as function definitions, packages to load, or kernel option settings. These com-
mands are also available to the Mathematica front end.

$BaseDirectory/Kernel/init.m

This file is used to initialize the kernel and therefore should store any kernel commands
that are appropriate for all users running the kernel.

$UserBaseDirectory/Kernel/init.m

This file stores user-specific commands used to initialize the kernel.

Kernel initialization files are not created automatically.

Front End
Front end initialization files store preference settings such as the values of global options in the
Option Inspector. These files are automatically updated by Mathematica when you change a
setting in the front end. To make changes to this file, make your changes from within Mathemat-
ica rather than editing the file directly.

$BaseDirectory/FrontEnd/init.m

This file stores systemwide defaults used by all Mathematica front ends. The settings in
this file affect all users. "Systemwide Defaults on Mac OS X" explains how to implement
changes to this global file.

$UserBaseDirectory/FrontEnd/init.m
94 System Administration for Network Licenses

This file defines settings within the front end that are specific to each user.

$UserBaseDirectory/FrontEnd/7.0 Caches/

This directory within the user's home directory stores information on system settings that
are read by the front end.

Front end initialization files are created automatically.

Passwords
Passwords are stored in the mathpass file, described in further detail in "Registration and Pass-
words". In the following pathname, replace the variable $InstallationDirectory with the
directory where you installed Mathematica. To find the value of $InstallationDirectory on
your system, evaluate the command $InstallationDirectory in a Mathematica notebook.

$BaseDirectory/Licensing/mathpass

This is the default location for the global password file.

$InstallationDirectory/Configuration/Licensing/mathpass

This is an alternative location for the global password file.

$UserBaseDirectory/Licensing/mathpass

While this is not normally the location for the password file, a user-specific mathpass file
can be stored here.

Systemwide Defaults on Mac OS X


If you have installed Mathematica in a location where multiple users run it (for example, on a
file server or multi-user machine), then you can set up systemwide defaults for the Mathemat-
ica front end and kernel. This is ideal for setting up Mathematica for use in computer labs and
classrooms. If you share the directory $BaseDirectory across the network, these defaults will
also take effect on local installations that use the shared $BaseDirectory.

The following instructions assume that $BaseDirectory and $UserBaseDirectory have their
default values, /Library/Mathematica and ~/Library/Mathematica, respectively.

To Set Up a Configuration File for the Front End:


1. Launch Mathematica, and set up any changes to the front end that you need. For exam-
ple, you may want to modify default file locations, language options, or menu settings.
System Administration for Network Licenses 95

2. Quit Mathematica.

3. Copy the file ~/Library/Mathematica/FrontEnd/init.m to the directory /Library/


Mathematica/FrontEnd.

These settings will now be used by the front end unless overridden by the local init.m file stored
in the user's ~/Library/Mathematica/FrontEnd directory.

To Set Up a Configuration File for the Kernel:


1. Launch Mathematica, and create a new file.

2. Add any Mathematica commands that should be evaluated on startup. For example, you
may want to add a function definition or display a message at startup. Enter all the com-
mands in the same cell, separating commands with semicolons.

3. Make this cell an initialization cell by selecting the cell bracket and then choosing Cell 
Cell Properties  Initialization Cell.

4. When you have finished making your changes, choose File  Save and select
Mathematica Package from the Save as type popup menu. Then save the file as
/Library/Mathematica/Kernel/init.m.

These commands will be evaluated when users launch Mathematica. If you added a function
definition, that function will be available to all users.

Troubleshooting on Mac OS X
Passwords
If the front end password dialog box appears when you launch Mathematica, either Mathemat-
ica could not locate the mathpass file or there was no valid password in the mathpass file. To
resolve this problem, first check that there is a mathpass file in one of these directories:
/Library/Mathematica/Licensing, $InstallationDirectory/Configuration/Licensing, or
~/Library/Mathematica/Licensing. To find the exact location of $InstallationDirectory on
your machine, evaluate the command $InstallationDirectory in a notebook. If you did not
find a mathpass file in these locations, follow the instructions in "Entering a Single-Machine
Password" to reenter your password.

If there is a mathpass file in one of those directories, the password or passwords are invalid.
Make sure that your MathID number matches the MathID number used to issue your password.
If your MathID number changes, you will need to contact Customer Service to get a new pass-
word. Contact information is provided in "Registration and Passwords".
96 System Administration for Network Licenses

Front End Preferences


Front end preferences, such as the locations of recently opened and saved files, are stored
in a front end initialization file called init.m. This file is located in the directory ~/Library/
Mathematica/FrontEnd. If you need to reset the front end preferences to their default values,
hold down Shift+Option during startup. This will cause the initialization file to be rebuilt automat-
ically.

Caches
Information about your Mathematica system layout, such as the locations of text resource
files and help files, is stored in caches. These caches are located in the directory ~/Library/
Mathematica/FrontEnd/7.0/ Caches.

A corrupted cache may cause the front end to produce an error or quit immediately on startup.
The most convenient way to restore the caches to their default values is to hold down
Shift+Option during startup. This will cause the Mathematica caches and the initialization file to
be rebuilt automatically.

If you want to rebuild your caches but retain your preferences, hold down Shift during startup.
This will delete and rebuild the cache without rebuilding your front end initialization file.

Technical Support
For further assistance, check the Technical Support FAQs on the web at support.wolfram.com.
If you are a Site License Administrator, additional Site License Documentation is available at
site.wolfram.com. If you do not find the information you need, please contact Technical Support
by sending email to support@wolfram.com or by calling +1-217-398-6500. Include your license
number in all correspondence. Your license number is located on your electronic or printed
license certificate. It is also available after installation by going to the Help menu and clicking
About Mathematica. You must be a registered user in order to receive installation support.
You must have a current Premier Service subscription to receive Technical Support.
System Administration for
Single-Machine Licenses
System Administration for Single-Machine Licenses 99

Mathematica
Windows
Installing Mathematica on Windows
Installing Mathematica for Network Licenses
Requirements

Mathematica is available for Windows, Unix, Linux, and Mac OS X. For a complete list of plat-
form availability, visit www.wolfram.com/products/mathematica/platforms.html. Any supported
machine can act as a client for running Mathematica, provided the following two conditions are
met:

† The client has access to the Mathematica files, either locally or from a file server on the
network.

† The license server running MathLM is available on the TCP/IP network.

A license server can also function as its own client. However, this is not recommended. If the
machine has to be rebooted for any reason, the serving of licenses to all other clients on the
network may be disrupted.

Before you install Mathematica as a license server client, MathLM should already be installed
and running on a license server on the network (see "Installing MathLM" for details). To com-
plete the Mathematica installation, you will need to know the name or IP address of the license
server running MathLM.

To install Mathematica on Windows 2000/XP/Vista, you must have administrative privileges.


100 System Administration for Single-Machine Licenses

To Install Mathematica:

1. Insert the Mathematica DVD. The Wolfram Mathematica 7 window appears on your
screen. Click the button labeled Install Mathematica to a hard disk.

2. The Wolfram Mathematica Setup dialog appears on your screen. Click Next to begin
the installation process.
System Administration for Single-Machine Licenses 101

3. By default, Mathematica is installed in the directory C:\Program Files\Wolfram Research\


Mathematica\7.0. To choose another destination directory, click Browse. Click Next to
continue.

4. Mathematica is configured to automatically install all optional components. To chose


another configuration, de-select any components by clicking on the corresponding check
box. Click Next to continue.
102 System Administration for Single-Machine Licenses

5. Click Next to add Mathematica shortcuts to the Start menu in the Wolfram Mathematica
folder. If you would like to select a different folder, click Browse.

6. Click Install to install Mathematica.


System Administration for Single-Machine Licenses 103

7. Click Finish to complete the installation and launch Mathematica.

8. Mathematica starts up and the following password dialog box appears. Select Network
License. Then enter the name or IP address of the license server running MathLM in the
text field provided.

9. Click OK. You are now ready to start using Mathematica.

Installing Mathematica for Single-Machine Licenses


Follow these instructions to install a standalone copy of Mathematica that does not get a license
from a license server. Depending on your license type, this may require contacting Wolfram
Research to purchase additional licenses.
104 System Administration for Single-Machine Licenses

To run Mathematica, you must register with Wolfram Research and receive a password. See
"Registration and Passwords" for further information.

To install Mathematica on Windows 2000/XP/Vista, you must have administrative privileges.

To Install a Single-Machine Copy of Mathematica on Windows:

1. Insert the Mathematica DVD. The Wolfram Mathematica 7 window appears on your
screen. Click the button labeled Install Mathematica to a hard disk.

2. The Wolfram Mathematica Setup dialog appears on your screen. Click Next to begin
the installation process.
System Administration for Single-Machine Licenses 105

3. By default, Mathematica is installed in the directory C:\Program Files\Wolfram Research\


Mathematica\7.0. To choose another destination directory, click Browse. Click Next to
continue.

4. Mathematica is configured to automatically install all optional components. To chose


another configuration, de-select any components by clicking on the corresponding check-
box. Click Next to continue.
106 System Administration for Single-Machine Licenses

5. Click Next to add Mathematica shortcuts to the Start menu under Wolfram Mathematica.

6. Click Install to install Mathematica.


System Administration for Single-Machine Licenses 107

7. Click Finish to complete the installation and launch Mathematica.

8. Mathematica starts up and the following password dialog box appears. Select Single
Machine. Then enter your name, the name of your organization, and your license num-
ber (located on your electronic or printed license certificate) in the text fields provided.
Click OK when you are done.
108 System Administration for Single-Machine Licenses

9. The following dialog box appears showing the MathID number for your machine. To obtain
your password, click the Web button, go to register.wolfram.com, or contact Wolfram
Research (see "Registration and Passwords" for further information). You will need to
supply your license number and your MathID number.

10. Enter your password and click OK. You are now ready to start using Mathematica.

Installing Mathematica from a File Server


One convenient way to install Mathematica is to run the installer remotely from a file server.
This is an efficient way of making Mathematica available to a large number of users without
having to supply a DVD to each one.

Installing Mathematica from a file server requires first copying the installer executable and all
files in the Mathematica distribution from the DVD onto the file server.

1. Insert the Mathematica DVD into the drive on the file server. Open a My Computer
window, then right-click the DVD in the list and select Open.

2. An Explorer window appears showing the contents of the DVD. Select the Windows folder.

3. Copy the Windows folder from the DVD to a location on the file server accessible to exter-
nal users over the network.

Once this step is complete, you can install the Mathematica files on each client.

4. From the client, connect to the file server and open the Windows directory that was cre-
ated on the file server.

5. Double-click the file Setup.exe to launch the installer.

6. Follow the same steps as for installing from a DVD (see "Network License" and "Single-
Machine License").
System Administration for Single-Machine Licenses 109

Installing Mathematica from a Script


If you are installing Mathematica on multiple machines, it can be time-consuming to respond to
all of the installer prompts on each individual machine. By supplying command-line options to
the installer, you can customize various features of the installation process or automate it
entirely.

/dir="C:\path\here" specify the installation directory


DisableShellVerbs disable file associations for .m, .nb, .nbp, etc. (enabled by
default)
/group="start menu folder name" specify the start menu folder name
/noicons disable creation of start menu folder and shortcuts
/norestart do not restart the system, even if necessary
/restartexitcode=code specify the installer exit code to return if restart is
necessary
/silent force an automatic installation and suppress installation
windows
/suppressmsgboxes suppress installer message boxes (only effective when
used in conjuction with /silent)

Mathematica Installer supported command-line options.

To Create a Script That Performs a Silent Mathematica Installation:

The following instructions explain how to write a simple script to silently install Mathematica
from a file server. These instructions require that you have a mathpass file with a valid pass-
word. See "Registrations and Passwords" for more information on sitewide mathpass
configurations.

1. Follow the instructions in the first part of "Installing Mathematica from a File Server" to
copy the installer and files from the DVD to a file server.

2. Copy your mathpass file to the same directory on the file server as the installer and
Mathematica files.

3. Open Notepad (Start Menu  Programs  Accessories  Notepad) and type the follow-
ing lines into a new file.

@echo off
echo Installing Mathematica...
\\server\math\setup.exe /silent /suppressmsgboxes /log="C:\Windows\Temp\install.log"
echo Creating password file...
copy \\server\math\mathpass "C:\Directory\Name"
echo Mathematica installation complete.
110 System Administration for Single-Machine Licenses

Change all instances of \\server\math to the pathname of the network share where the
Mathematica installation files and mathpass file were copied.

5. Change "C:\Directory\Name" to the directory listed here for your version of Windows.
Be sure to enclose the name of the directory in quotes.

Windows 2000/XP~
"C:\Documents and Settings\All Users\Application Data\Mathematica"

Windows Vista~"C:\ProgramData\Mathematica"

Note: These directories are the values of $BaseDirectory for different versions of
Windows. See "Configuration Files on Windows" for further information.

6. To save the file, choose File  Save. Save the file in the same directory as the Mathemat-
ica installation files. Type the filename install.bat, and choose All Files from the Save as
type popup menu. Click Save, then quit Notepad.

To Perform a Silent Mathematica Installation:

1. On the client, open a Command Prompt window, type the pathname of the install.bat
file, and press Enter. For example, if the network share is called \\server\math, type:

\\server\math\install.bat

The following messages are displayed.

Installing Mathematica...
Creating password file...
Mathematica installation complete.

2. The installation is now complete. If you see any messages other than those printed here,
check the file C:\Windows\Temp\install.log on the client machine for further information.

Installing Mathematica in this way eliminates the need to take the DVD to each client machine,
and saves time by allowing you to run a simple script instead of responding to the installer
questions.

Launching Mathematica on Windows


Launching Mathematica Locally
To run Mathematica using a network license, both the client machine and the license server
must be on the network, and MathLM must be running.
System Administration for Single-Machine Licenses 111

To Launch Mathematica:

From the Start menu, choose Programs  Wolfram Mathematica  Mathematica 7.

Alternatively, you can open an Explorer window, go to the Program Files\Wolfram Research\
Mathematica\7.0 directory, and double-click the Mathematica icon.

To Launch Only the Mathematica Kernel:

From the Start menu, choose Programs  Wolfram Mathematica  Mathematica 7 Kernel.

Alternatively, you can open an Explorer window, go to the Program Files\Wolfram Research\
Mathematica\7.0 directory, and double-click the MathKernel icon.

To Launch the Mathematica Kernel inside a Command Prompt Window:

Open a command prompt window and change directory to the top-level Mathematica installa-
tion directory. Type .\math and press Enter.

Launching Mathematica from a File Server


You can also run Mathematica directly from a file server, without installing files locally. To do
this, install Mathematica on the file server and make the installation directory accessible to the
client machines. Running Mathematica from a file server differs from running a local copy in
several ways. These differences and appropriate steps for working around them are listed here.

† The Mathematica fonts will not be available for use by other applications. It is therefore
required that you manually install the fonts on your system. The fonts are found in
SystemFiles\Fonts\Windows in the Mathematica layout. To install these fonts so they can be
used by all other Windows applications, open the Fonts control panel, choose Install New
Font under the File menu, and specify the location of the fonts in the Add Fonts dialog
box that appears.

† The MathLink libraries will not be available for use by other applications. Therefore, you
need to copy the MathLink libraries to the appropriate locations on your system. For 32-bit
Windows systems, the MathLink libraries consist of seven files: ml32i1.dll, ml32i2.dll,
ml32i3.dll, mlmap32.mlp, mlshm32.mlp, mltcp32.mlp, and mltcpip32.mlp, which are
located in SystemFiles\Links\MathLink\DeveloperKit\Windows\SystemAdditions in the
Mathematica layout. Copy these files to the WINNT\System32 folder on Windows 2000, or
the Windows\System32 folder on Windows XP/Vista. For 64-bit Windows platforms, the
MathLink libraries consist of twelve files: ml32i1.dll, ml32i2.dll, ml32i3.dll, mlmap32.mlp,
mlshm32.mlp, mltcp32.mlp, and mltcpip32.mlp, which are located in
112 System Administration for Single-Machine Licenses

SystemFiles\Links\MathLink\DeveloperKit\Windows\SystemAdditions, and ml64i2.dll,


ml64i3.dll, mlshm64.mlp, mltcp64.mlp, mltcpip64.mlp, which are located in
SystemFiles\Links\MathLink\DeveloperKit\Windows-x86-64\SystemAdditions. Copy the first
seven files to the Windows\Syswow64 folder and the other five files to the Windows\
System32 folder.

† The proper file associations will not be set up for Mathematica. You can set these associa-
tions manually by using the Folder Options dialog box under the Tools menu of the
Explorer window. You will need to specify the MIME type as application/mathematica and
the file extension as .nb.

† A Start menu entry for Mathematica will not be created automatically. You can add this
manually by editing the Start menu settings in the dialog box that appears when you
choose Settings  Taskbar and Start Menu under the Start menu.

Mathematica Command-Line Options


Following are several useful command-line options for the Mathematica kernel. See "Launching
Mathematica on Windows: Locally" for instructions on running the kernel.

Command-Line Options

-lmverbose print diagnostic information to stderr


-mathlink specify that the kernel should be run in MathLink mode
-noprompt specify that no banner or In/Out prompts should be printed
-password str specify a password to use instead of the password or
passwords stored in the mathpass file
-pwfile file specify the name of a file that has a valid password
-run specify a command to be run on startup as an argument

Mathematica command-line options.

The option -lmverbose is usefull for debuggin problems related to the license server.

The option -mathlink can also be used as a command-line option for the Mathematica front
end. See www.wolfram.com/solutions/mathlink for additional information about MathLink.

The mode set by -noprompt is useful for running a sequence of commands from a batch file.

The string for -password should have the form "!servername" or "machinename mathid licensenumber
password ".
System Administration for Single-Machine Licenses 113

Testing the Installation on Windows


The following simple commands allow you to test the installation of Mathematica. Running
these commands does not guarantee that the installation was successful, but a failed command
can indicate that a serious problem occurred during installation.

You should run these tests from a regular user account and not from an account with administra-
tive privileges.

To run Mathematica using a network license, both the client machine and the license server
must be on the network and MathLM must be running.

If you run into problems when doing these tests, see the troubleshooting tips in "Trouble-
shooting on Windows". If you do not find the answer there, check the Technical Support web-
site at support.wolfram.com/mathematica.

To Test the Kernel:


1. To start the kernel, choose Programs  Wolfram Mathematica  Mathematica 7
Kernel from the Start menu.

In[1]:=

2. Type N[Pi, 20] and press Enter. The number in the output should match the output
shown here.

In[1]:= N[Pi, 20]

Out[1]= 3.1415926535897932385

In[2]:=

3. To exit the kernel, type Exit and press Enter.

To Test the Front End:


1. Launch Mathematica by choosing Programs  Wolfram Mathematica  Mathematica
7 from the Start menu.

A splash screen with initialization information appears briefly, after which an empty note-
book and the Welcome Screen appear.

2. Type N[Pi,20]. Then hold down the Shift key and press Enter to evaluate. This should
send the command to the kernel and return the same result as before. The In[1] and
Out[1] labels are prepended once the evaluation is completed.
114 System Administration for Single-Machine Licenses

In the notebook window, there should be a horizontal line across the notebook; this is the
horizontal insertion bar. If you do not see one, move the pointer until it becomes a horizon-
tal I-beam and click once to see the insertion bar.

3. Press the Esc key. You should see three small horizontal lines in a column (Ç). Type int
and press Esc again. You should see an integral sign (Ÿ ). As an additional font check,
typing î[CheckmarkedBox] and î[CirclePlus] should print the symbols  and ⊕,
respectively. If the symbols show up correctly, the fonts have been properly installed.

4. From the Help menu, choose Documentation Center. The Mathematica Documentation
Center should appear.

Configuration Files on Windows


Mathematica stores preference settings and initialization data in two directories,
$BaseDirectory and $UserBaseDirectory. Within each of these directories are several possi-
ble subdirectories with titles such as FrontEnd, Kernel, and Licensing.

Global settings that affect all users are stored in subdirectories of the directory
$BaseDirectory. The default value of $BaseDirectory for different versions of Windows is
shown in the following table. To redefine the location of global preference settings and initializa-
tion data, set the environment variable MATHEMATICA_BASE.

Windows 2000/XP C:\Documents and Settings\All Users\Application Data\Mathematica


Windows Vista C:\ProgramData\Mathematica

Location of the directory $BaseDirectory for different versions of Windows.

Settings that only affect a particular user are stored in subdirectories of the directory
$UserBaseDirectory. The default value of $UserBaseDirectory for different versions of Win-
dows is shown in the following table. To redefine the location of user preferences and initializa-
tion data, set the environment variable MATHEMATICA_USERBASE.

Windows 2000/XP C:\Documents and Settings\username\Application Data\Mathematica


Windows Vista C:\Users\username\AppData\Roaming\Mathematica

Location of the directory $UserBaseDirectory for different versions of Windows.

Settings in the directory $UserBaseDirectory override global settings defined in the directory
$BaseDirectory.
System Administration for Single-Machine Licenses 115

In the pathnames that follow, replace the variables $BaseDirectory and $UserBaseDirectory
with the appropriate directories for your system. To find their locations on your system, evalu-
ate the command $BaseDirectory (or $UserBaseDirectory) in a Mathematica notebook.

Kernel
The initialization files used by the kernel contain Mathematica commands that are evaluated at
startup, such as function definitions, packages to load, and kernel option settings. These com-
mands are also available to the Mathematica front end.

$BaseDirectory\Kernel\init.m

This file is used to initialize the kernel and therefore should store any kernel commands
that are appropriate for all users running the kernel.

$UserBaseDirectory\Kernel\init.m

This file stores user-specific commands used to initialize the kernel.

Kernel initialization files are not created automatically.

Front End
Front end initialization files store preference settings such as the values of global options in the
Option Inspector. These files are automatically updated by Mathematica when you change a
setting in the front end. To make changes to this file, make your changes from within Mathemat-
ica rather than editing the file directly.

$BaseDirectory\FrontEnd\init.m

This file stores systemwide defaults used by all Mathematica front ends. The settings in
this file affect all users. "Systemwide Defaults on Windows" explains how to implement
changes to this global file.

$UserBaseDirectory\FrontEnd\init.m

This file defines settings within the front end that are specific to each user.

Front end initialization files are created automatically.

Front End Caches


The front end stores certain information about system settings in caches specific to each user.
The default location for front end caches is shown here.
116 System Administration for Single-Machine Licenses

Windows 2000/XP C:\Documents and Settings\username\Local Settings\


Application Data\Mathematica\FrontEnd\7.0 Caches
Windows Vista C:\Users\username\AppData\Local\Mathematica\FrontEnd\7.0 Caches

Location of the front end caches for different versions of Windows.

Passwords
Passwords are stored in the mathpass file, described in further detail in "Registration and Pass-
words". In the following pathname, replace the variable $InstallationDirectory with the
directory where you installed Mathematica. The default value of $InstallationDirectory on
Windows is C:\Program Files\Wolfram Research\Mathematica\7.0. To find the value of
$InstallationDirectory on your system, evaluate the command $InstallationDirectory
in a Mathematica notebook.

$BaseDirectory\Licensing\mathpass

This is the default location for the global password file.

$InstallationDirectory\Configuration\Licensing\mathpass

This is an alternative location for the global password file.

$UserBaseDirectory\Licensing\mathpass

While this is not normally the location for the password file, a user-specific mathpass file
can be stored here.

Systemwide Defaults on Windows


If you have installed Mathematica in a location where multiple users can run it (for example, on
a file server or multi-user machine), then you can set up systemwide defaults for the Mathemat-
ica front end and kernel. This is ideal for setting up Mathematica for use in computer labs and
classrooms. If you share the directory $BaseDirectory across the network, these defaults will
also take effect on local installations that use the shared $BaseDirectory.

In the pathnames that follow, replace the variables $BaseDirectory and


$UserBaseDirectory with the appropriate directories for your system. To find their locations
on your system, evaluate the command $BaseDirectory (or $UserBaseDirectory) in a
Mathematica notebook.
System Administration for Single-Machine Licenses 117

To Set Up a Configuration File for the Front End:


1. Launch Mathematica, and set up any changes to the front end that you need. For exam-
ple, you may want to modify default file locations, language options, or menu settings.

2. Quit Mathematica.

3. Copy the file $UserBaseDirectory\FrontEnd\init.m to the directory $BaseDirectory\


FrontEnd.

These settings will now be used by the front end unless overridden by the local init.m file stored
in the user’s $UserBaseDirectory\FrontEnd directory.

To Set Up a Configuration File for the Kernel:


1. Launch Mathematica, and create a new file.

2. Add any Mathematica commands that should be evaluated on startup. For example, you
may want to add a function definition or display a message at startup. Enter all the com-
mands in the same cell, separating commands with semicolons.

3. Make this cell an initialization cell by selecting the cell bracket and then choosing Cell 
Cell Properties  Initialization Cell.

4. When you have finished making your changes, choose File  Save and select Mathemat-
ica Package from the Save as type popup menu. Then save the file as
$BaseDirectory\Kernel\init.m.

These commands will be evaluated when users launch Mathematica. If you added a function
definition, that function will be available to all users.

If you have created systemwide defaults you want to carry over to new local installations, you
can add lines to an installation script to copy preconfigured init.m files as part of a new installa-
tion. For information about installation scripts, see "Installing Mathematica on Windows". To
copy systemwide defaults, add a line to the script similar to the line that copies the mathpass
file.

Troubleshooting on Windows
Passwords
If the front end password dialog box appears when you launch Mathematica, either Mathemat-
ica could not locate the mathpass file or there was no valid password in the mathpass file.
118 System Administration for Single-Machine Licenses

To resolve this problem, first check that there is a mathpass file in one of these
directories: $BaseDirectory\Licensing, $InstallationDirectory\Configuration\Licensing, or
$UserBaseDirectory\Licensing. To find the exact location of these directories on your
machine, evaluate the command $BaseDirectory (or $InstallationDirectory or
$UserBaseDirectory) in a notebook. If you did not find a mathpass file in these locations,
follow the instructions in "Entering a Single-Machine Password" to reenter your password.

If there is a mathpass file in one of those directories, the password or passwords are invalid.
Make sure that your MathID number matches the MathID number used to issue your password.
If your MathID number changes, you will need to contact Customer Service to get a new pass-
word. Contact information is provided in "Registration and Passwords".

Front End Preferences


Front end preferences, such as the locations of recently opened and saved files, are stored in a
front end initialization file called init.m. This file is located in $UserBaseDirectory\FrontEnd.
The default value of $UserBaseDirectory for different versions of Windows is listed in
"Configuration Files on Windows". To find the exact location of this directory on your machine,
evaluate the command $UserBaseDirectory in a notebook.

If you need to reset the front end preferences to their default values, hold down Shift+Ctrl
during startup. This will cause the initialization file to be rebuilt automatically.

Caches
Information about your Mathematica system layout, such as the locations of text resource files,
is stored in caches. These caches are located in C:\Documents and Settings\username\Local
Settings\Application Data\Mathematica\FrontEnd\7.0 Caches\ on Windows 2000/XP and in
C:\Users\username\AppData\Local\Mathematica\FrontEnd\7.0 Caches\ on Vista.

A corrupted cache may cause the front end to produce an error or quit immediately on startup.
The most convenient way to restore the caches to their default values is to hold down
Shift+Ctrl during startup. This will cause the Mathematica caches and the initialization file to be
rebuilt automatically. If you want to rebuild your caches but retain your preferences, hold down
Shift during startup. This will delete and rebuild the cache without rebuilding your front end
initialization file.
System Administration for Single-Machine Licenses 119

Technical Support
For further assistance, check the Technical Support FAQs on the web at support.wolfram.com.
If you are a Site License Administrator, additional Site License Documentation is available at
site.wolfram.com. If you do not find the information you need, please contact Technical Support
by sending email to support@wolfram.com or by calling +1-217-398-6500. Include your license
number in all correspondence. Your license number is located on your electronic or physical
copy of the license certificate. It is also available after installation by going to the Help menu
and clicking About Mathematica. You must be a registered user in order to receive installation
support. You must have a current Premier Service subscription to receive Technical Support.

Unix and Linux


Installing Mathematica on Unix and Linux
Installing Mathematica for Network Licenses
Requirements

Mathematica is available for Windows, Unix, Linux, and Mac OS X. For a complete list of plat-
form availability, visit www.wolfram.com/products/mathematica/platforms.html. Any supported
machine can act as a client for running Mathematica, provided the following two conditions are
met:

† The client has access to the Mathematica files, either locally or from a file server on the
network.

† The license server running MathLM is available on the TCP/IP network.

A license server can also function as its own client. However, this is not recommended. If the
machine has to be rebooted for any reason, the serving of licenses to all other clients on the
network may be disrupted.

Before you install Mathematica as a license server client, MathLM should already be installed
and running on a license server on the network (see "Installing MathLM on Windows", and
"Installing MathLM on Unix, Linux, and Mac OS X" for details). To complete the Mathematica
installation, you will need to know the name or IP address of the license server running MathLM.

To install Mathematica on Unix and Linux, you may need root privileges.
120 System Administration for Single-Machine Licenses

To Install Mathematica:

1. Mount the CD or DVD. For information on mounting a CD/DVD, see "Mounting a CD or


DVD on Unix and Linux".

Note: This step may not be required on some Linux and Unix platforms, as some operat-
ing systems automatically handle mounting.

2. Change directory to /cdrom/Unix/Installer. Note that the exact location of the CD/DVD
mount point might be different for your platform.

cd /cdrom/Unix/Installer

3. Run the installer.

./MathInstaller

--------------------------------------------------------------
Wolfram Mathematica 7 Installer
--------------------------------------------------------------

Copyright (c) 1988-2008 Wolfram Research, Inc. All rights reserved.

WARNING: Wolfram Mathematica is protected by copyright law and


international treaties. Unauthorized reproduction or distribution may
result in severe civil and criminal penalties and will be prosecuted to
the maximum extent possible under law.

4. (Unix only) You are asked to select the platforms for which you are doing the installation.
Select one or more of the available options and press Enter to continue.

For which of the following platforms would you like to install


Mathematica?

Type your selection (multiple choices can be separated with spaces), or


press
ENTER to select (1):

5. The installer prompts you to specify the directory in which Mathematica should be in-
stalled. The default location is /usr/local/Wolfram/Mathematica/7.0. Press Enter to
accept the default, or type in a new location and then press Enter.

Enter the installation directory, or press ENTER to select


/usr/local/Wolfram/Mathematica/7.0:

Note: If you specify a directory that does not exist, the installer will give you the option
of creating the directory. If a copy of Mathematica already exists in the directory you
specify, the installer will inform you before overwriting the files.
System Administration for Single-Machine Licenses 121

Note: If you are installing over a previous version of Mathematica, your existing math-
pass file and custom settings will not be deleted.

6. Once you have answered all the questions, the installer begins copying files from the
CD/DVD to the directory you specified. The progress is indicated by a progress bar on the
screen.

Now installing...

[*************** ]

7. You are asked for the location in which to copy the executable scripts. You should choose
a directory that is present on each user’s PATH. The scripts are also installed in the ExeÖ
cutables subdirectory of the Mathematica installation directory. Type a location or accept
the default and press Enter.

Type the directory path in which the Mathematica scripts will be created,
or press ENTER to select /usr/local/bin:

Note: The installer checks to see if any other Mathematica scripts exist in the specified
directory. If they do, you are given the chance to rename the scripts.

8. You are given several options for configuring the password. Type 2 and press Enter to run
Mathematica using a network license.

Please choose how you want to configure the password for Mathematica 7.0.

(1) Single machine


Install a password specific to this machine. Mathematica will launch
and you can enter your password.

(2) Network license


Obtain a license from a MathLM license server on your network each time
Mathematica is launched.

(3) Enter license information later


Input your password and register when you start Mathematica.

Type your selection, or press ENTER to select (1):2

9. Type the hostname of the server running MathLM, as given by the hostname command.
In some cases, this includes the domain name. Or, enter the IP address of the MathLM
server. Press Enter to continue.

Enter the hostname of the machine on which your MathLM license manager
is running:
122 System Administration for Single-Machine Licenses

Note: The installer does not attempt to verify the server name you type. If you prefer,
you may type any arbitrary text here and press Enter. This creates the mathpass file with
an invalid password entry. You may then edit the mathpass file manually to add a correct
password later. More information on the mathpass file is given in "Registration and
Passwords".

10. The installer creates the mathpass file and displays its location. The installation is now
complete.

Configuring Network Password...

Adding password file entry to /usr/share/Mathematica/Licensing/mathpass...

Installation complete.

The installer also adds an additional menu folder named Wolfram to the desktop menu. Inside
the folder is an item named Mathematica that points to the most recently installed version of
Mathematica. File associations are also modified such that .nb files are now associated with the
most recently installed version of Mathematica.

Installing Mathematica for Single-Machine Licenses


Follow these instructions to install a standalone copy of Mathematica that does not get a license
from the license server. Depending on your license type, this may require contacting Wolfram
Research to purchase additional licenses.

To run Mathematica, you must register with Wolfram Research and receive a password. See
"Registration and Passwords" for further information.

To install Mathematica on Unix and Linux, you may need root privileges.

To Install a Single-Machine Copy of Mathematica on Unix and Linux:

1. Mount the CD or DVD. For information on mounting a CD/DVD, see "Mounting a CD or


DVD on Unix and Linux".

Note: This step may not be required on some Linux and Unix platforms, as some operat-
ing systems automatically handle mounting.

2. Change directory to /cdrom/Unix/Installer. Note that the exact location of the CD/DVD
mount point might be different for your platform.

cd /cdrom/Unix/Installer
System Administration for Single-Machine Licenses 123

3. Run the installer.

./MathInstaller

--------------------------------------------------------------
Wolfram Mathematica 7 Installer
--------------------------------------------------------------

Copyright (c) 1988-2008 Wolfram Research, Inc. All rights reserved.

WARNING: Wolfram Mathematica is protected by copyright law and


international treaties. Unauthorized reproduction or distribution may
result in severe civil and criminal penalties and will be prosecuted to
the maximum extent possible under law.

4. (Unix only) You are asked to select the platform for which you are doing the installation.
Select one of the available options and press Enter to continue.

For which of the following platforms would you like to install


Mathematica?

Type your selection (multiple choices can be separated with spaces), or


press
ENTER to select (1):

5. The installer prompts you to specify the directory in which Mathematica should be in-
stalled. The default location is /usr/local/Wolfram/Mathematica/7.0. Press Enter to
accept the default, or type in a new location and then press Enter.

Enter the installation directory, or press ENTER to select


/usr/local/Wolfram/Mathematica/7.0:

Note: If you specify a directory that does not exist, the installer will give you the option
of creating the directory. If a copy of Mathematica already exists in the directory you
specify, the installer will inform you before overwriting the files.

Note: If you are installing over a previous version of Mathematica, your existing math-
pass file and custom settings will not be deleted.

6. Once you have answered all the questions, the installer begins copying files from the
CD/DVD to the directory you specified. The progress is indicated by a progress bar on the
screen.

Now installing...
[*************** ]
124 System Administration for Single-Machine Licenses

7. You are asked for the location in which to copy the executable scripts. You should choose
a directory that is present on each user’s PATH. The scripts are also installed in the ExeÖ
cutables subdirectory of the Mathematica installation directory. Type a location or accept
the default and press Enter.

Type the directory path in which the Mathematica scripts will be created,
or press ENTER to select /usr/local/bin:

Note: The installer checks to see if any other Mathematica scripts exist in the specified
directory. If they do, you are given the chance to rename the scripts.

8. You are given several options for configuring the password. Type 1 and press Enter to run
Mathematica using a single-machine license.

Please choose how you want to configure the password for Mathematica 7.0.

(1) Single machine


Install a password specific to this machine. Mathematica will launch
and you can enter your password.

(2) Network license


Obtain a license from a MathLM License Server on your network each
time Mathematica is launched.

(3) Enter license information later


Input your password and register when you start Mathematica.

Type your selection, or press ENTER to select (1):1

9. Your machine name and MathID number are displayed. To obtain your password, contact
Wolfram Research (see "Registration and Passwords" for details). You will need to supply
your MathID number and the license number located on your electronic or physical copy
of the license certificate.

Configuring Single-Machine Password...

Mathematica 7.0 for operating system


Copyright 1988-2008 Wolfram Research, Inc.

You will need to get a password from your


license certificate or from Wolfram Research
(register.wolfram.com).
Machine name: hostname
MathID: xxxx-xxxxx-xxxxx
System Administration for Single-Machine Licenses 125

You will need a valid license ID and password in order


to proceed. Go to http://register.wolfram.com or
http://reference.wolfram.com/singlemachine for more
information.

10. Enter your name, the name of your organization, your license number (located on your
electronic or physical copy of the license certificate), and your password, and press Enter
when you are done.

Enter your name:

Enter the name of your organization:

Enter your license ID [format Lxxxx-xxxx]:

Enter your password:

11. The installer creates the mathpass file and displays its location. The installation is now
complete.

Creating password file entry in


/usr/share/Mathematica/Licensing/mathpass.

See http://reference.wolfram.com/password if
Mathematica is installed on multiple machines
and you need to set up a single, sitewide
password file.

The installer also adds an additional menu folder named Wolfram to the desktop menu. Inside
the folder is an item named Mathematica that points to the most recently installed version of
Mathematica. File associations are also modified such that .nb files are now associated with the
most recently installed version of Mathematica.

Installing Mathematica from a File Server


One convenient way to install Mathematica on a client is to run the installer remotely from a file
server. This is an efficient way of making Mathematica available to a large number of users
without having to supply a CD/DVD to each one. You can install Mathematica from a file server
on a client running any supported Unix or Linux platform. It is not necessary that the client
platform be the same as the file server platform.
126 System Administration for Single-Machine Licenses

To install Mathematica from a file server, you first must make the installer and Mathematica
files available to the clients. You can do this by copying the contents of the CD/DVD to the file
server and exporting the directory, or by exporting the CD/DVD mount point on the file server.
Then, mount the directory with the Mathematica distribution on the client and change to this
directory, and run MathInstaller to install Mathematica on the client machines. (Note that
you must run MathInstaller from the directory in which it is located.) If you are installing
Mathematica in a mixed-platform environment, you may need to use the MathInstaller
option -platform to ensure that the correct files for your platform are installed.

Installing Mathematica from a Script


If you are installing Mathematica on multiple machines, it can be time-consuming to respond to
all of the installer prompts on each individual machine. By supplying command-line options to
the MathInstaller command, you can customize various features of the installation process
or automate it entirely.

-auto force the installation to proceed automatically without


prompting the user for any information
-createdir=value specify whether or not to create the directories specified by
the options -targetdir and -execdir
-execdir=dir specify the path to be used for the symbolic links to the
executable scripts
-help display information about the installer options
-method=type define the type of installation you would like to perform
-overwrite=value specify whether the installer should overwrite any files that
already exist in the target directory
-platforms=value specify the system ID of the Unix platform or platforms
(e.g., Linux, Solaris, and so forth) for which you want to
do the installation
-selinux=value specify whether the installer should attempt to modify the
security context of any included libraries so that it will
function properly
-silent force an automatic installation (equivalent to the -auto
option)
-targetdir=dir specify the installation directory
-verbose display detailed information about the files and directories
being installed

MathInstaller command-line options.


System Administration for Single-Machine Licenses 127

Note: Default values are used for any options that are not specified explicitly on the
command line.

Valid input for -createdir is y for yes or n for no. By default, this value is set to y.

The default directory for -execdir is /usr/local/bin. This option only works with an auto-
matic installation.

The values for -method may vary by product. When this option is applicable, the values can be
determined by running the installer. The default value for this option is Full.

Valid input for -overwrite is y for yes or n for no. By default, this value is set to y. This option
only works with an automatic installation.

The default for -platforms is the system you are installing on, if that information is available
to the installer. This option only works with an automatic installation.

Valid input for -selinux is y for yes or n for no. By default, this value is set to n.

The option -silent suppresses any output from being displayed on the screen. The output is
instead written to a file named InstallerLog-number. If the installation is unsuccessful, the log
file is saved in the /tmp directory. Otherwise, the file is moved to the target directory and
renamed InstallerLog.

The directory specified for -targetdir corresponds to the value of the global variable
$InstallationDirectory. The default value is /usr/local/Wolfram/Mathematica/7.0.
This option only works with an automatic installation.

To complete the installation in one step, run a command like the following.

./MathInstaller -auto -targetdir=/home/mathematica

This allows you to complete the installation automatically in one step, while still being able to
customize various details such as the directory to install to. You are not prompted to enter your
password using this method, so you will need to enter a password the first time Mathematica is
launched.

If you are doing many installations, you might find it convenient to include the MathInstaller
command with all the relevant options in a shell script. Running the shell script is then an easy
way to do an identical customized installation on multiple machines. You can further simplify
the installation process by including a line in your script that copies an existing mathpass file to
128 System Administration for Single-Machine Licenses

the appropriate location on the newly installed machine. Note that MathInstaller must be run
from the directory in which it is located, so your script may require a command to change
directory. See "Registrations and Passwords" for information on sitewide mathpass
configurations.

Launching Mathematica on Unix and Linux


Launching Mathematica Locally
To run Mathematica using a network license, both the client machine and the license server
must be on the network and MathLM must be running.

To Launch Mathematica:

Make sure that you are running MathLM. Then, from a shell, type mathematica and press Enter.

Alternatively, if you are running X, an additional menu folder named Wolfram has already been
added to the desktop menu. In the folder, an item named Mathematica points to the most
recently installed version of Mathematica. File associations have also been modified such that
.nb files now associate with the most recently installed version of Mathematica.

To Launch Only the Mathematica Kernel:

From a shell, type math and press Enter.

Launching Mathematica from a File Server


Rather than installing Mathematica on every client machine, you can install Mathematica on a
file server and export the installation directory to the clients. To display the front end, the
clients must have access to the Mathematica fonts. For information about configuring the X
server on the client machines to find the Mathematica fonts, see "Fonts on Unix and Linux".
Once the fonts are properly configured, the client machines can run Mathematica as though it
were a local installation.

Mathematica Command-Line Options

math

The math command starts the kernel from within a shell. The kernel is the part of Mathematica
that handles calculations. This is also used by the front end.
System Administration for Single-Machine Licenses 129

Command-Line Options

-initfile file specify the name of a file containing startup commands


-lmverbose print diagnostic information to stderr
-mathlink specify that the kernel should be run in MathLink mode
-noinit specify that no initialization file should be read at startup
-password str specify a password to use instead of the password or
passwords stored in the mathpass file
-pwfile file specify the name of a file that has a valid password
-run specify a command to be run on startup as an argument

math command-line options.

The option -lmverbose is usefull for debuggin problems related to the license server.

The option -mathlink can also be used as a command-line option for the Mathematica front
end. See www.wolfram.com/solutions/mathlink for additional information about MathLink.

The string for -password should have the form "!servername" or "machinename mathid licensenumber
password".

mathematica

The mathematica command runs the X front end. In order for the front end to run, the DISÖ
PLAY environment variable must be set and the front end must be able to locate the fonts
included with Mathematica.

Command-Line Options

-backgroundTaskDelay n specify the time (in milliseconds) that the front end delays
background tasks while waiting for input
-cleanStart ignore stored caches and rebuild the front end preferences
file
-copyright display copyright information on the command line
-dontUpdatePrefs prevent changes to the user's preference settings
-font f specify the font used in menus, buttons, etc.
-help display a list of all command-line options
-lmverbose print diagnostic information to stderr when connecting to
MathLM
130 System Administration for Single-Machine Licenses

-mathlink make the front end run as a child process that is capable of
accepting MathLink packets
-nogui prevent the display of any kind of window or dialogs
-noSplashScreen prevent the splash screen from being displayed on startup
-noTrueTypeFont prevent the use of TrueType font in the display
-preferencesDirectory dir specify the location where preference settings are stored
-primaryModifierMask mask specify the primary mask to be used as the command key
-pwfile file specify a file in which to look for Mathematica passwords
-pwpath p specify the search path for a password file
-secondaryModifierMask mask specify the secondary mask to be used as the command
key
-singleLaunch allow only one copy of the front end per display
-stderrWindow send stderr to a popup window instead of a terminal
-style s specify the widget style used by the front end
-topDirectory dir specify the location of the Mathematica installation direc -
tory
-version print the current version of the front end on the command
line

mathematica command-line options.

The default for -backgroundTaskDelay is 100 milliseconds.

The option -cleanStart will ignore the caches stored in the directory
$UserBaseDirectory /FrontEnd/7.0_Caches, and will rebuild the front end preferences
file, $UserBaseDirectory /FrontEnd/init.m. This option can also be abbreviated as
-clean.

When using -font, a list of possible font names can be found by using xfontsel. The name
can be expressed either as an X Logical Font Description or as a valid font alias.

The option -lmverbose is useful for debugging problems related to the license server.

The option -mathlink may be useful when the front end is used as a typesetting or graphics
rendering service. See www.wolfram.com/solutions/mathlink for additional information about
MathLink.

The default directory for -preferencesDirectory is ~/.Mathematica.

The option -singleLaunch will prohibit multiple front end launches only if the current front end
was launched with the -singleLaunch option.
System Administration for Single-Machine Licenses 131

Valid styles for -style are motif, motifplus, windows, cde, platinum, sgi, and compact.

The defaut location for -topDirectory is /usr/local/Wolfram/Mathematica/7.0.

Testing the Installation on Unix and Linux


The following simple commands allow you to test the installation of Mathematica. Running
these commands does not guarantee that the installation was successful, but a failed command
can indicate that a serious problem occurred during installation.

You should run these tests from a regular user account and not from an account with administra-
tor privileges.

To run Mathematica using a network license, both the client machine and the license server
must be on the network and MathLM must be running.

If you run into problems when doing these tests, see the troubleshooting tips in
"Troubleshooting on Unix and Linux". If you do not find the answer there, check the Technical
Support website at support.wolfram.com/mathematica.

To Test the Kernel:


1. To start the kernel, type math in a shell and press Enter.

In[1]:=

2. Type N[Pi, 20] and press Enter. The number in the output should match the output
shown here.

In[1]:= N[Pi, 20]

Out[1]= 3.1415926535897932385

In[2]:=

3. To exit the kernel, type Exit and press Enter.

On Unix and Linux, you can test the kernel on a remote machine by using the command ssh
hostname /usr/local/bin/math. (The exact pathname could be different depending on how
Mathematica was installed.) This command will launch the kernel on the remote machine host-
name. When you see the In[1] label, follow step 2 and step 3 in the previous instructions.

To Test the Front End:


1. Make sure that you are running X. Launch Mathematica by typing mathematica in a shell
and pressing Enter.
132 System Administration for Single-Machine Licenses

Alternatively, you can select Mathematica from the menu folder Wolfram.

A splash screen with initialization information appears briefly, after which an empty note-
book and the Welcome Screen appear.

2. Type N[Pi,20]. Then hold down the Shift key and press Enter to evaluate. This should
send the command to the kernel and return the same result as before. The In[1] and
Out[1] labels are prepended once the evaluation is completed.

In the notebook window, there should be a horizontal line across the notebook; this is the
horizontal insertion bar. If you do not see one, move the pointer until it becomes a horizon-
tal I-beam and click once to see the insertion bar.

3. Press the Esc key. You should see three small horizontal lines in a column (Ç). Type int
and press Esc again. You should see an integral sign (Ÿ ). As an additional font check,
typing î[CheckmarkedBox] and î[CirclePlus] should print the symbols  and ⊕,
respectively. If the symbols show up correctly, the fonts have been properly installed.

4. From the Help menu, choose Documentation Center. The Mathematica Documentation
Center should appear.

On Unix and Linux, you can test the X front end remotely, provided the ssh server on the
remote machine allows X forwarding. You must be running X on the local machine to do this. In
a shell, type ssh -X hostname /usr/local/bin/mathematica. (The exact pathname could be
different depending on how Mathematica was installed.) This command will launch Mathematica
on the remote machine hostname. When the splash screen appears on your screen, follow step 2
and step 3 in the previous instructions.

Configuration Files on Unix and Linux


Mathematica stores preference settings and initialization data in two directories,
$BaseDirectory and $UserBaseDirectory. Within each of these directories are several possi-
ble subdirectories with titles such as FrontEnd, Kernel, and Licensing.

† Global settings that affect all users are stored in subdirectories of the directory
$BaseDirectory. The default value of $BaseDirectory on Unix and Linux is
/usr/share/Mathematica. To redefine the location of global preference settings and
initialization data, set the environment variable MATHEMATICA_BASE.

† Settings that only affect a particular user are stored in subdirectories of the directory
$UserBaseDirectory, which is typically a subdirectory of the user’s home directory. The
default value of $UserBaseDirectory on Unix and Linux is ~/.Mathematica. To redefine
the location of user preferences and initialization data, set the environment variable
MATHEMATICA_USERBASE.
System Administration for Single-Machine Licenses 133

Settings in the directory $UserBaseDirectory override global settings defined in the directory
$BaseDirectory.

In the pathnames that follow, replace the variables $BaseDirectory and $UserBaseDirectory
with the appropriate directories for your system. To find their locations on your system, evalu-
ate the command $BaseDirectory (or $UserBaseDirectory) in a Mathematica notebook.

Kernel
The initialization files used by the kernel contain Mathematica commands that are evaluated at
startup, such as function definitions, packages to load, or kernel option settings. These com-
mands are also available to the Mathematica front end.

$BaseDirectory /Kernel/init.m

This file is used to initialize the kernel and therefore should store any kernel commands
that are appropriate for all users running the kernel.

$UserBaseDirectory /Kernel/init.m

This file stores user-specific commands used to initialize the kernel.

Kernel initialization files are not created automatically.

Front End
Front end initialization files store preference settings such as the values of global options in the
Option Inspector. These files are automatically updated by Mathematica when you change a
setting in the front end. To make changes to this file, make your changes from within Mathemat-
ica rather than editing the file directly.

$BaseDirectory /FrontEnd/init.m

This file stores systemwide defaults used by all Mathematica front ends. The settings in
this file affect all users. "Systemwide Defaults on Unix and Linux" explains how to imple-
ment changes to this global file.

$UserBaseDirectory /FrontEnd/init.m

This file defines settings within the front end that are specific to each user.

$UserBaseDirectory /FrontEnd/7.0_Caches/

This directory within the user’s home directory stores information on system settings that
are read by the front end.

Front end initialization files are created automatically.


134 System Administration for Single-Machine Licenses

Passwords
Passwords are stored in the mathpass file, described in further detail in "Registration and
Passwords". In the following pathname, replace the variable $InstallationDirectory with the
directory where you installed Mathematica. The default value of $InstallationDirectory on
Unix and Linux is /usr/local/Wolfram/Mathematica/7.0. To find the value of
$InstallationDirectory on your system, evaluate the command $InstallationDirectory
in a Mathematica notebook.

$BaseDirectory /Licensing/mathpass

This is the default location for the global password file.

$InstallationDirectory /Configuration/Licensing/mathpass

This is an alternative location for the global password file.

$UserBaseDirectory /Licensing/mathpass

While this is not normally the location for the password file, a user-specific mathpass file
can be stored here.

Systemwide Defaults on Unix and Linux


If you have installed Mathematica in a location where multiple users run it (for example, on a
file server or multi-user machine), then you can set up systemwide defaults for the Mathemat-
ica front end and kernel. This is ideal for setting up Mathematica for use in computer labs and
classrooms. If you share the directory $BaseDirectory across the network, these defaults will
also take effect on local installations that use the shared $BaseDirectory.

The following instructions assume that $BaseDirectory and $UserBaseDirectory have their
default values, /usr/share/Mathematica and ~/.Mathematica respectively.

To Set Up a Configuration File for the Front End:


1. Launch Mathematica, and set up any changes to the front end that you need. For exam-
ple, you may want to modify default file locations, language options, or menu settings.

2. Quit Mathematica.

3. Copy the file ~/.Mathematica/FrontEnd/init.m to the directory /usr/share/


Mathematica/FrontEnd.
System Administration for Single-Machine Licenses 135

These settings will now be used by the front end unless overridden by the local init.m file stored
in the user’s directory ~/.Mathematica/FrontEnd.

To Set Up a Configuration File for the Kernel:


1. Launch Mathematica, and create a new file.

2. Add any Mathematica commands that should be evaluated on startup. For example, you
may want to add a function definition or display a message at startup. Enter all the com-
mands in the same cell, separating commands with semicolons.

3. Make this cell an initialization cell by selecting the cell bracket and then choosing Cell 
Cell Properties  Initialization Cell.

4. When you have finished making your changes, choose File  Save and select
Mathematica Package from the Save as type popup menu. Then save the file as
/usr/share/Mathematica/Kernel/init.m.

These commands will be evaluated when users launch Mathematica. If you added a function
definition, that function will be available to all users.

Fonts on Unix and Linux


Dealing with fonts under Unix and Linux can sometimes be tricky. The important issues in
dealing with fonts in Mathematica are presented here for your convenience.

Font Formats
The Mathematica front end supports BDF, TrueType, and Type1 fonts. These fonts are automati-
cally installed by MathInstaller during installation.

Font Installation
All machines that display the front end must have access to the fonts included with Mathemat-
ica. If the Mathematica process is running on a remote machine and the front end is displayed
on the local machine, the X server on the local machine must know where to find the Mathemat-
ica fonts. To do this, add the Mathematica fonts to the local font path by running a command
like the following on the local machine.
136 System Administration for Single-Machine Licenses

xset fp+ /usr/local/Wolfram/Mathematica/7.0/SystemFiles/Fonts/Type1; xset fp


rehash

Be sure to execute xset fp rehash to make the fonts available to the local X server.

For optimal onscreen performance, Type1 fonts should appear before BDF fonts in the font
path. Hence, $InstallationDirectory/SystemFiles/Fonts/Type1 should appear before
$InstallationDirectory/SystemFiles/Fonts/BDF. You can check the order of the font
path by executing the command xset q.

Note: TrueType fonts are automatically loaded and do not require an xset command.

Font Servers
You may prefer not to install local copies of the Mathematica fonts on all machines. You can
instead set up a font server with all the necessary Mathematica fonts. The other machines on
the network can then find the fonts as needed by reading them from the Mathematica directory
on the font server. Consult your operating system’s documentation for further information.

Common Font Errors


On some systems, the font path is limited in length, and it is possible to receive xset: bad
font path element errors even if the fonts are available to the server. In this case, try
reordering the font path and adding the directories for the Mathematica fonts earlier in the
path. The directory $InstallationDirectory/SystemFiles/Fonts/Type1 must be listed
before $InstallationDirectory/SystemFiles/Fonts/BDF on the font path for optimal
onscreen performance.

Fonts and Printing


When the X front end prints a notebook, it uses AFM files for the font metrics needed for print-
ing. If you want to print using a particular font not included with Mathematica, you will need the
AFM files for the font. These files are installed in either $InstallationDirectory/
Configuration/Fonts/AFM, /usr/lib/AFM, or /usr/lib/afm. Fonts are normally down-
loaded to the printer by the front end when printing. You may be able to download the fonts
and store them on the printer. See the documentation and programs that came with your
printer for more information.
System Administration for Single-Machine Licenses 137

GhostScript
If you want to view Mathematica graphics using GhostScript, you need to make GhostScript
aware of the Mathematica fonts. For more information, contact Technical Support by sending
email to support@wolfram.com, or visit support.wolfram.com/mathematica/graphics/export/
ghostscript.html.

Troubleshooting on Unix and Linux


If you have problems using Mathematica on Unix or Linux, check this list for solutions.

CD or DVD
† Make sure the CD or DVD is properly mounted with the correct mount command (see
"Mounting a CD or DVD on Unix and Linux"). If the filenames on the CD/DVD appear in the
wrong case, it means the CD/DVD is mounted incorrectly.

Installation
Make sure to run the installer from the directory in which it is located.

Passwords
If the front end password dialog box appears when you launch Mathematica, either Mathemat-
ica could not locate the mathpass file or there was no valid password in the mathpass file. To
resolve this problem, first check that there is a mathpass file in one of these directories:
/usr/share/Mathematica/Licensing, $InstallationDirectory/Configuration/Licensing,
or ~/.Mathematica/Licensing. If you did not find a mathpass file in these locations, follow
the instructions in "Entering a Single-Machine Password" to reenter your password.

If there is a mathpass file in one of those directories, the password or passwords are invalid.
Make sure that your MathID number matches the MathID number used to issue your password.
If your MathID number changes, you will need to contact Customer Service to get a new pass-
word. Contact information is provided in "Registration and Passwords".

Paths
By default, the front end runs the command math to start the kernel. If math is not on the path,
then you must use the Kernel Configuration Options command in the Kernel menu to spec-
ify the full pathname of the math command.
138 System Administration for Single-Machine Licenses

Front End Preferences


Front end preferences, such as the names of recently opened and saved files, are stored in
~/.Mathematica/FrontEnd. The most convenient way to reset the front end preferences to
their default values is to restart Mathematica using the command mathematica -cleanStart.
This will cause the initialization file to be rebuilt automatically.

Caches
Information about your Mathematica layout, such as the locations of text resource files, is
stored in caches. These caches are located in the directory ~/.Mathematica/
FrontEnd/7.0_Caches. A corrupted cache may cause the front end to produce an error or quit
immediately on startup. The most convenient way to reset the caches to their default values is
to use the option -cleanStart at startup. This will cause the Mathematica caches and the
initialization file to be rebuilt automatically. If you want to rebuild your caches but retain your
preferences, hold down Shift during startup. This will delete and rebuild the cache without
rebuilding the front end initialization file.

Fonts
† Make sure that the fonts are installed on the machine that displays the front end or on a
font server.

† If you see the error xset: bad font path element, either the fonts are not properly
installed on your machine, or your font path is too long and exceeds the allowable limit.
Make sure the fonts are properly installed, or copy the fonts to a directory that is already on
the font path.

Technical Support
For further assistance, check the Technical Support FAQs on the web at support.wolfram.com.
If you are a Site License Administrator, additional Site License Documentation is available at
site.wolfram.com. If you do not find the information you need, please contact Technical Support
by sending email to support@wolfram.com or by calling +1-217-398-6500. Include your license
number in all correspondence. Your license number is located on your electronic or printed
license certificate. It is also available after installation by going to the Help menu and clicking
About Mathematica. You must be a registered user in order to receive installation support.
You must have a current Premier Service subscription to receive Technical Support.
System Administration for Single-Machine Licenses 139

Mac OS X
Installing Mathematica on Mac OS X
Installing Mathematica for Network Licenses
Requirements

Mathematica is available for Windows, Unix, Linux, and Mac OS X. For a complete list of plat-
form availability, visit www.wolfram.com/products/mathematica/platforms.html. Any supported
machine can act as a client for running Mathematica, provided the following two conditions are
met:

† The client has access to the Mathematica files, either locally or from a file server on the
network.

† The license server running MathLM is available on the TCP/IP network.

A license server can also function as its own client. However, this is not recommended. If the
machine has to be rebooted for any reason, the serving of licenses to all other clients on the
network may be disrupted.

Before you install Mathematica as a license server client, MathLM should already be installed
and running on a license server on the network (see "Installing MathLM" for details). To com-
plete the Mathematica installation, you will need to know the name or IP address of the license
server running MathLM.

To install Mathematica on Mac OS X in the Applications folder, you must log on as


administrator.

To Install Mathematica:

1. Insert the DVD. A new window appears on your screen.


140 System Administration for Single-Machine Licenses

2. Drag the Mathematica icon from this window to the location on your hard drive where you
want to install Mathematica. In order for all users to have access to Mathematica, you
should install it in the systemwide Applications folder. You must have administrative
privileges to do this.

Note: If you are installing over a previous version of Mathematica, your existing math-
pass file and custom settings will not be deleted.

3. When all files have been copied, launch Mathematica by opening the folder where you
installed Mathematica and double-clicking the Mathematica icon.

4. Mathematica starts up and the following dialog box appears. Select Network license.
Then enter the name or IP address of the MathLM license server in the text field provided.

5. Click OK. Mathematica launches and is ready for use.

After you install Mathematica you can place the Mathematica icon into the Dock for easier
access. To do this, start Mathematica, and hold down the Ctrl key while clicking the Mathemat-
ica icon in the Dock. In the popup menu that appears, choose Keep in Dock.

Installing Mathematica for Single-Machine Licenses


Follow these instructions to install a standalone copy of Mathematica that does not get a license
from the license server. Depending on your license type, this may require contacting Wolfram
Research to purchase additional licenses.

To run Mathematica, you must register with Wolfram Research and receive a password. See
"Registration and Passwords" for further information.
System Administration for Single-Machine Licenses 141

To Install a Single-Machine Copy of Mathematica on Mac OS X:

1. Insert the Mathematica DVD. A new window appears on your screen.

2. Drag the Mathematica icon from the window to the location on your hard drive where you
want to install Mathematica.

Note: If you are installing over a previous version of Mathematica, your existing math-
pass file and custom settings will not be deleted.

3. When all files have been copied, launch Mathematica by opening the folder where you
installed Mathematica and double-clicking the Mathematica icon.

4. Mathematica starts up and the following dialog box appears. Select Single machine.
Enter your name, the name of your organization, and your license number (located on
your electronic or printed certificate) in the text fields provided. Click OK when you are
done.
142 System Administration for Single-Machine Licenses

5. The following dialog box appears showing the MathID number for your machine. To obtain
your password, click the Web button, go to register.wolfram.com, or contact Wolfram
Research (see "Registration and Passwords" for further information). You will need to
supply your license number and your MathID number.

6. Enter your password and click OK. You are now ready to start using Mathematica.

Installing Mathematica from a File Server


One convenient way to install Mathematica on a client is to copy the files from a file server on
the network. This is an efficient way of making Mathematica available to a large number of
users without having to supply a DVD to each user.

Before following these instructions, Mathematica should be installed on the file server according
to the instructions in "Network License" and "Single-Machine License".

To Install Mathematica from a File Server:

1. On the client machine, select Go  Connect to Server in the Finder menu.

2. In the dialog box that appears, choose a file server from the list or enter the machine
name or IP address of the file server in the text field. Then click Connect.
System Administration for Single-Machine Licenses 143

3. Enter your name and password in the dialog box that appears. Then click Connect.

4. A dialog box appears, showing a list of volumes on the file server. Select the volume in
which Mathematica is installed. Then click OK.

5. The volume you selected is mounted on the client machine. Double-click the icon represent-
ing the volume.

6. Navigate to the location where Mathematica is installed. Then drag the Mathematica
package from the file server to the location on the client machine where you want to
install Mathematica. In order for all users to have access to Mathematica, you should
install it in the Applications folder. You must log on as administrator to do this.
144 System Administration for Single-Machine Licenses

Launching Mathematica on Mac OS X


Launching Mathematica Locally
To run Mathematica using a network license, both the client machine and the license server
must be on the network and MathLM must be running.

To Launch Mathematica:

Double-click the Mathematica icon in the directory where Mathematica is installed. Alterna-
tively, if you have placed the Mathematica icon in the dock, single-click the icon.

To Launch Only the Mathematica Kernel:


Open the Terminal application and type the full pathname of the MathKernel binary in the
window that appears. For example, if you installed Mathematica in the Applications folder,
type /Applications/Mathematica.app/Contents/MacOS/MathKernel in a Terminal win-
dow and press Return.

Launching Mathematica from a File Server


To maintain a centralized location for preferences and password files or to save disk space, you
can run Mathematica directly from a file server. To do this, the client machine does not need to
have any Mathematica files installed locally.

To Run a Copy of Mathematica Installed on a Remote File Server:

1. Connect to a file server on which Mathematica is installed.

2. Double-click the icon representing the volume with the Mathematica files. Then navigate
to the location where Mathematica is installed.

3. Double-click the Mathematica icon in the directory where Mathematica is installed.

Mathematica Command-Line Options


The commands MathKernel and Mathematica have several command-line options used to
specify certain configuration information and file locations.

MathKernel

The command MathKernel starts the kernel, which is the part of Mathematica that handles
calculations. This command is also used by the Mathematica front end.
System Administration for Single-Machine Licenses 145

-initfile file Specifies the name of a file containing commands to be run


on startup.
-lmverbose Prints diagnostic information to stderr on connecting to
the license manager. This is useful for debugging problems
related to the license server.
-mathlink Specifies that the kernel should be run in MathLink mode.
See www.wolfram.com/solutions/mathlink for additional
information about MathLink.
-noinit Specifies that no initialization file should be read at startup.
-password str Specifies a password to use instead of the password or
passwords stored in the mathpass file. The password
should have the form "!servername" or "machinename mathid
licensenumber password".
-pwfile file Specifies the name of a file that has a valid password.
-run Takes a command to be run on startup as an argument.

MathKernel command-line options.

Mathematica
The command Mathematica runs the Mathematica front end. In order to run Mathematica with
a command-line option, you must start it from the command line using the Terminal applica-
tion.

-cleanStart Tells the front end to ignore caches stored in the directory
~/Library/Mathematica/FrontEnd/7.0 Caches, and rebuilds
the front end preferences file,
~/Library/Mathematica/FrontEnd/init.m.
-mathlink Causes the front end to run in MathLink mode. In MathLink
mode, the front end runs as a child process that is capable
of accepting MathLink packets. This option may be useful
when the front end is used as a typesetting or graphics
rendering service.
-preferencesDirectory dir Specifies the location where preference settings are stored.
The default location is ~/Library/Mathematica.
-topDirectory dir Specifies the location of the Mathematica installation
directory.

Mathematica command-line options.


146 System Administration for Single-Machine Licenses

Testing the Installation on Mac OS X


The following simple commands allow you to test the installation of Mathematica. Running
these commands does not guarantee that the installation was successful, but a failed command
can indicate that a serious problem occurred during installation.

You should run these tests from a regular user account and not from an account with administra-
tor privileges.

To run Mathematica using a network license, both the client machine and the license server
must be on the network and MathLM must be running.

If you run into problems when doing these tests, see the troubleshooting tips in "Trouble-
shooting on Mac OS X". If you do not find the answer there, check the Technical Support web-
site at support.wolfram.com/mathematica.

To Test the Kernel:


1. To start the kernel, open the Terminal application and type the full
pathname of the MathKernel binary in the window that appears. For example,
if you installed Mathematica in the Applications folder, type /Applications/
Mathematica.app/Contents/MacOS/MathKernel in a Terminal window and press
Return.

In[1]:=

2. Type N[Pi, 20] and press Return. The number in the output should match the output
shown here.

In[1]:= N[Pi, 20]

Out[1]= 3.1415926535897932385

In[2]:=

3. To exit the kernel, type Exit and press Return.

To Test the Front End:


1. Launch Mathematica by double-clicking the Mathematica icon.

A splash screen with initialization information appears briefly, after which an empty note-
book and the Welcome Screen appear.
System Administration for Single-Machine Licenses 147

2. Type N[Pi,20]. Then hold down the Shift key and press Enter to evaluate. This should
send the command to the kernel and return the same result as before. The In[1] and
Out[1] labels are prepended once the evaluation is completed.

In the notebook window, there should be a horizontal line across the notebook; this is the
horizontal insertion bar. If you do not see one, move the pointer until it becomes a horizon-
tal I-beam and click once to see the insertion bar.

3. Press the Esc key. You should see three small horizontal lines in a column (Ç). Type int
and press Esc again. You should see an integral sign (Ÿ ). As an additional font check,
typing î[CheckmarkedBox] and î[CirclePlus] should print the symbols  and ⊕,
respectively. If the symbols show up correctly, the fonts have been properly installed.

4. From the Help menu, choose Documentation Center. The Mathematica Documentation
Center should appear.

Configuration Files on Mac OS X


Mathematica stores preference settings and initialization data in two directories,
$BaseDirectory and $UserBaseDirectory. Within each of these directories are several possi-
ble subdirectories with titles such as FrontEnd, Kernel, and Licensing.

† Global settings that affect all users are stored in subdirectories of the directory
$BaseDirectory. The default value of $BaseDirectory on Mac OS X is
/Library/Mathematica. To redefine the location of global preference settings and initializa-
tion data, set the environment variable MATHEMATICA_BASE.

† Settings that only affect a particular user are stored in subdirectories of the directory
$UserBaseDirectory, which is typically a subdirectory of the user's home directory. The
default value of $UserBaseDirectory on Mac OS X is ~/Library/Mathematica. To redefine
the location of user preferences and initialization data, set the environment variable
MATHEMATICA_USERBASE.

Settings in the directory $UserBaseDirectory override global settings defined in the directory
$BaseDirectory.

In the pathnames that follow, replace the variables $BaseDirectory and $UserBaseDirectory
with the appropriate directories for your system. To find their locations on your system, evalu-
ate the command $BaseDirectory (or $UserBaseDirectory) in a Mathematica notebook.

Kernel
The initialization files used by the kernel contain Mathematica commands that are evaluated at
startup, such as function definitions, packages to load, or kernel option settings. These com-
mands are also available to the Mathematica front end.
148 System Administration for Single-Machine Licenses

$BaseDirectory/Kernel/init.m

This file is used to initialize the kernel and therefore should store any kernel commands
that are appropriate for all users running the kernel.

$UserBaseDirectory/Kernel/init.m

This file stores user-specific commands used to initialize the kernel.

Kernel initialization files are not created automatically.

Front End
Front end initialization files store preference settings such as the values of global options in the
Option Inspector. These files are automatically updated by Mathematica when you change a
setting in the front end. To make changes to this file, make your changes from within Mathemat-
ica rather than editing the file directly.

$BaseDirectory/FrontEnd/init.m

This file stores systemwide defaults used by all Mathematica front ends. The settings in
this file affect all users. "Systemwide Defaults on Mac OS X" explains how to implement
changes to this global file.

$UserBaseDirectory/FrontEnd/init.m

This file defines settings within the front end that are specific to each user.

$UserBaseDirectory/FrontEnd/7.0 Caches/

This directory within the user's home directory stores information on system settings that
are read by the front end.

Front end initialization files are created automatically.

Passwords
Passwords are stored in the mathpass file, described in further detail in "Registration and Pass-
words". In the following pathname, replace the variable $InstallationDirectory with the
directory where you installed Mathematica. To find the value of $InstallationDirectory on
your system, evaluate the command $InstallationDirectory in a Mathematica notebook.

$BaseDirectory/Licensing/mathpass

This is the default location for the global password file.

$InstallationDirectory/Configuration/Licensing/mathpass
System Administration for Single-Machine Licenses 149

This is an alternative location for the global password file.

$UserBaseDirectory/Licensing/mathpass

While this is not normally the location for the password file, a user-specific mathpass file
can be stored here.

Systemwide Defaults on Mac OS X


If you have installed Mathematica in a location where multiple users run it (for example, on a
file server or multi-user machine), then you can set up systemwide defaults for the Mathemat-
ica front end and kernel. This is ideal for setting up Mathematica for use in computer labs and
classrooms. If you share the directory $BaseDirectory across the network, these defaults will
also take effect on local installations that use the shared $BaseDirectory.

The following instructions assume that $BaseDirectory and $UserBaseDirectory have their
default values, /Library/Mathematica and ~/Library/Mathematica, respectively.

To Set Up a Configuration File for the Front End:


1. Launch Mathematica, and set up any changes to the front end that you need. For
example, you may want to modify default file locations, language options, or menu
settings.

2. Quit Mathematica.

3. Copy the file ~/Library/Mathematica/FrontEnd/init.m to the directory /Library/


Mathematica/FrontEnd.

These settings will now be used by the front end unless overridden by the local init.m file stored
in the user's ~/Library/Mathematica/FrontEnd directory.

To Set Up a Configuration File for the Kernel:


1. Launch Mathematica, and create a new file.

2. Add any Mathematica commands that should be evaluated on startup. For example, you
may want to add a function definition or display a message at startup. Enter all the com-
mands in the same cell, separating commands with semicolons.

3. Make this cell an initialization cell by selecting the cell bracket and then choosing Cell 
Cell Properties  Initialization Cell.

4. When you have finished making your changes, choose File  Save and select
Mathematica Package from the Save as type popup menu. Then save the file as
/Library/Mathematica/Kernel/init.m.
150 System Administration for Single-Machine Licenses

These commands will be evaluated when users launch Mathematica. If you added a function
definition, that function will be available to all users.

Troubleshooting on Mac OS X
Passwords
If the front end password dialog box appears when you launch Mathematica, either Mathemat-
ica could not locate the mathpass file or there was no valid password in the mathpass file. To
resolve this problem, first check that there is a mathpass file in one of these directories:
/Library/Mathematica/Licensing, $InstallationDirectory/Configuration/Licensing, or
~/Library/Mathematica/Licensing. To find the exact location of $InstallationDirectory on
your machine, evaluate the command $InstallationDirectory in a notebook. If you did not
find a mathpass file in these locations, follow the instructions in "Entering a Single-Machine
Password" to reenter your password.

If there is a mathpass file in one of those directories, the password or passwords are invalid.
Make sure that your MathID number matches the MathID number used to issue your password.
If your MathID number changes, you will need to contact Customer Service to get a new pass-
word. Contact information is provided in "Registration and Passwords".

Front End Preferences


Front end preferences, such as the locations of recently opened and saved files, are stored in a
front end initialization file called init.m. This file is located in the directory ~/Library/
Mathematica/FrontEnd. If you need to reset the front end preferences to their default values,
hold down Shift+Option during startup. This will cause the initialization file to be rebuilt automat-
ically.

Caches
Information about your Mathematica system layout, such as the locations of text resource
files and help files, is stored in caches. These caches are located in the directory ~/Library/
Mathematica/FrontEnd/7.0/ Caches.

A corrupted cache may cause the front end to produce an error or quit immediately on startup.
The most convenient way to restore the caches to their default values is to hold down
Shift+Option during startup. This will cause the Mathematica caches and the initialization file to
be rebuilt automatically.
System Administration for Single-Machine Licenses 151

If you want to rebuild your caches but retain your preferences, hold down Shift during startup.
This will delete and rebuild the cache without rebuilding your front end initialization file.

Technical Support
For further assistance, check the Technical Support FAQs on the web at support.wolfram.com.
If you are a Site License Administrator, additional Site License Documentation is available at
site.wolfram.com. If you do not find the information you need, please contact Technical Support
by sending email to support@wolfram.com or by calling +1-217-398-6500. Include your license
number in all correspondence. Your license number is located on your electronic or printed
license certificate. It is also available after installation by going to the Help menu and clicking
About Mathematica. You must be a registered user in order to receive installation support.
You must have a current Premier Service subscription to receive Technical Support.

You might also like