Introduction

Once you have compiled Nmag from sources, you may want to add some extra packages to the Python installation which comes with it. Indeed, Nmag does not use the Python installed on your system (if there is one), but rather brings its own Python interpreter, meaning that any other extra Python library has to be compiled expressly for it. In other words, when you launch nsim you won't be able to import the libraries that you installed on your system Python. While this is certainly inconvenient, it allows us to distribute one unique file (nmag-0.1.tar.gz) which is likely to compile with little trouble on most Linux distributions.

Installing SciPy

First, compile Nmag from sources.
Second, make sure you have installed the following packages:

  • a sane build environment (which you already have, since you managed to compile Nmag)
  • Swig
  • a Fortran compiler

Indeed, the compilation of SciPy requires such packages to be installed on your system. Install all of them using the most convenient tool for your distribution. Download SciPy from the official website. You can do it with your browser by clicking here. You should save the file into the directory nmag-0.1/pkgs/. Then untar the package:

cd nmag-0.1
tar xzvf pkgs/scipy-?.?.?.tar.gz

Now enter the directory created by the tar command and build SciPy:

. exports.bash
cd scipy-?.?.?
../bin/python setup.py install

The first line modifies the environment such that the local installed libraries can be found.
Be careful to use ../bin/python (the Python which comes with Nmag) rather than simply python (the Python installed on your system).
If all goes well than you should be able to import scipy:

cd .. # cd into the nmag-0.1 directory
./bin/nsim 
import scipy

You should get a silent prompt (no error messages). Exit nsim pressing CTRL+D or typing exit().

Also available in: HTML TXT