You are on page 1of 1

To compile the code, you can simply run "build.

sh", or you can follow the manual


instructions below:

--------------------

In Ubuntu 17.10, run the following (Or obtain the equivalent packages in other
distros):
sudo apt install python ipython python-pip libreadline-dev g++ libblas-dev
libreadline-dev make m4 gawk zlib1g-dev liblapack-dev mpich mpi-default-bin ocaml
python-tables
sudo pip install numpy pyvtk ipython py ply scipy

untar nmag-0.2.1.tar.gz using `tar xzvf nmag-0.2.1.tar.gz`. The directory "nmag-


0.2.1" will be created, and it will be referred to from now on as <nmag-dir>.

Replace original Makefile in <nmag-dir> with the modified Makefile (included in the
current directory)

Replace original shell.py in <nmag-dir>/nsim/interface/nsim/ with modified shell.py


(included in the current directory)

Convert old pytables camel casing to underscore notation using the following
commands:

grep -rl nsim -e setNodeAttr | xargs sed -i s/setNodeAttr/set_node_attr/g


grep -rl nsim -e isPyTablesFile | xargs sed -i s/isPyTablesFile/is_pytables_file/g
grep -rl nsim -e isHDF5File | xargs sed -i s/isHDF5File/is_hdf5_file/g
grep -rl nsim -e openFile | xargs sed -i s/openFile/open_file/g
grep -rl nsim -e createGroup | xargs sed -i s/createGroup/create_group/g
grep -rl nsim -e createArray | xargs sed -i s/createArray/create_array/g
grep -rl nsim -e createCArray | xargs sed -i s/createCArray/create_carray/g
grep -rl nsim -e createTable | xargs sed -i s/createTable/create_table/g
grep -rl nsim -e getNode | xargs sed -i s/getNode/get_node/g

Finally, navigate to <nmag-dir> and run `make`.


The binaries can be found in <nmag_dir>/bin.

You might also like