OOMMF Home next up previous contents index
Next: Quick Start: Example OOMMF Up: Installation Previous: Basic Installation


Advanced Installation

The following sections provide instructions for some additional installation options.

Reducing Disk Space Usage

To delete the intermediate files created when building the OOMMF software from source code, use pimake to build the target objclean in the root directory of the OOMMF distribution.

tclsh oommf.tcl pimake objclean
Running your platform strip utility on the OOMMF executable files should also reduce their size somewhat.

Local Customizations

OOMMF software supports local customization of some of its features. All OOMMF programs load the file config/options.tcl, which contains customization commands as well as editing instructions. As it is distributed, config/options.tcl directs programs to also load the file config/local/options.tcl, if it exists. Because future OOMMF releases may overwrite the file config/options.tcl, permanent customizations should be made by copying config/options.tcl to config/local/options.tcl and editing the copy. It is recommended that you leave in the file config/local/options.tcl only the customization commands necessary to change those options you wish to modify. Remove all other options so that overwrites by subsequent OOMMF releases are allowed to change the default behavior.

Notable available customizations include the choice of which network port the host service directory application uses, and the choice of what program is used for the display of help documentation. By default, OOMMF software uses the application mmHelp, which is included in the OOMMF release, but the help documentation files are standard HTML, so any web browser (for example, Netscape Navigator or Microsoft Internet Explorer) may be used instead. Complete instructions are in the file config/options.tcl.


In the interest of successful compilation of a usable software package ``out of the box,'' the default configuration for OOMMF does not attempt to achieve much in terms of optimization. However, in each platform's configuration file (for example, config/cache/wintel.tcl), there are alternative values for the configuration's optimization flags, available as comments. If you are familiar with your compiler's command line options, you may experiment with other choices as well. You can edit the platform configuration file to replace the default selection with another choice that provides better computing performance. For example, in config/cache/wintel.tcl, alternative optimization flags for the MSVC++ compiler are defined with the line:

$config SetValue program_compiler_c++_option_opt {format "/G5 /Ox"}

The extensible solver, Oxs, can be compiled with debugging support for extensive run-time code checks. This will significantly reduce computation performance. In the standard OOMMF distributions, these checks should be disabled. You may verify this by checking that the following line appears in the file config/options.tcl:

Oc_Option Add * Platform cflags {-def NDEBUG}
To enable these checks, either comment/remove this line, or else add to the config/local/options.tcl file a ``cflags'' option line without ``-def NDEBUG'', such as
Oc_Option Add * Platform cflags {-warn 1}
The config/local/options.tcl file may be created if it does not already exist.

Managing OOMMF Platform Names

OOMMF software classifies computing platforms into different types using the scripts in the directory config/names relative to the root directory of the OOMMF distribution. Each type of computing platform is assigned a unique name. These names are used as directory names and in index and configuration files so that a single OOMMF installation may contain platform-dependent sections for many different types of computing platforms.

To learn what name OOMMF software uses to refer to your computing platform, run

tclsh oommf.tcl +platform
in the OOMMF root directory.

Changing the name OOMMF assigns to your platform

First, use pimake to build the target distclean to clear away any compiled executables built using the old platform name.

tclsh oommf.tcl pimake distclean
Then, to change the name OOMMF software uses to describe your platform from foo to bar, simply rename the file
config/names/foo.tcl to config/names/bar.tcl
config/cache/foo.tcl to config/cache/bar.tcl.
After renaming your platform type, you should recompile your executables using the new platform name.

Adding a new platform type

If oommf.tcl +platform reports the platform name unknown, then none of the scripts in config/names/ recognizes your platform type. As an example, to add the platform name foo to OOMMF's vocabulary of platform names, create the file config/names/foo.tcl. The simplest way to proceed is to copy an existing file in the directory config/names and edit it to recognize your platform.

