Installing OOMMF in linux without root access can be difficult. The basic install procedure for OOMMF is quite straight forward: check you have tcl/tk, download the oommf source then run oommf.tcl pimake. This is fine when you have root access and can easily run the package manager to install the dev versions of tcl and tk.
If we only have user level access it can be a bit more tricky. Without access to a package manager we must compile tcl and tk from source. In this post I will go through the full install of oommf, including compiling tcl/tk from source. The install guides for tcl, tk and oommf are all really good. They do still however require some decisions to be made, so hopefully spelling out what worked for me here can be of use.
1. Download tcl, tk.
We will be following the general compile instructions here: http://www.tcl.tk/doc/howto/compile.html. These instructions are generally very good, but I will try to highlight any areas of uncertainty I had.
First download the tcl and tk source from http://www.tcl.tk/software/tcltk/download.html
(wget can be useful for downloading things from the command line. Just type
Extract the archives to your (a subdirectory of) your home folder.
tar -zxvf tcl8.5.14-src.tar.gz -C ~/downloads/
tar -zxvf tk8.5.14-src.tar.gz -C ~/downloads/
We specify the install location during the compilation stage.
2. Make/configure/install tcl
./configure --prefix=/home/user_name/tcl --enable-threads
A whole load of text will scroll by.
3. Make/configure/install tk.
The process is very similar to compiling tcl, but we also tell tk where to find our tcl installation.
Before configuring tk: If you are connected to your oommf machine via ssh it is important that X-11 forwarding is setup and that you have a suitable X server (e.g. Exceed) running on your system and your ssh connection allows X forwarding.
When configurint tk it is important to set the –prefix flag to be the same as you used to install tcl. If not then you will get version conflicts.
./configure --with-tcl=/home/user_name/tcl/lib --prefix=/home/user_name/tcl
Add the tcl install to the path, so you can easily access it (e.g. to run oommf):
(Add these export command lines to your .bashrc so that they load automatically when you login.)
4. You might need to set environment variables for oommf.
If you have trouble at this stage please check the oommf basic installation page.
5. Install/compile oommf.
Please see OOMMF install guide for full install details.
If you haven’t already done so download and extract oommf from http://math.nist.gov/oommf/dist/oommf12a5rc_20120928.tar.gz
Extract archive to a separate folder
tar -zxvf oommf12a5rc_20120928.tar.gz -C ~/oommf/
Go to the oommf directory e.g. ~/oommf/oommf1-2a5/
Check that the tcl/tk install and oommf are compatible.
tclsh8.5 oommf.tcl +platform
If this is ok then run
path/to/tclsh8.5 oommf.tcl pimake upgrade
path/to/tclsh8.5 oommf.tcl pimake distclean
path/to/tclsh8.5 oommf.tcl pimake
Then you can just run oommf:
I like to make a script “oommf.sh” which has:
/path/to/tclsh8.5 /path/to/oommf/oommf.tcl $@
The “$@” takes all command line arguments from the terminal. This is useful for having quick access to the various useful command line utilities built in to OOMMF, such as any2ppm.