Compilation of Nmag on Ubuntu 11.04 (and possibly recent systems)

Details about the issue

Starting from Ubuntu 11.04, there have been modifications in the path layout conventions (filesystem hierarchy) to enhance support for different architectures (details are given here https://wiki.ubuntu.com/MultiarchSpec). In particular, some system libraries have been moved into a directories like /usr/lib/x86_64-linux-gnu or /lib/x86_64-linux-gnu. These directories contain libraries which have been compiled targeting specific architectures. This change confuses some of the packages we are currently installing in the tarball. In particular, the Python tables modules, the zlib Python module do not manage to find libz.so and are not compiled properly. This leads to failures when loading and saving data in Nmag scripts.

You may try to follow the instructions below, while we work on providing a patch to solve the problem.

How to solve it

First, you should locate where your libz.so library is. Type locate libz.so, you'll get something like:

/lib/x86_64-linux-gnu/libz.so.1
/lib/x86_64-linux-gnu/libz.so.1.2.3.4
/usr/lib/x86_64-linux-gnu/libz.so
/usr/lib32/libz.so.1
/usr/lib32/libz.so.1.2.3.4

Our candidate is /usr/lib/x86_64-linux-gnu/libz.so we should then do as follows:

cd nmag-0.1.1
echo 'export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libz.so"' >> nsim/bin/ldflags.bash

In the line above you should substitute /usr/lib/x86_64-linux-gnu/libz.so with what is appropriate for your system (given as an output of the locate command).

Also available in: HTML TXT