OOMMF Home next up previous contents
Next: OOMMF Launcher/Control Interface: mmLaunch Up: OOMMF Documentation Previous: OOMMF Architecture Overview

Command Line Launching

Some of the OOMMF applications are platform-independent Tcl scripts. Some of them are Tcl scripts that require special platform-dependent interpreters. Others are platform-dependent, compiled C++ applications. It is likely that some of them will change status in later releases of OOMMF. Each of these types of application requires a different command line for launching. Rather than require all OOMMF users to manage this complexity, we provide a pair of programs that provide simplified interfaces for launching OOMMF applications.

The first of these is used to launch OOMMF applications from the command line. Because its function is only to start another program, we refer to this program as the ``bootstrap application.'' The bootstrap application is the Tcl script app/oommf/oommf.tcl. In its simplest usage, it takes a single argument on the command line, the name of the application to launch. For example, to launch mmGraph, the command line is:

tclsh app/oommf/oommf.tcl mmGraph
The search for an application matching the name is case-insensitive. (Here, as elsewhere in this document, the current working directory is assumed to be the OOMMF root directory. For other cases, adjust the pathname as appropriate.) As discussed earlier, the name of the Tcl shell, rendered here as tclsh, may vary between systems.

If no command line arguments are passed to the bootstrap application, by default it will launch the application mmLaunch.

Some of the OOMMF applications take optional arguments when launched from the command line. Any command line arguments to the bootstrap application placed after the application name will be passed as command line arguments to the named application. For example, most applications support a -console option, which will bring up an additional window providing a command line interface into the application's Tcl interpreter. (The console is mainly used for debugging.)

The bootstrap application also supports some more complicated, more rarely used processing of its command line arguments. By default, the bootstrap application launches the named application in the background and exits. If the first argument to the bootstrap program is the option -nofork, however, the bootstrap program will block until the application it launches (now named in the second command line argument) exits.

If the argument following the application name looks like a version number (containing only digits and dots), then the bootstrap application will interpret it as the minimum version of the named application to launch. If no application satisfying the version requirement can be found, the bootstrap application will report an error.

The bootstrap application should be infrequently used by most users. The application mmLaunch provides a more convenient graphical interface for launching applications. The main uses for the bootstrap application are launching mmLaunch, launching programs which make up the OOMMF Batch System and other programs which are inherently command line driven, and in circumstances where the user wishes to precisely control the command line arguments passed to an OOMMF application or the environment in which an OOMMF application runs.

Platform Issues

The Tcl script app/oommf/oommf.tcl begins with the lines:

# \
exec tclsh "$0" ${1+"$@"}
On most Unix platforms, if app/oommf/oommf.tcl is marked executable, the interpreter tclsh (on the execution path) will be invoked to interpret the script. If the Tcl shell program cannot be invoked by the name tclsh on your computer, edit the first lines of app/oommf/oommf.tcl to use the proper name. Better still, use symbolic links or some other means to make the Tcl shell program available by the name tclsh. The latter solution will not be undone by file overwrites from OOMMF upgrades.

If in addition, the directory app/oommf is in the execution path, the command line can be as simple as:

oommf.tcl <appName>

On Windows platforms, because app/oommf/oommf.tcl has the file extension .tcl, it is normally associated by Windows with the wish interpreter. The oommf.tcl script has been specially written so that either tclsh or wish is a suitable interpreter. This means that simply double-clicking on an icon associated with the file app/oommf/oommf.tcl (say, in Windows Explorer) will launch the bootstrap application with no arguments. This will result in the default behavior of launching the application mmLaunch, which is suitable for launching other OOMMF applications. (If this doesn't work, refer back to the Windows Options section in the installation instructions.)

OOMMF Home next up previous Contents

OOMMF Documentation Team
February 23, 2000