Next: Quick Start: Example OOMMF
Up: Installation
Previous: Advanced Installation
Subsections
Platform Specific Installation Issues
The installation procedure discussed in the previous sections applies to
all platforms (Unix, Windows, macOS). There are, however, some
details which pertain only to a particular platform. These issues are
discussed below.
The basic installation procedure should be sufficient to install OOMMF on most Unix systems. Sometimes, however, the build will fail due to
missing Tcl header files (tcl.h, tk.h) or libraries (e.g.,
libtcl.so, libtk.so). This problem can usually be solved by
installing a ``development'' version of Tcl/Tk, which may be found on
the operating system installation disks, or may be available from the
system vendor. There are also binary releases of Tcl/Tk for a number
of systems available from ActiveState, under the name
ActiveTcl.
Alternatively, one may download the sources for Tcl and Tk from the
Tcl Developer
Xchange, and build and install Tcl/Tk from source. The Tcl/Tk build follows the usual Unix configure, make, make install build convention.
On most systems, OOMMF builds by default with relatively unaggressive
compiler optimization options. As discussed earlier
(under Optimization), you may edit the appropriate
oommf/config/platforms/ file to change the default compilation options.
However, on some common systems (e.g., Linux, some BSD variants) OOMMF will try to deduce the hardware architecture (i.e., the CPU subtype,
such as Pentium 3 vs. Pentium 4) and apply architecture-specific options
to the compile commands. This is probably what you want if OOMMF is
to be run only on the system on which it was built, or if it is run on a
homogeneous cluster. If, instead, you intend to run OOMMF on a
heterogeneous cluster you may need to restrict the compiler options to
those supported across your target machines. In that case, open the
appropriate configuration file in the oommf/config/platforms/
directory, and look for the lines
# You can override the GuessCPU results by directly setting or
# unsetting the cpuopts variable, e.g.,
#
# set cpuopts [list -march=skylake]
# or
# unset cpuopts
#
Uncomment either the ``unset cpuopts'' line to make a generic build, or
else edit the ``set cpuopts'' line to an appropriate common-denominator
architecture and uncomment that line.
In a similar vein, some compilers support a ``-fast'' switch, which
usually creates an architecture-specific executable. The same
considerations apply in this case.
An advanced alternative would be to define separate OOMMF ``platforms'' for each CPU subtype in your cluster. At a minimum, this
would involve creating separate platform name files in
oommf/config/names/ for each subtype, and then making copies of the
appropriate oommf/config/platforms file for each new platform. The
platform name files would have to be written so as to reliably detect
the CPU subtype on each machine. See ``Managing OOMMF platform names'' for details on creating platform name
files.
The platform build scripts for Linux,
oommf/config/platforms/lintel.tcl (32-bit) and
oommf/config/platforms/linux-x86_64.tcl (64-bit) contain sections
supporting the Portland Group pgCC compiler. Non-threaded builds of
OOMMF using this compiler run fine, but threaded builds segfault when
running Oxsii/Boxsi. The source of this problem is not known at this
time.
macOS Configuration
The build procedure for macOS is the same as for Unix. The
platform name is ``darwin''. If the platform
configuration check does not find a C++ compiler,
then you will have to install one. One option is the Xcode command line
developer tools provided by Apple. You can install these from a
Terminal window via the command
xcode-select --install
You should run this command even if you install the full Xcode IDE.
Refer to your system documentation for details.
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 set up
the path and some environment variables before running the compiler.
There is a batch file distributed with Visual C++ that you can run to do
this. The name of the file varies between Visual C++ releases, but for
example may be vcvarsall.bat or setenv.cmd. For 64-bit builds
you may need to include the ``amd64'' option on the batch file command
line. You may want to set up your system so this batch file gets run
automatically when you open a command window. See your compiler and
system documentation for details.
Using MinGW g++
Both 32-bit and 64-bit builds are supported using the MinGW ports of
g++. (The 32-bit and 64-bit versions of g++ are separate downloads.)
Use a standard Windows Tcl/Tk, such as the
ActiveTcl
release from ActiveState. You will also need to edit the appropriate
platform file to select g++ as the compiler. If you are using a 32-bit
Tcl/Tk and g++, then the platform file is
oommf\config\platforms\wintel.tcl. For 64-bit
Tcl/Tk and g++ the platform file is
oommf\config\platforms\windows-x86_64.tcl.
Using the Cygwin toolkit
The Cygwin Project
is
a free port of the GNU development environment to Windows, which
includes the GNU C++ compiler g++ and X11. To build OOMMF within the
Cygwin environment, start up a Cygwin or Cygwin64 shell and follow the
usual Unix build procedure. The platform name will be cygtel
or cygwin-x86_64, according to whether you are running a 32- or
64-bit Cygwin tclsh, respectively. The resulting OOMMF build
requires the Cygwin environment to run, so it will need to be launched
from a Cygwin shell. Moreover, OOMMF on Cygwin uses X11 as the
windowing interface, so you will need to have the Cygwin port of X11
installed; typically OOMMF will be started from an X11 xterm or
equivalent. Of course, you will also need the Tcl and Tk packages
installed (called tcl and tcl-tk, respectively, by the
Cygwin package manager). To build OOMMF from source you will
need the gcc-g++, tcl-devel, and tcl-tk-devel
packages and dependencies.
If you get errors saying a child process couldn't be forked (typically
with either ``resource temporarily unavailable'' or ``Loaded to
different address'' error messages), then follow this procedure:
- Exit all Cygwin processes
- Use Windows Explorer or a Windows command shell to launch
c:\cygwin\bin\ash.exe
- Run /bin/rebaseall inside the ash shell.
Additional information on this problem can be found in the Cygwin
documentation.
The Cygwin versions of Tcl/Tk prior to 8.6 were not threaded, so
OOMMF built with Tcl/Tk 8.5 and older will likewise not be
threaded. This limitation is removed with the Cygwin Tcl/Tk 8.6
release.
Setting the TCL_LIBRARY environment variable
If you encounter difficulties during OOMMF start up, you may need to set
the environment variable
TCL_LIBRARY. (NOTE: This
is almost never necessary!)
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.
OOMMF Documentation Team
September 29, 2021