The files in config/names include Tcl code like this:

  Oc_Config New _ \
    [string tolower [file rootname [file tail [info script]]]] {
      # In this block place the body of a Tcl proc which returns 1
      # if the machine on which the proc is executed is of the
      # platform type identified by this file, and which returns 0
      # otherwise.
      # The usual Tcl language mechanism for discovering details 
      # about the machine on which the proc is running is to 
      # consult the global Tcl variable 'tcl_platform'.  See the
      # existing files for examples, or contact the OOMMF
      # developers for further assistance.

After creating the new platform name file config/names/foo.tcl, you also need to create a new platform cache file config/cache/foo.tcl. A reasonable starting point is to copy the file config/cache/unknown.tcl for editing. Contact the OOMMF developers for assistance.

Please consider contributing your new platform recognition and configuration files to the OOMMF developers for inclusion in future releases of OOMMF software.

Resolving platform name conflicts

If the script oommf.tcl +platform reports ``Multiple platform names are compatible with your computer'', then there are multiple files in the directory config/names/ that return 1 when run on your computer. For each compatible platform name reported, edit the corresponding file in config/names/ so that only one of them returns 1. Experimenting using tclsh to probe the Tcl variable tcl_platform should assist you in this task. If that fails, you can explicitly assign a platform type corresponding to your computing platform by matching its hostname. For example, if your machine's host name is foo.bar.net:

  Oc_Config New _ \
    [string tolower [file rootname [file tail [info script]]]] {
      if {[string match foo.bar.net [info hostname]]} {
          return 1
      # Continue with other tests...

Contact the OOMMF developers if you need further assistance.

Microsoft Windows Options

This section lists installation options for Microsoft Windows.

Using Microsoft Visual C++

If you are building OOMMF software from source using the Microsoft Visual C++ command line compiler, cl.exe, it is necessary to run vcvars32.bat to set up the path and some environment variables. This file is distributed as part of Visual C++. You may want to set up your system so this batch file gets run automatically when you boot the system, or open a command prompt. See your compiler and system documentation for details.

Using the Cygwin toolkit

The Cygwin Project is a free port of the GNU development environment to Windows NT and 9X, which includes the GNU C++ compiler gcc and a port of Tcl/Tk. OOMMF has been successfully built and tested within the Cygwin environment, and sample config/names/cygtel.tcl and config/cache/cygtel.tcl files are included in the OOMMF distribution. Use cygtclsh as your tclsh program when configuring, building, and launching OOMMF software.

Note that OOMMF software determines whether it is running with the Cygwin versions of Tcl/Tk by examining the environment variables OSTYPE and TERM. If either is set to a value beginning with cygwin, the Cygwin environment is assumed. If you are using the Cygwin environment with a different values for both OSTYPE and TERM, you will have to modify config/names/cygtel.tcl accordingly.

Using Borland C++

OOMMF has been successfully built and tested using the Borland C++ command line compiler version 5.5. However, a couple preparatory steps are necessary before building OOMMF with this compiler.
  1. Properly complete bcc55 compiler installation.

    Be sure to read the readme.txt file in the BCC55 subdirectory of the Borland install directory. In particular, check that the bcc32.cfg and ilink32.cfg configuration files exist in the BIN directory, and have appropriate contents. If you omit this step you will get error messages during the OOMMF build process relating to the inability of the Borland compiler to find system header files and libraries.

  2. Create Borland compatible Tcl and Tk libraries.

    The import libraries distributed with Tcl/Tk, release 8.0.3 and later, are not compatible with the Borland C++ linker. However, the command line utilities impdef and implib, which are distributed with the Borland compiler, can be used to create suitable libraries from the Tcl/Tk DLL's. In the Tcl/Tk library directory (typically C:\Tcl\lib or "C:\Program Files\Tcl\lib"), issue the following commands

    impdef -a tcl83bc.def ..\bin\tcl83.dll
    implib tcl83bc.lib tcl83bc.def
    to create the Borland compatible import library tcl83bc.lib. Repeat with ``tk'' in place of ``tcl'' to create tk83bc.lib. The ``-a'' switch requests impdef to add a leading underscore to function names. This is sufficient for the DLL's shipped with Tcl/Tk 8.3, but other releases may require additional tweaking. The module definition file output by impdef, e.g., tcl83bc.def above, is a plain text file. You may need to edit this file to add or modify entries.

  3. Edit config\cache\wintel.tcl

    At a minimum, you will have to change the program_compiler_c++ value to point to the Borland C++ compiler. The sample wintel.tcl cache file assumes the librarian tlib and the linker ilink32 are in the execution path, and that the Borland compatible import libraries made above are in the Tcl/Tk library directory. If this is not the case then you will have to make the additional modifications. Also, you may need to add the ``-o'' switch to the linker command to force ordinal usage of the Borland compatible Tcl/Tk libraries produced in the previous step.

After this, continue with the instructions in the Compiling and Linking section.

Setting the TCL_LIBRARY environment variable

If you encounter difficulties during OOMMF start up, you may need to set the environment variable TCL_LIBRARY.

On Windows NT
Bring up the Control Panel (e.g., by selecting Settings|Control Panel off the Start menu), and select System. Go to the Environment tab, and enter TCL_LIBRARY as the Variable, and the name of the directory containing init.tcl for the Value, e.g.,
%SystemDrive%\Program Files\Tcl\lib\tcl8.0
Click Set and OK to finish.

On Windows 9x

Edit the file autoexec.bat. Add a line such as the following:

set TCL_LIBRARY=C:\Program Files\Tcl\lib\tcl8.0

Checking .tcl file association on Windows NT

As part of the Tcl/Tk installation, files with the .tcl extension are normally associated with the wish application. This allows Tcl scripts to be launched from Windows Explorer by double-clicking on their icon, or from the NT command line without specifying the tclsh or wish shells. If this is not working, you may check your installation from the NT command line as follows. First, run the command ``assoc .tcl''. This should return the file type associated with the .tcl extension, e.g., TclScript. Next, use the ftype command to check the command line associated with that file type, e.g.,
C:\> ftype TclScript
 "C:\Program Files\Tcl\bin\wish84.exe" "%1" %2 %3 %4 %5 %6 %7 %8 %9
Note that the quotes are required as shown to protect spaces in pathnames. If either assoc or ftype are incorrect, view the command line help information (``assoc /?'' and ``ftype /?'') for details on making changes.

Adding an OOMMF shortcut to your desktop

Right mouse click on the desktop to bring up the configuration dialog, and select New|Shortcut. Enter the command line necessary to bring up OOMMF, e.g.,

tclsh84 c:\oommf\oommf.tcl

Click Next> and enter OOMMF for the shortcut name. Select Finish.

At this point the shortcut will appear on your desktop with either the tclsh or wish icons. Right mouse click on the icon and select Properties. Select the ShortCut tab, and bring up Change Icon... Under File Name: enter the OOMMF icon file, e.g.,


Click OK. Back on the Shortcut tab, change the Run: selection to Minimized. Click OK to exit the Properties dialog box. Double clicking on the OOMMF icon should now bring up the OOMMF application mmLaunch.

OOMMF Home next up previous Contents index

OOMMF Documentation Team
October 30, 2002