How to install Nmag 0.1 beta (6481) on Fedora 14 (64 bit)

Wagner de Oliveira da Rosa explains how he installed Nmag on Fedora 14. Note that newer versions should not require this hack.
Here is his mail:

How to install nmag on Fedora 14 - 64 bits using the method A (compiling all from the source):

1 - Download the nmag source file from the developers webpage nmag-0.1-all.tar.gz
2 - Install all the libraries and compilers needed like gawk, gcc, gfortran, readline, blas, lapack, etc (see the instruction manual)
3 - To compile the code from the source, you need to locate the library libutil.so using the follow command in terminal:

$ locate libutil.so

This search it will produce a result like this:

/lib64/libutil.so.1
/usr/lib64/libutil.so 

4 - Once located the libutil.so path, now we should go into the nmag main directory (where you untarred the files) and create a link to this file as shown below:

cd nmag-0.1 # directory where you untarred nmag
cd lib
ln -s /usr/lib64/libutil.so # you should replace with whatever you got from your system (from the locate command)

5 - Then, after all, do as follows:

cd .. # go back to the nmag main directory
make

6 - From now, nmag should compile without any problems. However, before you get set and start any simulation, you should proceed as follows. Find the file ldflags.bash, under the directory nmag-0.1/nsim/bin/ (nmag-0.1 is the main nmag directory). Open it using your preferred text editor and append this line to the end of the file

export LD_PRELOAD=/usr/lib64/libz.so

where /usr/lib64/libz.so should be replaced with the correct path to the libz.so library in your system (you can use locate libz.so to determine this, as done in step 3).

7 - Now that you will force to load the lib.so the nmag should be ready to use. You can try it by typing in terminal:

$ nsim
>>>

If you got this the nmag and nsim were successfully compiled and they are ready to use.

Have a nice simulation!!!

Also available in: HTML TXT