This document outlines how to install the SWMF on your system and how to create and access the documentation. To learn more about the SWMF, including how to compile and run the code, please consult the user manual. To install the SWMF and create the user manual please follow the instructions below.
Get the source code from Git or from the tar balls.
The minimim requirement is the SWMF repository.
You may also need the SWMF_data repository that contains large data
files. It can be put into the home directory or into the SWMF directory.
Some data files used by the Center for Radiative Shock Hydrodynamics
(CRASH) are in the CRASH_data repository. If needed, it has to be
placed into the home directory.
Clone the SWMF from GitHub
cd {where_you_want_to_have_mstem-quda}
git clone https://github.com/MSTEM-QUDA/SWMFThe rest of the repositories (share, util, BATSRUS ...) will be cloned from GitHub during the installation.
Read the GitLab instructions about registering, passwordless access, mail notifications, and defining the "gitlabclone" (or gitclone) alias/function.
Check out the SWMF distribution
cd {where_you_want_to_have_the_swmf}
gitlabclone SWMFCheck out the SWMF_data distribution into the home directory if needed
cd
gitlabclone SWMF_dataCheck out the CRASH_data distribution into the home directory if needed
cd
gitlabclone CRASH_dataOpen SWMF tar ball
cd {where_you_want_to_have_the_swmf}
tar -xzf {path_to_file}/SWMF_v{version_number}.tgzIf needed, open the SWMF_data tar ball into the home directory
cd
tar -xzf {path_to_file}/SWMF_data.tgzIf needed, open the CRASH_data tar ball into the home directory
cd
tar -xzf {path_to_file}/CRASH_data.tgzMany machines used by UofM are already recognized by the share/Scripts/Config.pl script which is called by all other Config.pl scripts in the SWMF. For these platform/compiler combinations installation is very simple:
./Config.pl -installOn other platforms the Fortran (and C) compilers should be explicitly given. To see available choices, type
./Config.pl -compilerThen install the code with the selected Fortran (and default C) compiler, e.g.
Config.pl -install -compiler=gfortranA non-default C compiler can be added after a comma, e.g.
./Config.pl -install -compiler=mpxlf90,mpxlcFor machines with no MPI library, use
./Config.pl -install -nompi -compiler=....This will only allow serial execution, of course.
The ifort compiler (and possibly others too) use the stack for temporary arrays, so the stack size should be large. For csh/tcsh add the following to .cshrc:
unlimit stacksizeFor bash/ksh add the following to .bashrc or equivalent initialization file:
ulimit -s unlimitedPlease note that creating the PDF manuals requires that LaTeX (available through the command line) is installed on your system.
To create the PDF manuals type
make PDFin the SWMF directory. The manuals will be in the doc/ directory.
Cleaning the documentation
cd doc/Tex
make cleanTo remove all the created documentation type
cd doc/Tex
make cleanpdfAll manuals can be accessed by opening the top index file
open doc/index.htmlYou may also read the PDF files directly with a PDF reader. The most important document is the user manual in
doc/SWMF.pdfYou can try running the standard test suite by typing
make -j testin the main directory. The -j flag allows parallel compilation. This
requires a machine where mpirun is available. The tests run on 2 CPU
cores by default. The results of the tests are summarized in
test_swmf.res Successful passing of the test is indicated by empty
.diff files.
To run the tests on more (up to 8) cores use
make -j test NP=4You can also run an individual test. The list of available SWMF tests can be listed with
make test_helpFor example, to run test1 without MPI on a single core use
make -j test1 MPIRUN=Copyright (C) 2002 Regents of the University of Michigan, portions used with permission. For more information, see http://csem.engin.umich.edu/tools/swmf