You have some options to install MicroMagnum. Everything you can find on download page:

Install precompiled Ubuntu packages

When you downloaded the Ubuntu package you can install it with the command:

sudo dpkg -i micromagnum_0.2*.deb

If you do not have all dependencies, you will get an error message. To install missing packages type:

sudo apt-get -f install

Install precompiled Windows packages

Precompiled binaries for Microsoft Windows are available in download. The Windows version works with CUDA.

Install MicroMagnum from source

Install prerequisite software libraries

You need the following software/libraries to compile MicroMagnum:

Furthermore you need the following build tools:

Ubuntu Linux

If you use a recent version of Ubuntu you can install the libraries (except CUDA) easily using apt-get:

sudo apt-get install python2.7-dev python-numpy python-imaging \

And for the required build tools:

sudo apt-get install g++ cmake swig

Mac OS X

We had some success in creating a (CPU-only) build of MicroMagnum for Mac OS X.

The following packages where installed manually:

Building MicroMagnum from source

This assumes that the source code is located in the "micromagnum" subdirectory. To build MicroMagnum, enter:

cd micromagnum                  # enter MicroMagnum base directory
cd src/build                    # enter build directory
cmake ..                        # to compile for CPU
make                            # start the build process
sudo make install               # installs MicroMagnum as python package 
                                # (optional; will not work on Mac OS X)

You can use the following parameters to customize your installation:

cmake .. [parameters]
-DENABLE_CUDA_32=on             # to compile for cuda 32 bit
-DENABLE_CUDA_64=on             # to compile for cuda 64 bit
-DUSE_PYTHON2=on                # force compile for python2
-DUSE_PYTHON3=on                # force compile for python3

If you did not "sudo make install", set the PYTHONPATH environment variable so the Python interpreter can load the magnum module, e.g.

export PYTHONPATH=/home/user/MicroMagnum/src

This needs to be done each time you use MicroMagnum.

To check the installation, start the Python interactive shell by entering “python” and type “import magnum”. If everything went ok, you should see no errors.


You can run a test problem by typing:

cd <magnum-basedir>/magnum/examples/sp4

# With CPU

# With GPU (if enabled at compile time)
./ -g0