musrfit/doc/html/setup-standard.html
2018-10-16 08:42:49 +02:00

1493 lines
136 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.4.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.4.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.4.0 documentation" href="index.html" />
<link rel="next" title="Setting up musrfit / DKS: High Speed Fitting with GPUs" href="setup-dks.html" />
<link rel="prev" title="Documentation of user libs (user functions)" href="user-libs.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="setup-dks.html" title="Setting up musrfit / DKS: High Speed Fitting with GPUs"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="user-libs.html" title="Documentation of user libs (user functions)"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.4.0 documentation</a> &raquo;</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="setting-up-musrfit-on-different-platforms">
<span id="musrfit-setup"></span><span id="index-0"></span><h1>Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms<a class="headerlink" href="#setting-up-musrfit-on-different-platforms" title="Permalink to this headline"></a></h1>
<div class="section" id="supported-operating-systems-and-software-requirements">
<span id="supported-operating-systems"></span><span id="index-1"></span><h2>Supported Operating Systems and Software Requirements<a class="headerlink" href="#supported-operating-systems-and-software-requirements" title="Permalink to this headline"></a></h2>
<p>This page is intended to demonstrate for the interested user which steps are necessary to set up the <a class="reference external" href="http://www.gnu.org/philosophy/free-sw.html">free software</a>
μSR data analysis framework <a class="reference internal" href="user-manual.html#user-manual"><em>musrfit</em></a>. While the preferred way is to run the software on <strong>GNU/Linux</strong> or <strong>MacOS X/macOS</strong>, with some restrictions
it can also be set up under <strong>MS Windows</strong> (cygwin, only for the <em>very brave</em>, probably it is easier for most MS Windows users to install a Virtual Machine running Linux).</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">In case musrfit should be installed according to the description found on this page, the user is strongly encouraged to <em>read completely</em> each section dealing with the
present installation step <em>before</em> starting the installation process!</p>
</div>
<p>Apart from <a class="reference external" href="http://gcc.gnu.org/">GCC, the GNU Compiler Collection</a> (<tt class="docutils literal"><span class="pre">gcc</span></tt>, <tt class="docutils literal"><span class="pre">g++</span></tt>), the GNU build tools <a class="reference external" href="http://www.gnu.org/software/autoconf/">autoconf</a>,
<a class="reference external" href="http://www.gnu.org/software/automake/">automake</a>, and <a class="reference external" href="http://www.gnu.org/software/libtool/">libtool</a> are needed, if you want to build musrfit via the automake toolchain.
The <tt class="docutils literal"><span class="pre">automake</span></tt> toolchain will eventually be droped in upcoming releases.
If you plan to use the cmake toolchain (preferred way), <a class="reference external" href="https://cmake.org/">cmake</a>. Furthermore the helper tool <a class="reference external" href="http://pkg-config.freedesktop.org/wiki/">pkg-config</a> is
needed and musrfit requires the installation of a few open-source libraries and programs including their header packages:</p>
<dl class="docutils" id="index-2">
<dt><strong>boost C++ libraries</strong></dt>
<dd>The powerful Spirit parser framework used by musrfit is included in that collection of libraries. <em>Required version ≥ 1.33</em> (see <a class="reference external" href="http://www.boost.org/">boost C++ libraries</a>).</dd>
</dl>
<dl class="docutils" id="index-3">
<dt><strong>GNU Scientific Library</strong></dt>
<dd>A numerical <tt class="docutils literal"><span class="pre">C</span></tt> and <tt class="docutils literal"><span class="pre">C++</span></tt> library which provides efficient implementations of various mathematical routines. <em>Required version ≥ 1.9</em> (see <a class="reference external" href="http://www.gnu.org/software/gsl/">GNU Scientific Library</a>).</dd>
</dl>
<dl class="docutils" id="index-4">
<dt><strong>FFTW</strong></dt>
<dd>A <tt class="docutils literal"><span class="pre">C</span></tt> implementation for the fast computation of discrete Fourier transforms. <em>Required version ≥ 3.1</em> (see <a class="reference external" href="http://www.fftw.org/">FFTW</a>).</dd>
</dl>
<dl class="docutils" id="index-5">
<dt><strong>ROOT</strong></dt>
<dd>A C++ data analysis framework developed at <a class="reference external" href="http://www.cern.ch/">CERN</a>. <em>Required version ≥ 5.22</em> (see <a class="reference external" href="http://root.cern.ch/">ROOT</a>).</dd>
</dl>
<dl class="docutils" id="index-6">
<dt><strong>libxml2</strong></dt>
<dd>The <tt class="docutils literal"><span class="pre">XML</span> <span class="pre">C</span></tt> parser and toolkit of <a class="reference external" href="http://www.gnome.org/">gnome</a>. <em>Required version ≥ 2.0</em> (see <a class="reference external" href="http://xmlsoft.org/">libxml2</a>).</dd>
</dl>
<p>Additionally, <em>only</em> if <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support reading of data files in the <cite>NeXus</cite> format the following libraries are needed:</p>
<dl class="docutils" id="index-7">
<dt><strong>HDF4</strong></dt>
<dd>A library and multi-object file format for storing and managing data (see <a class="reference external" href="http://www.hdfgroup.org/products/hdf4/">HDF4</a>). <tt class="docutils literal"><span class="pre">HDF4</span></tt> is &#8220;outdated&#8221; and its support will soon be dropped.</dd>
</dl>
<dl class="docutils" id="index-8">
<dt><strong>HDF5</strong></dt>
<dd>A data model, library, and file format for storing and managing data (see <a class="reference external" href="https://portal.hdfgroup.org/display/support">HDF5</a>).</dd>
</dl>
<dl class="docutils" id="index-9">
<dt><strong>minixml</strong></dt>
<dd>A small <tt class="docutils literal"><span class="pre">XML</span></tt> library that can be used to read and write <tt class="docutils literal"><span class="pre">XML</span></tt> and <tt class="docutils literal"><span class="pre">XML</span></tt>-like data files. <em>Required version ≥ 2.2</em> (see <a class="reference external" href="http://www.minixml.org/">minixml</a>).</dd>
</dl>
<dl class="docutils" id="index-10">
<dt><strong>NeXus</strong></dt>
<dd>A common data format for neutron, x-ray, and muon science. <em>Required version ≥ 4.4</em> (see <a class="reference external" href="http://www.nexusformat.org/">NeXus</a>).</dd>
</dl>
<p>If <em>optionally</em> the editor and graphical user interface <tt class="docutils literal"><span class="pre">musrgui</span></tt> / <tt class="docutils literal"><span class="pre">musredit</span></tt> is going to be installed there is one further requirement:</p>
<dl class="docutils" id="index-11">
<dt><strong>Qt</strong></dt>
<dd>A cross-platform application and user interface framework. <em>Required version ≥ 4.6</em> (musredit) (see <a class="reference external" href="http://qt.io/">Qt</a>).</dd>
</dl>
<p>Each of the following sections focusing on the installation of <tt class="docutils literal"><span class="pre">musrfit</span></tt> on the different operating systems will also give a brief introduction on the installation of the requirements before the actual musrfit installation is described.</p>
</div>
<div class="section" id="os-restrictions">
<span id="index-12"></span><h2>OS Restrictions<a class="headerlink" href="#os-restrictions" title="Permalink to this headline"></a></h2>
<p>Before the installation procedure will be described, please note the following restrictions:</p>
<dl class="docutils">
<dt><strong>GNU/Linux</strong></dt>
<dd>No serious problems are currently known. Tested distributions: <a class="reference external" href="https://www.redhat.com/de/technologies/linux-platforms/enterprise-linux">RHEL</a>, <a class="reference external" href="https://getfedora.org/">Fedora</a>,
<a class="reference external" href="https://www.debian.org/">Debian</a>, <a class="reference external" href="https://www.ubuntu.com/">Ubuntu</a>, <a class="reference external" href="https://linuxmint.com/">Mint</a>, <a class="reference external" href="https://en.opensuse.org/Main_Page">openSUSE</a>.</dd>
<dt><strong>Mac OS X/macOS</strong></dt>
<dd>No serious problems are currently known for macOS ≥ 10.6.</dd>
<dt><strong>MS Windows</strong></dt>
<dd><p class="first">Native <em>MS Windows</em> support is currently not available. Potential ways to get <tt class="docutils literal"><span class="pre">musrfit</span></tt> running are:</p>
<ul class="last simple">
<li>via installation of Linux via the Microsoft App store for Windows 10.</li>
<li>via installation of the virtual machine on which you install Linux.</li>
<li>via <a class="reference external" href="https://www.cygwin.com/">cygwin</a>.</li>
</ul>
</dd>
</dl>
</div>
<div class="section" id="gnu-linux">
<span id="index-13"></span><span id="id1"></span><h2>GNU/Linux<a class="headerlink" href="#gnu-linux" title="Permalink to this headline"></a></h2>
<div class="section" id="requirements">
<span id="gnu-linux-requirements"></span><span id="index-14"></span><h3>Requirements<a class="headerlink" href="#requirements" title="Permalink to this headline"></a></h3>
<div class="section" id="everything-but-root-and-nexus">
<h4>Everything but ROOT and NeXus<a class="headerlink" href="#everything-but-root-and-nexus" title="Permalink to this headline"></a></h4>
<p>Depending on the GNU/Linux distribution chosen, the above mentioned software &#8211; except <tt class="docutils literal"><span class="pre">ROOT/CERN</span></tt> and <tt class="docutils literal"><span class="pre">NeXus</span></tt> &#8211; should be available from
the distributor and could be easily installed in the form of binary packages. If done in this way there should be taken care of installing <em>both</em>,
the libraries and the header (dev, devel) files.</p>
<p>On a <a class="reference external" href="https://www.redhat.com/en">Red Hat Linux</a> (or other RPM-package base Linux distributions) system the following command executed as <em>superuser</em>
from the shell will do the trick (never type the &#8216;$&#8217; it is the shell prompt of your system):</p>
<p>For <strong>Qt4</strong>:</p>
<blockquote>
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ yum install git cmake boost-devel gsl-devel fftw-devel libxml2-devel qt-devel qtwebkit-devel
</pre></div>
</div>
</div></blockquote>
<p>For <strong>Qt5</strong>:</p>
<blockquote>
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ yum install epel-release
$ yum install git cmake boost-devel gsl-devel fftw-devel libxml2-devel qt5-qtbase-devel qt5-qtsvg-devel qt5-qtwebkit-devel
</pre></div>
</div>
</div></blockquote>
<p>Depending on your distribution <strong>Qt4</strong> is still the default but is likely to be replaced by <strong>Qt5</strong> in the very near future.</p>
<p>When dealing with a distribution that uses the dpkg/apt package manager like <a class="reference external" href="https://www.debian.org/">Debian</a> or <a class="reference external" href="https://www.ubuntu.com/">Ubuntu</a>
the installation would look like:</p>
<p>For <strong>Qt4</strong>:</p>
<blockquote>
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ apt-get install git cmake libboost-dev libgsl-dev libfftw3-dev libxml2-dev libqt4-dev libqtwebkit-dev
</pre></div>
</div>
</div></blockquote>
<p>For <strong>Qt5</strong>:</p>
<blockquote>
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ apt-get install git cmake libboost-dev libgsl-dev libfftw3-dev libxml2-dev qt5-default qtbase5-dev libqt5svg5-dev libqt5webkit5-dev
</pre></div>
</div>
</div></blockquote>
<p>Everyone should know best himself which is the way to install distribution software on the chosen distribution.</p>
<p>In case the distribution does not include the required software it has to be compiled from the source files. This means either to download
the source code from the corresponding website, or to clone the git repo. If you need to follow this line, please check the install details of the corresponding package.</p>
<p>For any further information on the standard installation of software, please refer to the web search engine of choice and ask for &#8220;install software on linux&#8221;...</p>
</div>
<div class="section" id="installation-of-nexus-requirements-optional">
<span id="index-15"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#installation-of-nexus-requirements-optional" title="Permalink to this headline"></a></h4>
<p><em>Only</em> if <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support reading/writing data files in the <tt class="docutils literal"><span class="pre">NeXus</span></tt> format the further required
software has to be set up. The required libraries and header files could either be available through the user&#8217;s
GNU/Linux distribution or if this is not the case, the packages can be installed from the source code. <em>E.g.</em> on
Red Hat-like systems binary packages for <tt class="docutils literal"><span class="pre">MXML</span></tt>, <tt class="docutils literal"><span class="pre">HDF4</span></tt>, and <tt class="docutils literal"><span class="pre">HDF5</span></tt> might be called <tt class="docutils literal"><span class="pre">mxml</span></tt>, <tt class="docutils literal"><span class="pre">mxml-devel</span></tt>,
<tt class="docutils literal"><span class="pre">hdf</span></tt>, <tt class="docutils literal"><span class="pre">hdf-devel</span></tt>, <tt class="docutils literal"><span class="pre">hdf5</span></tt>, <tt class="docutils literal"><span class="pre">hdf5-devel</span></tt>, on Debian-like systems <tt class="docutils literal"><span class="pre">libmxml1</span></tt>, <tt class="docutils literal"><span class="pre">libmxml-dev</span></tt>, <tt class="docutils literal"><span class="pre">libhdf4-dev</span></tt>, <tt class="docutils literal"><span class="pre">libhdf5-dev</span></tt>.</p>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last"><tt class="docutils literal"><span class="pre">HDF4</span></tt> support within <tt class="docutils literal"><span class="pre">NeXus</span></tt> will be dropped by <tt class="docutils literal"><span class="pre">musrfit</span></tt> in the near future. If you <em>not</em> urgently need
to read old <tt class="docutils literal"><span class="pre">ISIS</span> <span class="pre">NeXus</span></tt> files, you safely can drop it.</p>
</div>
<p><strong>Only NeXus Version ≥ 4.4 is support!</strong></p>
<p>Even though there might exist binary packages for the <tt class="docutils literal"><span class="pre">NeXus</span></tt> library, it is best to build and
install it directly from the source code which can be found <a class="reference external" href="https://github.com/nexusformat/code">here</a>.</p>
<p>A brief instruction how to get <tt class="docutils literal"><span class="pre">NeXus</span></tt> compiled from source (lines starting with &#8216;#&#8217; are comments <em>only</em>):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> Downloads
$ <span class="c1"># create a directory for the NeXus source code</span>
$ mkdir nexus
$ <span class="nb">cd</span> nexus
$ <span class="c1"># get the source code from the master repository</span>
$ git clone https://github.com/nexusformat/code.git
$ <span class="c1"># next we will build NeXus out-of-source</span>
$ mkdir build
$ <span class="nb">cd</span> build
$ <span class="c1"># The next line only if HDF4 support is needed</span>
$ cmake -DENABLE_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_HDF4<span class="o">=</span><span class="m">1</span> -DENABLE_MXML<span class="o">=</span><span class="m">1</span> ../code
$ <span class="c1"># The next line if HDF4 support is NOT needed</span>
$ cmake -DENABLE_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_MXML<span class="o">=</span><span class="m">1</span> ../code
$ cmake --build ./ --clean-first
$ <span class="c1"># make install needs either to be carried out as root or sudo depending on your linux flavour.</span>
$ sudo make install
</pre></div>
</div>
</div>
<div class="section" id="index-16">
<span id="id4"></span><h4>ROOT<a class="headerlink" href="#index-16" title="Permalink to this headline"></a></h4>
<p>ROOT 5.34/xx is supported as legacy version <em>only</em>! <strong>The default now will be ROOT 6.xx/yy!</strong></p>
<p>The ROOT framework may or may not be part of the GNU/Linux distribution. Some distributions are packing ROOT in a
manner incompatible with the way it is needed for <tt class="docutils literal"><span class="pre">musrfit</span></tt>, though the situation is improving. If you are
experienced enough you can try the packed ROOT version. Often ROOT is split in many sub-packages. Install the
necessary ones (guess from the description below). <strong>One Warning:</strong> if the ROOT packages are upgraded after a
yum update (apt-get update; apt-get upgrade) you might need to recompile <tt class="docutils literal"><span class="pre">musrfit</span></tt>. <em>If you are not sure about
all this: install ROOT from source</em>. Before installing ROOT from source you will need to install some additional header packages.</p>
<p>For RPM based systems (RedHat, Fedora, <em>etc</em>) this will likely to be <tt class="docutils literal"><span class="pre">libX11-devel</span></tt>, <tt class="docutils literal"><span class="pre">libXft-devel</span></tt>, <tt class="docutils literal"><span class="pre">libXpm-devel</span></tt>, and <tt class="docutils literal"><span class="pre">libXext-devel</span></tt>:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ yum install libX11-devel libXft-devel libXpm-devel libXext-devel
</pre></div>
</div>
<p>For a dpkg/apt based system (Debian, Ubuntu, <em>etc</em>) this will likely to be <tt class="docutils literal"><span class="pre">libx11-dev</span></tt>, <tt class="docutils literal"><span class="pre">libxft-dev</span></tt>, <tt class="docutils literal"><span class="pre">libxpm-dev</span></tt>, and <tt class="docutils literal"><span class="pre">libxext-dev</span></tt>:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ apt-get install libx11-dev libxft-dev libxpm-dev libxext-dev
</pre></div>
</div>
<p>Also make sure that you have installed all required packages listed under <a class="reference internal" href="#gnu-linux-requirements"><em>Required Software</em></a> (<em>e.g.</em> fftw, gsl, <em>etc</em>).</p>
<p>In the following it is assumed that <tt class="docutils literal"><span class="pre">ROOT</span></tt> shall be installed under <tt class="docutils literal"><span class="pre">$HOME/Apps</span></tt>. If you want to install
it somewhere else, just systematically replace the related terms of the following description. For the
following list of commands the &#8216;$&#8217; will be given, the command prompt. Do not enter it! Also some comments will
be added starting with a &#8216;#&#8217; which can be omitted. They are only there to explain what is going on.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>
$ <span class="c1"># creat the Apps directory if not already present</span>
$ mkdir Apps
$ <span class="nb">cd</span> Apps
$ git clone http://root.cern.ch/git/root.git
$ <span class="nb">cd</span> root
$ git tag -l
$ <span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-14-00</span>
$ <span class="c1"># or the latest official release number</span>
$ git checkout -b v6-14-00 v6-14-00
$ <span class="c1"># now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.</span>
$ <span class="c1"># since we are using cmake build now, first we will need to create the build directory.</span>
$ mkdir root_build
$ <span class="nb">cd</span> root_build
$ cmake ../ -Dgminimal<span class="o">=</span>ON -Dasimage<span class="o">=</span>ON -Dmathmore<span class="o">=</span>On -Dminuit2<span class="o">=</span>ON -Dxml<span class="o">=</span>ON -DCMAKE_INSTALL_PREFIX<span class="o">=</span>../root_exec
$ <span class="c1"># next will be the make called via cmake. If running on a multicore CPU you can speed up tremendously by</span>
$ <span class="c1"># calling it with the option -j &lt;number&gt;, where &lt;number&gt; is the number of threads which you want to give,</span>
$ <span class="c1"># e.g. cmake --build ./ --clean-first -- -j8</span>
$ cmake --build ./ --clean-first
$ <span class="c1"># as a last step of the ROOT build process we need to install it</span>
$ make install
</pre></div>
</div>
<p>What is still missing is that the system should be told where to find the <tt class="docutils literal"><span class="pre">ROOT</span></tt> installation, therefore the following is suggested:</p>
<ul>
<li><p class="first">As superuser create a file <tt class="docutils literal"><span class="pre">/etc/ld.so.conf.d/cern-root.conf</span></tt> where the path to the lib directory of <tt class="docutils literal"><span class="pre">ROOT</span></tt> is
added and call <tt class="docutils literal"><span class="pre">/sbin/ldconfig</span></tt> afterwards. In the example mentioned above one way of doing this is
(<tt class="docutils literal"><span class="pre">&lt;home&gt;</span></tt> has to be the path to your home, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/home/luke_skywalker</span></tt>):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">echo</span> <span class="s2">&quot;&lt;home&gt;/Apps/root/root_exec/lib&quot;</span> &gt;&gt; /etc/ld.so.conf.d/cern-root.conf
$ /sbin/ldconfig
</pre></div>
</div>
</li>
<li><p class="first">Additionally, as normal user one should append the following lines to the <tt class="docutils literal"><span class="pre">~/.bashrc</span></tt> and/or <tt class="docutils literal"><span class="pre">~/.bash_profile</span></tt>
(<tt class="docutils literal"><span class="pre">~./profile</span></tt> on Debian like systems, and then either restart the shell or call the same commands once more from
the shell) in order to change some path-setting environment variables:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">export</span> <span class="nv">ROOTSYS</span><span class="o">=</span><span class="nv">$HOME</span>/Apps/root/root_exec
$ <span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin:<span class="nv">$PATH</span>
</pre></div>
</div>
</li>
</ul>
<p>If an update of ROOT is needed, simple do the following:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/root
$ git pull
$ <span class="nb">cd</span> root_build
$ cmake --build ./ --clean-first
</pre></div>
</div>
</div>
</div>
<div class="section" id="musrfit">
<span id="index-17"></span><h3>musrfit<a class="headerlink" href="#musrfit" title="Permalink to this headline"></a></h3>
<p>When all required software has been set up with the <tt class="docutils literal"><span class="pre">musrfit</span></tt> installation can be proceeded. First, the most
recent source code should be downloaded. The preferred way of doing so is to clone the <tt class="docutils literal"><span class="pre">musrfit</span></tt> repository via git.
Assuming the code should be located in <tt class="docutils literal"><span class="pre">$HOME/Apps</span></tt> this is achieved most easily calling from the terminal</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps
$ git clone https://bitbucket.org/muonspin/musrfit.git
$ <span class="c1"># Only if legacy ROOT 5.xx.yy is used include the next line</span>
$ <span class="nb">cd</span> musrfit<span class="p">;</span> git checkout root5
</pre></div>
</div>
<p>or</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps
$ git clone git://gitlab.psi.ch/nemu/musrfit.git
$ <span class="c1"># Only if legacy ROOT 5.xx.yy is used include the next line</span>
$ <span class="nb">cd</span> musrfit<span class="p">;</span> git checkout root5
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">after cloning the <tt class="docutils literal"><span class="pre">musrfit</span></tt> repo you will automatically be on the
<tt class="docutils literal"><span class="pre">root6</span></tt> branch. If you want to get legacy ROOT 5.34.xx support, you
will needed to switch branches first.</p>
</div>
<p><strong>Update:</strong> If a local repository clone is already present (it needs to be newer than Dec. 2016), one can update it using:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit
$ git pull
</pre></div>
</div>
<p>Now, depending whether you follow the <tt class="docutils literal"><span class="pre">automake</span></tt> or <tt class="docutils literal"><span class="pre">cmake</span></tt> tool chain you do</p>
<p><strong>automake toolchain:</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ make uninstall
$ make clean
$ make
$ make install
</pre></div>
</div>
<p>or</p>
<p><strong>cmake toolchain:</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> build
$ xargs rm &lt; install_manifest.txt
$ cmake --build ./ --clean-first
$ make install
</pre></div>
</div>
<p>As an alternative (if git is not available), the source code can also be downloaded from the following web-page: <a class="reference external" href="https://bitbucket.org/muonspin/musrfit/downloads">musrfit at bitbucket</a></p>
<div class="section" id="musrfit-build-with-automake">
<span id="index-18"></span><h4>musrfit build with automake<a class="headerlink" href="#musrfit-build-with-automake" title="Permalink to this headline"></a></h4>
<p>After the source-code extraction the <tt class="docutils literal"><span class="pre">autogen.sh</span></tt> script is called to prepare the build environment.
If it has been executed successfully the <tt class="docutils literal"><span class="pre">configure</span></tt> script should be ready to collect all the information needed
to create the Makefiles. If <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support <tt class="docutils literal"><span class="pre">NeXus</span></tt> data files this has to be enabled by specifying the
<tt class="docutils literal"><span class="pre">--enable-NeXus</span></tt> switch when calling configure. For an overview of all available options just call <tt class="docutils literal"><span class="pre">./configure</span> <span class="pre">--help</span></tt>.
Besides the standard options there are a few special options which should be mentioned here:</p>
<dl class="docutils">
<dt><strong>- -prefix</strong></dt>
<dd>Specify the installation prefix, <em>e.g.</em> <tt class="docutils literal"><span class="pre">$ROOTSYS</span></tt> if already defined (by default: <tt class="docutils literal"><span class="pre">/usr/local</span></tt>).</dd>
<dt><strong>- -with-rootsys</strong></dt>
<dd>Specify the top of the <tt class="docutils literal"><span class="pre">ROOT</span></tt> installation directory, <em>e.g.</em> <tt class="docutils literal"><span class="pre">$ROOTSYS</span></tt> if already defined.</dd>
<dt><strong>- -with-fftw3</strong></dt>
<dd>Specify the prefix of the <tt class="docutils literal"><span class="pre">FFTW3</span></tt> installation. <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> or <tt class="docutils literal"><span class="pre">/usr</span></tt>.</dd>
<dt><strong>- -with-gsl</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">GSL</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> or <tt class="docutils literal"><span class="pre">/usr</span></tt>.</dd>
<dt><strong>- -with-boostinc</strong></dt>
<dd>Set the path to the header files of the <tt class="docutils literal"><span class="pre">Boost</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local/include</span></tt> or <tt class="docutils literal"><span class="pre">/usr/include</span></tt>.</dd>
<dt><strong>- -with-hdf4</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">HDF4</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> (only useful in conjunction with the <tt class="docutils literal"><span class="pre">NeXus</span></tt> support).</dd>
<dt><strong>- -with-hdf5</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">HDF5</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr</span></tt> (only useful in conjunction with the <tt class="docutils literal"><span class="pre">NeXus</span></tt> support).</dd>
<dt><strong>- -with-nexus</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">NeXus</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> (only useful in conjunction with the <tt class="docutils literal"><span class="pre">NeXus</span></tt> support).</dd>
<dt><strong>- -with-qt3</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">Qt3</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/lib/qt-3.3</span></tt> (only useful in conjunction with building <tt class="docutils literal"><span class="pre">musrgui</span></tt>).</dd>
<dt><strong>- -with-qt4</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">Qt4</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/lib/qt47</span></tt> (only useful in conjunction with building <tt class="docutils literal"><span class="pre">musredit</span></tt>).</dd>
<dt><strong>- -with-qt5</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">Qt5</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/lib64</span></tt> (only useful in conjunction with building <tt class="docutils literal"><span class="pre">musredit</span></tt>).</dd>
<dt><strong>- -enable-NeXus</strong></dt>
<dd>Enable the support of <tt class="docutils literal"><span class="pre">NeXus</span></tt> data files (requires the <tt class="docutils literal"><span class="pre">HDF4</span></tt>, <tt class="docutils literal"><span class="pre">HDF5</span></tt> and <tt class="docutils literal"><span class="pre">NeXus</span></tt> libraries to be installed).</dd>
<dt><strong>- -disable-editor</strong></dt>
<dd>Disable the integrated building of <tt class="docutils literal"><span class="pre">musredit</span></tt>/<tt class="docutils literal"><span class="pre">musrgui</span></tt>.</dd>
<dt><strong>- -disable-omp</strong></dt>
<dd>Switches off the <a class="reference external" href="http://en.wikipedia.org/wiki/OpenMP">OpenMP</a> features of <tt class="docutils literal"><span class="pre">musrfit</span></tt> (parallelization of the <span class="math">\(\chi^2\)</span> calculation when compiled with GCC ≥ 4.2).</dd>
</dl>
<p>Normally it should not be necessary to make use of any of the options except for specifying the installation path with <tt class="docutils literal"><span class="pre">--prefix</span></tt>. The
other paths should be detected automatically. If this does not work for some reason the configure script will terminate and ask for the
information. When the configure script has been called successfully everything is ready for building the <tt class="docutils literal"><span class="pre">musrfit</span></tt> libraries and executables.
A standard installation sequence (without <tt class="docutils literal"><span class="pre">NeXus</span></tt> support) might then look like (In case the normal user has no write permissions to the
<tt class="docutils literal"><span class="pre">$ROOTSYS</span></tt> and the installation path the &#8220;make install&#8221; commands have to be executed as superuser.):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit
$ sh autogen.sh
$ ./configure --prefix<span class="o">=</span><span class="nv">$ROOTSYS</span>
$ make
$ make install
$ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div>
</div>
</div>
<div class="section" id="musrfit-build-with-cmake">
<span id="index-19"></span><h4>musrfit build with cmake<a class="headerlink" href="#musrfit-build-with-cmake" title="Permalink to this headline"></a></h4>
<p>Currently the following configuration switches for <tt class="docutils literal"><span class="pre">musrfit</span></tt> are available:</p>
<dl class="docutils">
<dt><strong>-DCMAKE_INSTALL_PREFIX=&lt;prefix-path&gt;</strong></dt>
<dd>Specify the installation prefix, <em>i.e.</em> the place where <tt class="docutils literal"><span class="pre">musrfit</span></tt> shall be installed, <em>e.g.</em> <tt class="docutils literal"><span class="pre">$ROOTSYS</span></tt> if already defined (by default: <tt class="docutils literal"><span class="pre">/usr/local</span></tt>).</dd>
<dt><strong>-Dnexus=&lt;value&gt;</strong></dt>
<dd>enable/disable the support of <tt class="docutils literal"><span class="pre">NeXus</span></tt> data files (requires the <tt class="docutils literal"><span class="pre">HDF4</span></tt>, <tt class="docutils literal"><span class="pre">HDF5</span></tt> and <tt class="docutils literal"><span class="pre">NeXus</span></tt> libraries to be installed).
&lt;value&gt;=1 enables <tt class="docutils literal"><span class="pre">NeXus</span></tt>, &lt;value&gt;=0 disables <tt class="docutils literal"><span class="pre">NeXus</span></tt>. The default setting, <em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">NeXus</span></tt> support is disabled.</dd>
<dt><strong>-DASlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>. The default setting, <em>i.e.</em> the
switch is not provided is <tt class="docutils literal"><span class="pre">ASlibs</span></tt> support is disabled. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><em>user libs</em></a>.</dd>
<dt><strong>-DBMWlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>. The default setting, <em>i.e.</em> the
switch is not provided is <tt class="docutils literal"><span class="pre">BMWlibs</span></tt> support is disabled. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><em>user libs</em></a>.</dd>
<dt><strong>-DBNMRlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>. The default setting,
<em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt> support is disabled.</dd>
<dt><strong>-Dqt_based_tools=&lt;value&gt;</strong></dt>
<dd>Will try to get <tt class="docutils literal"><span class="pre">musredit</span></tt>, <tt class="docutils literal"><span class="pre">musrWiz</span></tt>, <tt class="docutils literal"><span class="pre">musrStep</span></tt>, and <tt class="docutils literal"><span class="pre">mupp</span></tt> installed, if <tt class="docutils literal"><span class="pre">Qt</span></tt> is found.
By default this is enabled. Again &lt;value&gt;=0 means disabled, &lt;value&gt;=1 enabled.</dd>
<dt><strong>-Dqt_version=&lt;value&gt;</strong></dt>
<dd>Allows to specify which <tt class="docutils literal"><span class="pre">Qt</span></tt> version shall be tried. &lt;value&gt; can take the values: <tt class="docutils literal"><span class="pre">AUTO,</span> <span class="pre">3,</span> <span class="pre">4,</span> <span class="pre">5</span></tt>.
If the value is set to <tt class="docutils literal"><span class="pre">AUTO</span></tt>, this highest installed version is chosen, otherwise the specified version is used.</dd>
<dt><strong>-Dtry_OpenMP=&lt;value&gt;</strong></dt>
<dd>Will check if <tt class="docutils literal"><span class="pre">OpenMP</span></tt> support is possible, and if yes use it. The default is enabled</dd>
</dl>
<p>Normally it should not be necessary to make use of any of the options except for specifying the installation path with <tt class="docutils literal"><span class="pre">-DCMAKE_INSTALL_PREFIX</span></tt>.
<tt class="docutils literal"><span class="pre">musrfit</span></tt> build with <tt class="docutils literal"><span class="pre">cmake</span></tt> takes the <tt class="docutils literal"><span class="pre">out-of-source</span></tt> approach. Therefore a typical configuration / make / install process including
<tt class="docutils literal"><span class="pre">NeXus</span></tt> support would look like</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit
$ mkdir build
$ <span class="nb">cd</span> build
$ cmake ../ -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$ROOTSYS</span> -Dnexus<span class="o">=</span><span class="m">1</span>
<span class="c1"># below it is assumed that multiple cores are present, hence the -j8 option</span>
$ cmake --build ./ --clean-first -- -j8
$ make install
$ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div>
</div>
</div>
<div class="section" id="musrfit-last-step-of-the-installation">
<span id="index-20"></span><h4>musrfit last step of the installation<a class="headerlink" href="#musrfit-last-step-of-the-installation" title="Permalink to this headline"></a></h4>
<p>In order to finish the installation of musrfit two more things should be done:</p>
<blockquote>
<div><ul>
<li><p class="first">Define the <em>MUSRFITPATH</em> environment variable containing the path to the <tt class="docutils literal"><span class="pre">musrfit</span></tt> executables and <tt class="docutils literal"><span class="pre">XML</span></tt> files.
<em>E.g.</em> if the location of the example above is used append the following line to the <tt class="docutils literal"><span class="pre">~/.bashrc</span></tt> and
<tt class="docutils literal"><span class="pre">~/.bash_profile</span></tt> (and then either restart the shell, source the file, or call the same commands once more from the shell):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
</pre></div>
</div>
</li>
<li><p class="first">Adjust the paths where <tt class="docutils literal"><span class="pre">musrfit</span></tt> will search for data files in the installed <tt class="docutils literal"><span class="pre">musrfit_startup.xml</span></tt>. For
detailed information on this XML file refer to the <a class="reference internal" href="user-manual.html#musrfit-startup"><em>manual</em></a>.</p>
</li>
</ul>
</div></blockquote>
</div>
</div>
<div class="section" id="musredit">
<span id="index-21"></span><h3>musredit<a class="headerlink" href="#musredit" title="Permalink to this headline"></a></h3>
<p>In the latest version of <tt class="docutils literal"><span class="pre">musrfit</span></tt> the configure script tries to determine automatically the highest available <tt class="docutils literal"><span class="pre">Qt</span></tt> version.
In case this is found, the editor <tt class="docutils literal"><span class="pre">musredit</span></tt> is built already together with <tt class="docutils literal"><span class="pre">musrfit</span></tt>. If not, one can try to call
the configure script with the <strong>- -with-qt5</strong> option (<tt class="docutils literal"><span class="pre">automake</span></tt>). <tt class="docutils literal"><span class="pre">cmake</span></tt> will determine everthing automatically.
To install this editor separately, <em>i.e.</em> by &#8220;hand&#8221; do</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit/src/musredit_qt5
$ <span class="c1"># for some distributions you will need qmake-qt5 for the next command</span>
$ qmake musredit.pro
</pre></div>
</div>
<p>If everything went fine, <tt class="docutils literal"><span class="pre">musredit</span></tt> can be compiled and installed:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ make
$ make install
</pre></div>
</div>
<p>In case one does not like the executable <tt class="docutils literal"><span class="pre">musredit</span></tt> to be copied to the default installation directory <tt class="docutils literal"><span class="pre">$ROOTSYS/bin</span></tt>
the last <em>make install</em> can be skipped and the executable can be copied somewhere else instead.</p>
</div>
<div class="section" id="musrgui-obsolate">
<h3>musrgui (obsolate)<a class="headerlink" href="#musrgui-obsolate" title="Permalink to this headline"></a></h3>
<p>If <tt class="docutils literal"><span class="pre">Qt4.6</span></tt> or higher is not available but <tt class="docutils literal"><span class="pre">Qt3</span></tt> is set up <tt class="docutils literal"><span class="pre">musrgui</span></tt> can be installed. For this please
follow the instructions for the <tt class="docutils literal"><span class="pre">musredit</span></tt> installation where simply every <tt class="docutils literal"><span class="pre">musredit</span></tt> occurrence has to
be replaced by <tt class="docutils literal"><span class="pre">musrgui</span></tt>. If there are problems during the <tt class="docutils literal"><span class="pre">qmake</span></tt> step, <em>e.g.</em>
&#8220;uic: File generated with too old version of Qt Designer&#8221;, this most probably means the <tt class="docutils literal"><span class="pre">Qt4</span></tt> version of <tt class="docutils literal"><span class="pre">qmake</span></tt>
is being used. In order to use the <tt class="docutils literal"><span class="pre">Qt3</span></tt> version it should be enough to specify the full path to its location
when calling it. Within the most GNU/Linux distributions this location will be something like <tt class="docutils literal"><span class="pre">/usr/lib/qt-3.3/bin/qmake</span></tt>.</p>
</div>
<div class="section" id="check-the-installation">
<h3>Check the installation<a class="headerlink" href="#check-the-installation" title="Permalink to this headline"></a></h3>
<p>In order to perform a quick test for finding out if the installation has been completed successfully, a few msr files
together with the corresponding data files can be found in the <tt class="docutils literal"><span class="pre">musrfit</span></tt> source tree at <tt class="docutils literal"><span class="pre">doc/examples/</span></tt>.
If <tt class="docutils literal"><span class="pre">musrgui</span></tt> has been installed, just open one of the <tt class="docutils literal"><span class="pre">test-*.msr</span></tt> files in the editor and test the <tt class="docutils literal"><span class="pre">musrfit</span></tt>
functionalities. Otherwise, if only the terminal should be used, as an initial test for instance the following could be done:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit/doc/examples
$ musrview test-histo-ROOT-NPP.msr
</pre></div>
</div>
</div>
</div>
<div class="section" id="ms-windows">
<h2>MS Windows<a class="headerlink" href="#ms-windows" title="Permalink to this headline"></a></h2>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The description here is only for the very brave ones. It hasn&#8217;t been tested for quite a while and therefore gives you
rather a flavour of what needs to be done rather than a real instruction how to setup <tt class="docutils literal"><span class="pre">musrfit</span></tt>. If you just need
<tt class="docutils literal"><span class="pre">musrfit</span></tt> to work on a MS Windows platform, it is recommended to install it via a linux virtual machine!</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For adventurous guys using Windows 10, there is the possibility to activate the built in Ubuntu bash-shell. It allows
to install <tt class="docutils literal"><span class="pre">musrfit</span></tt> as described in the Linux section.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">One more advice: Please never try to install either <tt class="docutils literal"><span class="pre">ROOT</span></tt> or <tt class="docutils literal"><span class="pre">musrfit</span></tt> from or to a directory containing spaces
in the absolute path or in case you do, do not wonder if some errors occur! msr files, however, might be saved in such
directories like <tt class="docutils literal"><span class="pre">...\My</span> <span class="pre">Documents\...</span></tt></p>
</div>
<p>Under Windows a native installation is not supported but there is the possibility to run musrfit through <a class="reference external" href="https://www.cygwin.com/">cygwin</a>
which has the great advantage that one gains additionally various nice UNIX tools also for other purposes.
Please also be aware of the fact that the X server which is going to be installed with <tt class="docutils literal"><span class="pre">Cygwin</span></tt> has to be started
(<em>e.g.</em> by selecting it from the &#8220;Programs&#8221; folder) before any graphical application (<tt class="docutils literal"><span class="pre">musrview</span></tt>, <tt class="docutils literal"><span class="pre">musrgui</span></tt>, etc.) is started.</p>
<div class="section" id="id5">
<h3>Requirements<a class="headerlink" href="#id5" title="Permalink to this headline"></a></h3>
<div class="section" id="setting-up-cygwin">
<span id="index-22"></span><h4>Setting up Cygwin<a class="headerlink" href="#setting-up-cygwin" title="Permalink to this headline"></a></h4>
<p>For the start go to the Cygwin website, download the setup file and use it to install Cygwin 1.7 or newer. During the installation
process you will be asked where you want to install Cygwin and normally the default choice should just be fine. At some point you
will be asked which packages should be installed. Make sure that you choose at least the following (or packages with revisions close
to the following) in order to fulfill the <tt class="docutils literal"><span class="pre">musrfit</span></tt> requirements and be able to work with this base system:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>a2ps, alternatives, autoconf, automake, base-cygwin, base-files, base-passwd bash, bash-completion,
bc, binutils, bison, boost, boost-devel, bzip2, cmake, colorgcc, coreutils, curl, cygutils, cygwin,
editrights, fftw3, findutils, flex, font-adobe-dpi100, font-adobe-dpi75, font-alias,
font-bitstream-dpi100, font-bitstream-dpi75, font-encodings, font-ibm-type1, font-sun-misc, font-util,
font-xfree86-type1, fontconfig, freeglut, gawk, gcc-tools-autoconf, gcc-tools-automake, gcc4,
gcc4-core, gcc4-fortran, gcc4-g++, gccmakedep, gd, gettext, ghostscript, ghostscript-fonts-std,
giflib, gmp, grep, groff, gsl, gsl-apps, gsl-devel, gv, gzip, inputproto, jasper, jpeg, lapack,
less, libboost, libbz2_1, libcharset1, libcurl4, libfftw3-devel, libfftw3_3, libgcc1, libgd-devel,
libgif-devel, libGL-devel, libGL1, libGLU-devel, libGLU1, libglut-devel, libglut3, libgmp-devel,
libgmp3, libgomp1, libICE-devel, libICE6, libjpeg-devel, libjpeg62, liblapack-devel, libmpfr-devel,
libmpfr1, libncurses-devel, libncurses9, libOSMesa-devel, libOSMesa7, libpng, libpng14, libpng14-devel,
libreadline6, libSM-devel, libSM6, libssh2_1, libstdc++6, libstdc++6-devel, libtiff-devel, libtiff5,
libtool, libX11-devel, libX11_6, libXau-devel, libXau6, libXaw7, libxcb-devel, libxcb-xlib-devel,
libXcursor-devel, libXcursor1, libXdmcp-devel, libXdmcp6, libXext-devel, libXext6, libXfixes-devel,
libXfixes3, libXfont-devel, libXfont1, libXft-devel, libXft2, libXi-devel, libXi6, libxkbfile1,
libxml2, libxml2-devel, libXmu-devel, libXmu6, libXpm-devel, libXpm4, libXrender-devel, libXrender1,
libXt-devel, libXt6, login, m4, make, makedepend, man, mpfr, nano, opengl, openssh, openssl, pdftk,
perl, ping, pkg-config, psutils, python, qt3, qt3-bin, qt3-devel, readline, rebase, rgb, rsync, run,
screen, sed, subversion, tar, tcltk, terminfo, unzip, util-linux, vim, w32api, which,
X-start-menu-icons, xauth, xextproto, xfontsel, xinit, xkbcomp, xkeyboard-config, xkill, xlogo,
xlsfonts, xorg-cf-files, xorg-scripts, xorg-server, xproto, xrdb, xrefresh, xset, xterm, zip, zlib,
zlib-devel, zlib0, libQt3Support4-devel, libQtAssistantClient4-devel, libQtCore4-devel,
libQtDBus4-devel, libQtDesigner4-devel, libQtGui4-devel, libQtHelp4-devel, libQtNetwork4-devel,
libQtOpenGL4-devel, libQtScript4-devel, libQtScriptTools4-devel, libQtSql4-devel, libQtSvg4-devel,
libQtTest4-devel, libQtWebKit4-devel, libQtXml4-devel, libQtXmlPatterns4-devel
</pre></div>
</div>
<p>After these installations already most of the required software is present and the Cygwin shell can be started now for the further steps!
Inside the shell the POSIX naming convention applies, therefore, paths will be given with separating &#8220;/&#8221; instead of &#8220;&#8221; in DOS. The file
structure accessible through this shell can also be accessed through the Windows Explorer — just go to the directory which you specified
as &#8220;cygwin root&#8221; during the installation: this is the equivalent to &#8220;/&#8221; in the shell. By default, the different hard drives or network shares
like <tt class="docutils literal"><span class="pre">C:\</span></tt> can be found at <tt class="docutils literal"><span class="pre">/cygdrive/c/</span></tt> in the shell — the cygdrive prefix can in principle also be changed but for now we stick to the default.</p>
<p>Since later on the boost header files should be used and in the standard Cygwin installation these are found at a version specific location,
the later handling will be easier if a symbolic link to these files is created now in the terminal (in case it had not been present before):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ ln -sf /usr/include/boost-x_yy_z/boost /usr/include/boost
</pre></div>
</div>
<p>where <tt class="docutils literal"><span class="pre">x_yy_z</span></tt> has to be substituted by the correct version number, <em>e.g.</em> <tt class="docutils literal"><span class="pre">1_33_1</span></tt>.</p>
</div>
<div class="section" id="id6">
<h4>Everything but ROOT and NeXus<a class="headerlink" href="#id6" title="Permalink to this headline"></a></h4>
</div>
<div class="section" id="index-23">
<span id="id7"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-23" title="Permalink to this headline"></a></h4>
<p>Only if <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support reading data files in the <tt class="docutils literal"><span class="pre">NeXus</span></tt> format the further required software has
to be set up. Under <tt class="docutils literal"><span class="pre">Cygwin</span></tt> of all the required libraries only <tt class="docutils literal"><span class="pre">HDF5</span></tt> is available. The packages <tt class="docutils literal"><span class="pre">hdf5</span></tt> and
<tt class="docutils literal"><span class="pre">libhdf5-devel</span></tt> can be installed through the <tt class="docutils literal"><span class="pre">Cygwin</span></tt> setup. One should also make sure that <tt class="docutils literal"><span class="pre">bison</span></tt>, <tt class="docutils literal"><span class="pre">flex</span></tt>
and a package containing <tt class="docutils literal"><span class="pre">/usr/lib/librpc.a</span></tt> (<em>e.g.</em> <tt class="docutils literal"><span class="pre">sunrpc</span> <span class="pre">=</span> <span class="pre">4.0-3</span></tt>, but <em>not</em> <tt class="docutils literal"><span class="pre">sunrpc</span> <span class="pre">=</span> <span class="pre">4.0-4</span></tt>) are installed.</p>
<p>All other libraries have to be built from the sources. The following lines will track the installation of <tt class="docutils literal"><span class="pre">JPEG</span> <span class="pre">6b</span></tt>,
<tt class="docutils literal"><span class="pre">MXML</span> <span class="pre">2.9</span></tt>, <tt class="docutils literal"><span class="pre">HDF</span> <span class="pre">4.2.7-patch1</span></tt>, and <tt class="docutils literal"><span class="pre">NeXus</span> <span class="pre">4.3.2</span></tt>. The version numbers and source-code locations might of
course change with time but should be easily adjustable.</p>
<p><em>Only</em> <tt class="docutils literal"><span class="pre">NeXus</span></tt> version ≥ 4.4 is support!</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span>
$ mkdir nexus
$ <span class="nb">cd</span> nexus
$ curl http://www.hdfgroup.org/ftp/lib-external/jpeg/src/jpegsrc.v6b.tar.gz -G <span class="p">|</span> tar xz
$ <span class="nb">cd</span> jpeg-6b
$ ./configure --prefix<span class="o">=</span>/usr/local --enable-static
$ make
$ make install
$ <span class="nb">cd</span> ..
$ curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G <span class="p">|</span> tar xz
$ <span class="nb">cd</span> mxml-2.9
$ ./configure --prefix<span class="o">=</span>/usr/local --enable-static
$ make
$ make install
$ <span class="nb">cd</span> ..
$ curl http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.7-patch1.tar.gz -G <span class="p">|</span> tar xz
$ <span class="nb">cd</span> hdf-4.2.7-patch1
$ ./configure --prefix<span class="o">=</span>/usr/local --enable-static --disable-fortran --with-jpeg<span class="o">=</span>/usr/local
$ make
$ make install
$ <span class="nb">cd</span> ..
$ <span class="c1"># create a directory for the NeXus source code</span>
$ mkdir nexus
$ <span class="nb">cd</span> nexus
$ <span class="c1"># get the source code from the master repository</span>
$ git clone https://github.com/nexusformat/code.git
$ <span class="c1"># next we will build NeXus out-of-source</span>
$ mkdir build
$ <span class="nb">cd</span> build
$ cmake -DENABLE_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_HDF4<span class="o">=</span><span class="m">1</span> -DENABLE_MXML<span class="o">=</span><span class="m">1</span> ../code
$ make
$ make install
</pre></div>
</div>
</div>
<div class="section" id="index-24">
<span id="id8"></span><h4>ROOT<a class="headerlink" href="#index-24" title="Permalink to this headline"></a></h4>
<p>In order to install the <tt class="docutils literal"><span class="pre">ROOT</span></tt> system, there are two possibilities:</p>
<ul>
<li><p class="first">Download the precompiled Cygwin GCC 4.3 (or newer) package of the most recent <tt class="docutils literal"><span class="pre">ROOT</span></tt> version
from the <a class="reference external" href="https://root.cern.ch/downloading-root">web page</a> and unpack it in a <tt class="docutils literal"><span class="pre">Cygwin</span></tt> shell
(in order to get the line endings correctly) at the final location. Suppose the package has been
downloaded to <tt class="docutils literal"><span class="pre">C:\</span></tt> and the <tt class="docutils literal"><span class="pre">ROOT</span></tt> tree should be in <tt class="docutils literal"><span class="pre">C:\root</span></tt>, this is achieved by:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /cygdrive/c
$ tar xzf root_v5.xx.yy.win32gcc-gcc-4.3.tar.gz
</pre></div>
</div>
</li>
<li><p class="first">If due to some reason there was no precompiled Cygwin GCC 4.3 package available or <tt class="docutils literal"><span class="pre">ROOT</span></tt> should
be built from source, one has to visit the <a class="reference external" href="https://root.cern.ch/downloading-root">web page</a>,
download the &#8216;complete source tree for all systems&#8217; and save it for instance in <tt class="docutils literal"><span class="pre">C:\</span></tt>.
Then go to the Cygwin shell and unpack this source tree, configure it (here using the minimal set of options)
and compile it as follows right below:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /cygdrive/c
$ tar xzf root_v5.xx.yy.source.tar.gz
$ <span class="nb">cd</span> root
$ ./configure win32gcc --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
$ make
</pre></div>
</div>
</li>
<li><p class="first">In order to finalize the <tt class="docutils literal"><span class="pre">ROOT</span></tt> installation and to prepare already the installation of <tt class="docutils literal"><span class="pre">musrfit</span></tt> and
<tt class="docutils literal"><span class="pre">musredit</span></tt> this is a good time for setting necessary environment variables for the use in Cygwin. For
accomplishing that put the following lines at the end of the <tt class="docutils literal"><span class="pre">/home/Username/.bashrc</span></tt> (<tt class="docutils literal"><span class="pre">C:\cygwin\home\Username\.bashrc</span></tt>
for the user <tt class="docutils literal"><span class="pre">Username</span></tt> and the <tt class="docutils literal"><span class="pre">cygwin</span> <span class="pre">root</span></tt> at <tt class="docutils literal"><span class="pre">C:\cygwin</span></tt>):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">DISPLAY</span><span class="o">=</span>:0.0
<span class="nb">export</span> <span class="nv">QTDIR</span><span class="o">=</span>/usr/lib/qt4
<span class="nb">export</span> <span class="nv">ROOTSYS</span><span class="o">=</span>/cygdrive/c/root
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin:<span class="nv">$QTDIR</span>/bin:/usr/i686-pc-cygwin/bin:<span class="nv">$PATH</span>
<span class="nb">export</span> <span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
</pre></div>
</div>
</li>
</ul>
<p>Afterwards close the Cygwin shell and reopen it again for the installation of <tt class="docutils literal"><span class="pre">musrfit</span></tt>.</p>
</div>
</div>
<div class="section" id="index-25">
<span id="id9"></span><h3>musrfit<a class="headerlink" href="#index-25" title="Permalink to this headline"></a></h3>
<p>First, the most recent source code should be downloaded. The preferred way of doing so is to clone the <tt class="docutils literal"><span class="pre">musrfit</span></tt>
repository via git. Assuming the code should be located in <tt class="docutils literal"><span class="pre">~/musrfit</span></tt> this is achieved most easily calling from the terminal</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span>
$ git clone https://bitbucket.org/muonspin/musrfit.git
</pre></div>
</div>
<p>or</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span>
$ git clone git://gitlab.psi.ch/nemu/musrfit.git
</pre></div>
</div>
<p>If the repository had been checked out already before, one can update the local copy using:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> musrfit
$ git pull
</pre></div>
</div>
<p>As an alternative (if git is not available), the source code can also be downloaded from the following
web-page: <a class="reference external" href="https://bitbucket.org/muonspin/musrfit/downloads">musrfit at bitbucket</a>.</p>
<div class="section" id="index-26">
<span id="id10"></span><h4>musrfit build with automake<a class="headerlink" href="#index-26" title="Permalink to this headline"></a></h4>
<p>After the source-code extraction the <tt class="docutils literal"><span class="pre">autogen.sh</span></tt> script is called to prepare the build environment.
If it has been executed successfully the <tt class="docutils literal"><span class="pre">configure</span></tt> script should be ready to collect all the information
needed to create the Makefiles. If <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support <tt class="docutils literal"><span class="pre">NeXus</span></tt> data files this has to be enabled by
specifying the <tt class="docutils literal"><span class="pre">--enable-static</span> <span class="pre">--enable-NeXus</span></tt> switches when calling configure. For an overview of all
available options just call <tt class="docutils literal"><span class="pre">./configure</span> <span class="pre">--help</span></tt>. Besides the standard options there are a few special
options which should be mentioned here:</p>
<dl class="docutils">
<dt><strong>- -prefix</strong></dt>
<dd>Specify the installation prefix, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/opt/root-system</span></tt> (by default: <tt class="docutils literal"><span class="pre">/usr/local</span></tt>)</dd>
<dt><strong>- -with-rootsys</strong></dt>
<dd>Specify the top of the <tt class="docutils literal"><span class="pre">ROOT</span></tt> installation directory, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/opt/root-system</span></tt></dd>
<dt><strong>- -with-fftw3</strong></dt>
<dd>Specify the prefix of the <tt class="docutils literal"><span class="pre">FFTW3</span></tt> installation. <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> or <tt class="docutils literal"><span class="pre">/usr</span></tt></dd>
<dt><strong>- -with-gsl</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">GSL</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> or <tt class="docutils literal"><span class="pre">/usr</span></tt></dd>
<dt><strong>- -with-boostinc</strong></dt>
<dd>Set the path to the header files of the <tt class="docutils literal"><span class="pre">Boost</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local/include</span></tt> or <tt class="docutils literal"><span class="pre">/usr/include</span></tt></dd>
<dt><strong>- -with-hdf4</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">HDF4</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> (only useful in conjunction with the <tt class="docutils literal"><span class="pre">NeXus</span></tt> support)</dd>
<dt><strong>- -with-hdf5</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">HDF5</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr</span></tt> (only useful in conjunction with the <tt class="docutils literal"><span class="pre">NeXus</span></tt> support)</dd>
<dt><strong>- -with-nexus</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">NeXus</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> (only useful in conjunction with the <tt class="docutils literal"><span class="pre">NeXus</span></tt> support)</dd>
<dt><strong>- -with-qt3</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">Qt3</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/lib/qt-3.3</span></tt> (only useful in conjunction with building <tt class="docutils literal"><span class="pre">musrgui</span></tt>)</dd>
<dt><strong>- -with-qt4</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">Qt4</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/lib/qt47</span></tt> (only useful in conjunction with building <tt class="docutils literal"><span class="pre">musredit</span></tt>)</dd>
<dt><strong>- -with-qt5</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">Qt5</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/lib/qt56</span></tt> (only useful in conjunction with building <tt class="docutils literal"><span class="pre">musredit</span></tt>)</dd>
<dt><strong>- -enable-NeXus</strong></dt>
<dd>Enable the support of <tt class="docutils literal"><span class="pre">NeXus</span></tt> data files (requires the <tt class="docutils literal"><span class="pre">HDF4</span></tt>, <tt class="docutils literal"><span class="pre">HDF5</span></tt> and <tt class="docutils literal"><span class="pre">NeXus</span></tt> libraries to be installed).</dd>
<dt><strong>- -disable-editor</strong></dt>
<dd>Disable the integrated building of <tt class="docutils literal"><span class="pre">musredit</span></tt>/<tt class="docutils literal"><span class="pre">musrgui</span></tt>.</dd>
<dt><strong>- -disable-omp</strong></dt>
<dd>Switches off the <tt class="docutils literal"><span class="pre">OpenMP</span></tt> features of <tt class="docutils literal"><span class="pre">musrfit</span></tt> (parallelization of the <span class="math">\(\chi^2\)</span> calculation when compiled with <tt class="docutils literal"><span class="pre">GCC</span></tt> ≥ 4.2)</dd>
</dl>
<p>Normally it should not be necessary to make use of any of the options except for specifying the installation path with <tt class="docutils literal"><span class="pre">--prefix</span></tt>.
The other paths should be detected automatically. If this does not work for some reason the <tt class="docutils literal"><span class="pre">configure</span></tt> script will terminate and
ask for the information. When the <tt class="docutils literal"><span class="pre">configure</span></tt> script has been called successfully everything is ready for building the <tt class="docutils literal"><span class="pre">musrfit</span></tt>
libraries and executables. A standard installation sequence (without <tt class="docutils literal"><span class="pre">NeXus</span></tt> support) might then look like:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> musrfit
$ sh autogen.sh
$ ./configure --prefix<span class="o">=</span><span class="nv">$ROOTSYS</span>
$ make
$ make install
</pre></div>
</div>
</div>
<div class="section" id="index-27">
<span id="id11"></span><h4>musrfit build with cmake<a class="headerlink" href="#index-27" title="Permalink to this headline"></a></h4>
<p>Currently the following configuration switches for <tt class="docutils literal"><span class="pre">musrfit</span></tt> are available:</p>
<dl class="docutils">
<dt><strong>-DCMAKE_INSTALL_PREFIX=&lt;prefix-path&gt;</strong></dt>
<dd>Specify the installation prefix, <em>i.e.</em> the place where <tt class="docutils literal"><span class="pre">musrfit</span></tt> shall be installed, <em>e.g.</em> <tt class="docutils literal"><span class="pre">$ROOTSYS</span></tt> if already defined (by default: <tt class="docutils literal"><span class="pre">/usr/local</span></tt>)</dd>
<dt><strong>-Dnexus=&lt;value&gt;</strong></dt>
<dd>enable/disable the support of <tt class="docutils literal"><span class="pre">NeXus</span></tt> data files (requires the <tt class="docutils literal"><span class="pre">HDF4</span></tt>, <tt class="docutils literal"><span class="pre">HDF5</span></tt> and <tt class="docutils literal"><span class="pre">NeXus</span></tt> libraries to be installed).
&lt;value&gt;=1 enables <tt class="docutils literal"><span class="pre">NeXus</span></tt>, &lt;value&gt;=0 disables <tt class="docutils literal"><span class="pre">NeXus</span></tt>. The default setting, <em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">NeXus</span></tt> support is disabled.</dd>
<dt><strong>-DASlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>.
The default setting, <em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">ASlibs</span></tt> support is <em>disabled</em>. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><em>user libs</em></a>.</dd>
<dt><strong>-DBMWlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>.
The default setting, <em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">BMWlibs</span></tt> support is <em>disabled</em>. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><em>user libs</em></a>.</dd>
<dt><strong>-DBNMRlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>.
The default setting, <em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt> support is <em>disabled</em>.</dd>
<dt><strong>-Dqt_based_tools=&lt;value&gt;</strong></dt>
<dd>Will try to get <tt class="docutils literal"><span class="pre">musredit</span></tt>, <tt class="docutils literal"><span class="pre">musrWiz</span></tt>, <tt class="docutils literal"><span class="pre">musrStep</span></tt>, and <tt class="docutils literal"><span class="pre">mupp</span></tt> installed, if <tt class="docutils literal"><span class="pre">Qt</span></tt> is found.
By default this is <em>enabled</em>. Again &lt;value&gt;=0 means disabled, &lt;value&gt;=1 enabled.</dd>
<dt><strong>-Dqt_version=&lt;value&gt;</strong></dt>
<dd>Allows to specify which <tt class="docutils literal"><span class="pre">Qt</span></tt> version shall be tried. &lt;value&gt; can take the values: <tt class="docutils literal"><span class="pre">AUTO,</span> <span class="pre">3,</span> <span class="pre">4,</span> <span class="pre">5</span></tt>.
If the value is set to <tt class="docutils literal"><span class="pre">AUTO</span></tt>, this highest installed version is chosen, otherwise the specified version is used.</dd>
<dt><strong>-Dtry_OpenMP=&lt;value&gt;</strong></dt>
<dd>Will check if <tt class="docutils literal"><span class="pre">OpenMP</span></tt> support is possible, and if yes use it. The default is <em>enabled</em>.</dd>
</dl>
<p>Normally it should not be necessary to make use of any of the options except for specifying the installation path with
<tt class="docutils literal"><span class="pre">-DCMAKE_INSTALL_PREFIX</span></tt>. <tt class="docutils literal"><span class="pre">musrfit</span></tt> build with <tt class="docutils literal"><span class="pre">cmake</span></tt> takes the out-of-source approach. Therefore a typical
configuration / make / install process including <tt class="docutils literal"><span class="pre">NeXus</span></tt> support would look like</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit
$ mkdir build
$ <span class="nb">cd</span> build
$ cmake ../ -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$ROOTSYS</span> -Dnexus<span class="o">=</span><span class="m">1</span>
<span class="c1"># below it is assumed that multiple cores are present, hence the -j8 option</span>
$ cmake --build ./ --clean-first -- -j8
$ make install
$ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="index-28">
<span id="id12"></span><h3>musredit<a class="headerlink" href="#index-28" title="Permalink to this headline"></a></h3>
<p>In the latest version of <tt class="docutils literal"><span class="pre">musrfit</span></tt> the configure script tries to determine automatically if
Qt4.5 or higher is set up on the machine. In case this is found, the editor <tt class="docutils literal"><span class="pre">musredit</span></tt> is built
readily with <tt class="docutils literal"><span class="pre">musrfit</span></tt>. If not, one can either try to call the <tt class="docutils literal"><span class="pre">configure</span></tt> script with the
<tt class="docutils literal"><span class="pre">--with-qt4</span></tt> option or install this editor separately, <em>.e.g.</em>:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> src/musredit
$ qmake-qt4 musredit.pro
</pre></div>
</div>
<p>If everything went fine <tt class="docutils literal"><span class="pre">musredit</span></tt> can be compiled and installed:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ make
$ make install
</pre></div>
</div>
<p>In case one likes to get the editor started just with starting the X server from the Windows start
menu the file <tt class="docutils literal"><span class="pre">~/.startxwinrc</span></tt> with the following contents can be created:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="ch">#!/bin/sh</span>
<span class="nb">export</span> <span class="nv">DISPLAY</span><span class="o">=</span>:0.0
<span class="nb">export</span> <span class="nv">QTDIR</span><span class="o">=</span>/usr/lib/qt4
<span class="nb">export</span> <span class="nv">ROOTSYS</span><span class="o">=</span>/cygdrive/c/root
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin:<span class="nv">$QTDIR</span>/bin:/usr/i686-pc-cygwin/bin:<span class="nv">$PATH</span>
<span class="nb">export</span> <span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
musredit <span class="p">&amp;</span>
</pre></div>
</div>
</div>
<div class="section" id="id13">
<h3>musrgui (obsolate)<a class="headerlink" href="#id13" title="Permalink to this headline"></a></h3>
<p>If <tt class="docutils literal"><span class="pre">Qt4.5</span></tt> or higher is not available but <tt class="docutils literal"><span class="pre">Qt3</span></tt> is set up <tt class="docutils literal"><span class="pre">musrgui</span></tt> can be installed. For this
please follow the instructions for the <tt class="docutils literal"><span class="pre">musredit</span></tt> installation where simply every <tt class="docutils literal"><span class="pre">musredit</span></tt> occurrence
has to be replaced by <tt class="docutils literal"><span class="pre">musrgui</span></tt>, and <tt class="docutils literal"><span class="pre">qt4</span></tt> is replaced by <tt class="docutils literal"><span class="pre">qt3</span></tt>.</p>
</div>
<div class="section" id="id14">
<h3>Check the installation<a class="headerlink" href="#id14" title="Permalink to this headline"></a></h3>
<p>In order to perform a quick test for finding out if the installation has been completed successfully,
a few msr files together with the corresponding data files can be found in the <tt class="docutils literal"><span class="pre">musrfit</span></tt> source tree
at doc/examples/.
If <tt class="docutils literal"><span class="pre">musrgui</span></tt> has been installed, just open one of the <tt class="docutils literal"><span class="pre">test-*.msr</span></tt> files in the editor and test
the <tt class="docutils literal"><span class="pre">musrfit</span></tt> functionalities. Otherwise, if only the terminal should be used, as an initial test
for instance the following could be done:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> doc/examples
$ musrview test-histo-ROOT-NPP.msr
</pre></div>
</div>
</div>
<div class="section" id="potential-problems">
<h3>Potential Problems<a class="headerlink" href="#potential-problems" title="Permalink to this headline"></a></h3>
<p>It might be that especially when running on Windows 7 <tt class="docutils literal"><span class="pre">musredit</span></tt> and <tt class="docutils literal"><span class="pre">musrgui</span></tt> produce errors like a
&#8220;STATUS_ACCESS_VIOLATION&#8221;. In this case, try to do the following: Close all Cygwin programs (including
the terminals and X server) and run from a Windows command prompt (cmd)</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ C:<span class="se">\c</span>ygwin<span class="se">\b</span>in<span class="se">\a</span>sh.exe /bin/rebaseall
</pre></div>
</div>
<p>If this does not resolve the problem, try to change the compatibility settings of <tt class="docutils literal"><span class="pre">C:\cygwin\bin\sh.exe</span></tt>
and <tt class="docutils literal"><span class="pre">C:\cygwin\bin\bash.exe</span></tt> so that they are executed with administrator privileges.</p>
</div>
</div>
<div class="section" id="mac-os-x-macos">
<h2>Mac OS X / macOS<a class="headerlink" href="#mac-os-x-macos" title="Permalink to this headline"></a></h2>
<p>With Mac OS X / macOS the situation is up to some extent similar like on MS Windows but still different since
Mac OS X is a UNIX system. The similarity is that also on OS X a helping framework — either <a class="reference external" href="https://www.macports.org/">MacPorts</a>
or <a class="reference external" href="http://www.finkproject.org/">Fink</a> — which provides open-source software is employed to fulfill the basic software requirements of <tt class="docutils literal"><span class="pre">musrfit</span></tt>.
In the following, both possibilities (using MacPorts or Fink) are described but it is emphasized here that
it should be followed only <em>one</em> of the possible routes .</p>
<div class="section" id="requirements-macports">
<span id="index-29"></span><h3>Requirements (MacPorts)<a class="headerlink" href="#requirements-macports" title="Permalink to this headline"></a></h3>
<p>Before proceeding with the usage of the <tt class="docutils literal"><span class="pre">MacPorts</span></tt> system first a few useful tools provided by Apple together
with OS X (on the installation DVD/CDs) should be installed:</p>
<blockquote>
<div><dl class="docutils">
<dt><strong>Xcode</strong></dt>
<dd><p class="first">Useful developer tools including for instance the GNU compiler collection. It can be installed via the Apple App store.
Starting from <tt class="docutils literal"><span class="pre">XCode</span></tt> ≥ 4.3 the command line tools need to be installed manually. The necessary command line tools
can be installed via the following commands entered in the terminal</p>
<div class="last highlight-bash"><div class="highlight"><pre><span></span>$ xcode-select --install
$ sudo xcodebuild -license
</pre></div>
</div>
</dd>
</dl>
</div></blockquote>
<dl class="docutils">
<dt><strong>X11</strong></dt>
<dd>The X-window system is automatically installed on 10.5 Leopard and 10.6 Snow Leopard. For some other versions you also
will need to install <cite>XQuartz &lt;http://xquartz.macosforge.org/trac&gt;</cite>. If <tt class="docutils literal"><span class="pre">ROOT</span></tt> runs without <tt class="docutils literal"><span class="pre">XQuartz</span></tt> <em>do not</em>
install it.</dd>
</dl>
<p>After installing the <tt class="docutils literal"><span class="pre">Xcode</span></tt> tools go to the <a class="reference external" href="http://www.macports.org/install.php">MacPorts install page</a>, download
the installer for your system and follow the installation instructions on the page. By default the MacPorts system will be
installed in <tt class="docutils literal"><span class="pre">/opt/local</span></tt>. To be sure that the newest version of the software is used a MacPorts upgrade should be performed
by typing in a terminal:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo port -v selfupdate
</pre></div>
</div>
<p><strong>Remark:</strong> MacPorts uses <a class="reference external" href="http://rsync.samba.org/">rsync</a> in order to synchronize the list of available packages. It frequently
happens that this service is blocked by firewalls. In this case it should be possible to download a local version of the package
repository and do the synchronization. If this step becomes necessary (<em>and only then</em>) it can be done in the following way:</p>
<ol class="arabic">
<li><p class="first">Get a local version of the repository:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ svn co http://svn.macports.org/repository/macports/trunk/dports ~/dports
</pre></div>
</div>
</li>
<li><p class="first">Edit the file <tt class="docutils literal"><span class="pre">/opt/local/etc/macports/sources.conf</span></tt>: At the end of the file, comment the line beginning with <tt class="docutils literal"><span class="pre">rsync://</span></tt> and
add a new line pointing to your local copy, <em>e.g.</em></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>file:///Users/username/dports
</pre></div>
</div>
</li>
<li><p class="first">Synchronize the packages:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo port -v -d sync
</pre></div>
</div>
</li>
</ol>
<p>Then the MacPorts system should be set up and can be used to install additional software.</p>
<p>The installation of the software mentioned above is then done in the terminal:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo port -v install pkgconfig autoconf automake libtool cmake fftw-3 fftw-3-single gsl boost libxml2 qt5 qt5-qtsvg qt5-qtwebengine
</pre></div>
</div>
<p>With <tt class="docutils literal"><span class="pre">Qt5</span></tt>, <tt class="docutils literal"><span class="pre">musredit</span></tt> will be installed. If it happens that you used <tt class="docutils literal"><span class="pre">musrgui</span></tt> in the past,
please change over to <tt class="docutils literal"><span class="pre">musredit</span></tt> since there will be no further development for <tt class="docutils literal"><span class="pre">musrgui</span></tt> anymore!</p>
<div class="section" id="index-30">
<span id="id15"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-30" title="Permalink to this headline"></a></h4>
<p><em>Only</em> if <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support reading data files in the <tt class="docutils literal"><span class="pre">NeXus</span></tt> format the further required packages are set up:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo port -v install hdf4 hdf5
</pre></div>
</div>
<p>Unfortunately, the <tt class="docutils literal"><span class="pre">minixml</span></tt> and <tt class="docutils literal"><span class="pre">NeXus</span></tt> libraries have to be compiled and installed directly from the source code.
Given the respective version numbers of 2.9 and 4.4.2 (which are subject to change with time.
Only <tt class="docutils literal"><span class="pre">NeXus</span></tt> Version ≥ 4.4 is support!) this can be achieved for example by:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="c1"># get and instal Mini-XML</span>
$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Applications
$ git clone https://github.com/michaelrsweet/mxml.git
$ <span class="nb">cd</span> mxml
$ ./configure --prefix<span class="o">=</span>/usr/local
$ make
$ sudo make install
$ <span class="c1"># get and install NeXus</span>
$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Applications
$ <span class="c1"># get the source code from the master repository</span>
$ git clone https://github.com/nexusformat/code.git nexus/code
$ <span class="c1"># next we will build NeXus out-of-source</span>
$ <span class="nb">cd</span> nexus
$ mkdir build
$ <span class="nb">cd</span> build
$ cmake -DENABLE_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_HDF4<span class="o">=</span><span class="m">1</span> -DENABLE_MXML<span class="o">=</span><span class="m">1</span> ../code
$ make
$ sudo make install
</pre></div>
</div>
</div>
<div class="section" id="index-31">
<span id="id16"></span><h4>ROOT<a class="headerlink" href="#index-31" title="Permalink to this headline"></a></h4>
<p>ROOT 5.34/xx is supported as legacy version only! <strong>The default now will be ROOT 6.xx/yy!</strong></p>
<div class="section" id="root-installed-via-package-installer">
<h5>ROOT installed via package installer<a class="headerlink" href="#root-installed-via-package-installer" title="Permalink to this headline"></a></h5>
<p>The lazy way to get <tt class="docutils literal"><span class="pre">ROOT</span></tt> installed is via package installer. If your macOS is directly supported
by the <tt class="docutils literal"><span class="pre">ROOT</span></tt> people you can download the package installer from the <tt class="docutils literal"><span class="pre">ROOT</span></tt> <a class="reference external" href="https://root.cern.ch/downloading-root">download page</a>.
Choose the latest <tt class="docutils literal"><span class="pre">ROOT</span></tt> release and download you macOS version dmg-file, <em>e.g.</em> for macOS 10.13 (High Sierra)
it is at the time of writting <tt class="docutils literal"><span class="pre">root_v6.14.00.macosx64-10.13-clang91.dmg</span></tt>. After the installation
<tt class="docutils literal"><span class="pre">ROOT</span></tt> will be installed under <tt class="docutils literal"><span class="pre">/Application</span></tt> as owner root. In order to ease your life for the
steps to follow and assuming you are the only guy working on your Mac, you could change the owner and group of the <tt class="docutils literal"><span class="pre">ROOT</span></tt> directory:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /Applications
$ sudo chown -R &lt;username&gt; root_v6.14.00
$ sudo chgrp -R staff root_v6.14.00
$ sudo ln -s root_v6.14.00 root
</pre></div>
</div>
</div>
<div class="section" id="root-installed-from-source">
<h5>ROOT installed from source<a class="headerlink" href="#root-installed-from-source" title="Permalink to this headline"></a></h5>
<p>The best way to get <tt class="docutils literal"><span class="pre">ROOT</span></tt> exactly the way needed for <tt class="docutils literal"><span class="pre">musrfit</span></tt> is to install it from source.
Before describing it, please make sure that you have installed all required packages listed under
<a class="reference internal" href="#supported-operating-systems"><em>Requested Software</em></a> (<em>e.g.</em> <tt class="docutils literal"><span class="pre">fftw</span></tt>, <tt class="docutils literal"><span class="pre">gsl</span></tt>, etc).</p>
<p>For the following it is assumed that <tt class="docutils literal"><span class="pre">ROOT</span></tt> shall be installed under <tt class="docutils literal"><span class="pre">$HOME/Applications</span></tt>. If you want
to install it somewhere else, just systematically replace the related terms of the following description.
For the following list of commands the &#8216;$&#8217; will be given, the command prompt. Do not enter it! Also some
comments will be added starting with a &#8216;#&#8217; which can be omitted. They are only there to explain what is going on.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Applications
$ git clone http://root.cern.ch/git/root.git
$ <span class="nb">cd</span> root
$ git tag -l
$ <span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-10-xx</span>
$ <span class="c1"># where xx is the highest listed number, e.g. v6-14-00</span>
$ git checkout -b v6-14-00 v6-14-00
$ <span class="c1"># now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.</span>
$ <span class="c1"># We will use the cmake out-of-source approach here.</span>
$ mkdir root_build
$ <span class="nb">cd</span> root_build
$ cmake ../ -Dgminimal<span class="o">=</span>ON -Dasimage<span class="o">=</span>ON -Dmathmore<span class="o">=</span>ON -Dminuit2<span class="o">=</span>ON -Dxml<span class="o">=</span>ON -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
$ <span class="c1"># next will be the make. If running on a multicore CPU you can speed up tremendously by calling</span>
$ <span class="c1"># make with the option -j &lt;number&gt;, where &lt;number&gt; is the number of threads which you want to give,</span>
$ <span class="c1"># e.g. make -j8</span>
$ cmake --build ./ --clean-first -- -j8
$ <span class="c1"># make will take quite a while</span>
$ make install
</pre></div>
</div>
<p>For further details see <a class="reference external" href="https://root.cern.ch/building-root">Installing ROOT from Source</a>.</p>
</div>
<div class="section" id="setting-up-environment-variables-for-root-and-musrfit">
<h5>Setting up Environment Variables for ROOT and musrfit<a class="headerlink" href="#setting-up-environment-variables-for-root-and-musrfit" title="Permalink to this headline"></a></h5>
<p>Since Apple in its wisdom decided that programs started from a shell are treated differently than Apps if it is coming to
system variables, we need to work harder compared to a Linux system.</p>
<p><strong>For Mac OS X &lt; 10.8:</strong></p>
<p>In order to finalize the <tt class="docutils literal"><span class="pre">ROOT</span></tt> installation and to prepare already the installation of <tt class="docutils literal"><span class="pre">musrfit</span></tt> and <tt class="docutils literal"><span class="pre">musredit</span></tt>
this is a good time for setting necessary environment variables for the use in Mac OS X. Here it assumed that you
installed <tt class="docutils literal"><span class="pre">ROOT</span></tt> from source. If you downloaded the binary package, you will need to adopt the paths accordingly.
Put the following lines (without the comments in parentheses and with the paths adjusted to your local installation)
into the file <tt class="docutils literal"><span class="pre">~/.MacOSX/environment.plist</span></tt> and re-login:</p>
<div class="highlight-xml"><div class="highlight"><pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span class="cp">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span>
<span class="nt">&lt;plist</span> <span class="na">version=</span><span class="s">&quot;1.0&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;dict&gt;</span>
<span class="nt">&lt;key&gt;</span>MUSRFITPATH<span class="nt">&lt;/key&gt;</span>
<span class="nt">&lt;string&gt;</span>$HOME/Applications/root/root_exec/bin<span class="nt">&lt;/string&gt;</span> (where to find the musrfit executables)
<span class="nt">&lt;key&gt;</span>QTDIR<span class="nt">&lt;/key&gt;</span>
<span class="nt">&lt;string&gt;</span>/opt/local/lib/qt3mac<span class="nt">&lt;/string&gt;</span> (where to find Qt3 (for musrgui) or Qt4 (for musredit))
<span class="nt">&lt;key&gt;</span>ROOTSYS<span class="nt">&lt;/key&gt;</span>
<span class="nt">&lt;string&gt;</span>$HOME/Applications/root/root_exec<span class="nt">&lt;/string&gt;</span> (where to find the ROOT system)
<span class="nt">&lt;/dict&gt;</span>
<span class="nt">&lt;/plist&gt;</span>
</pre></div>
</div>
<p><strong>For Mac OS X ≥ 10.8:</strong></p>
<p>One needs to add some system variables in <tt class="docutils literal"><span class="pre">~/.profile</span></tt>:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">ROOTSYS</span><span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
<span class="nb">export</span> <span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin:<span class="nv">$QTDIR</span>/bin:<span class="nv">$PATH</span>
<span class="nb">export</span> <span class="nv">LD_LIBRARY_PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/lib:<span class="nv">$LD_LIBRARY_PATH</span>
launchctl setenv ROOTSYS <span class="nv">$ROOTSYS</span>
launchctl setenv MUSRFITPATH <span class="nv">$MUSRFITPATH</span>
launchctl setenv PATH <span class="nv">$PATH</span>
launchctl setenv LD_LIBRARY_PATH <span class="nv">$LD_LIBRARY_PATH</span>
</pre></div>
</div>
<p>After this you will need to &#8220;execute&#8221; <tt class="docutils literal"><span class="pre">.profile</span></tt> before proceeding:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">source</span> <span class="nv">$HOME</span>/.profile
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="requirements-fink">
<span id="index-32"></span><h3>Requirements (Fink)<a class="headerlink" href="#requirements-fink" title="Permalink to this headline"></a></h3>
<p>Before proceeding with the usage of the <a class="reference external" href="http://www.finkproject.org/">Fink</a> system first a few useful tools provided by Apple together with OS X (on the installation DVD/CDs) should be installed:</p>
<dl class="docutils">
<dt><strong>Xcode</strong></dt>
<dd><p class="first">Useful developer tools including for instance the GNU compiler collection. It can be installed via the Apple App store.
Starting from <tt class="docutils literal"><span class="pre">XCode</span></tt> ≥ 4.3 the command line tools need to be installed manually. The necessary command line tools
can be installed via the following commands entered in the terminal</p>
<div class="last highlight-bash"><div class="highlight"><pre><span></span>$ xcode-select --install
$ sudo xcodebuild -license
</pre></div>
</div>
</dd>
<dt><strong>X11</strong></dt>
<dd>The X-window system is automatically installed on 10.5 Leopard and 10.6 Snow Leopard. For some other versions you also
will need to install <cite>XQuartz &lt;http://xquartz.macosforge.org/trac&gt;</cite>. If <tt class="docutils literal"><span class="pre">ROOT</span></tt> runs without <tt class="docutils literal"><span class="pre">XQuartz</span></tt> <em>do not</em>
install it.</dd>
</dl>
<p>After installing the <tt class="docutils literal"><span class="pre">Xcode</span></tt> tools go to the <a class="reference external" href="http://www.finkproject.org/download/index.php?phpLang=en">Fink download page</a>,
download the installer for your system and follow the installation instructions on the page. By default the Fink system is
installed under <tt class="docutils literal"><span class="pre">/sw</span></tt>. After the basic setup make sure that in <tt class="docutils literal"><span class="pre">/sw/etc/fink.conf</span></tt> the line starting with Trees reads like:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>Trees: local/main stable/main stable/crypto unstable/main
</pre></div>
</div>
<p>After applying the changes above to the configuration file, the Fink core system should be upgraded to its newest version by typing in a terminal:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo fink selfupdate
</pre></div>
</div>
<p>Then the Fink system should be set up and can be used to install additional software.
The Fink installer package also contains a graphical user interface called FinkCommander and it is
suggested to use that for installing the following packages (or packages with revisions close to the following) — it
is necessary to compile a few packages from source since no binary packages are available, however, this is done
automatically by the FinkCommander after you have chosen the software packages for installation:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>autoconf automake cmake boost1.63-nopython boost1.63.nopython-shlibs fftw3 fftw3-shlibs gsl gsl-shlibs
libtool2 libtool2-shlibs libxml2 libxml2-bin libxml2-shlibs pkgconfig qt5-mac-qtbase qt5-mac-qtbase-dev-tools
qt5-mac-qtsvg qt5-mac-qtsvg-shlibs qt5-mac-qtwebengine qt5-mac-qtwebengine-shlibs qt5-mac-qtwebenginecore-shlibs
qt5-mac-qtwebenginewidgets-shlibs
</pre></div>
</div>
<p>Under OS X 10.6 Snow Leopard it will <em>not</em> be possible to install <tt class="docutils literal"><span class="pre">qt3mac</span></tt> since the system is by default a 64-bit
system and the old <tt class="docutils literal"><span class="pre">qt3-mac</span></tt> depends on software which is only available for 32-bit systems. It is suggested to
install <tt class="docutils literal"><span class="pre">qt5-mac</span></tt> instead and use <tt class="docutils literal"><span class="pre">musredit</span></tt>.</p>
<p>Also, due to some not fulfilled dependencies, it might not be possible to install FFTW3 through Fink. In this case
(<em>and ONLY in THIS case</em>) simply download the FFTW3 source code from its download page and install it from a terminal
using the following commands (for the FFTW version 3.x.y):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ tar xz fftw-3.x.y
$ <span class="nb">cd</span> fftw-3.x.y
$ ./configure --enable-single --enable-shared --enable-threads --prefix<span class="o">=</span>/usr/local
$ make
$ sudo make install
</pre></div>
</div>
<p>Since later on the boost header files should be used and in the standard Fink installation these are found at a version
specific location, the later handling will be easier if a symbolic link to this files is created now in the terminal
(if it did not exist earlier), <em>e.g.</em>:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ ln -sf /sw/include/boost-x_yy_z/boost /sw/include/boost
</pre></div>
</div>
<p>where <tt class="docutils literal"><span class="pre">x_yy_z</span></tt> has to be substituted by the correct version number, <em>e.g.</em> <tt class="docutils literal"><span class="pre">1_63_0</span></tt>.</p>
<div class="section" id="index-33">
<span id="id17"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-33" title="Permalink to this headline"></a></h4>
<p><em>Only</em> if <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support reading data files in the <tt class="docutils literal"><span class="pre">NeXus</span></tt> format the further required
packages can be installed through Fink (check for the most recent versions):</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>libjpeg hdf hdf5-cpp11 hdf5-cpp11-shlibs
</pre></div>
</div>
<p>Unfortunately, the <tt class="docutils literal"><span class="pre">minixml</span></tt> and <tt class="docutils literal"><span class="pre">NeXus</span></tt> libraries have to be compiled and installed directly from
the source code. Given the respective version numbers of 2.9 and 4.3.2 (which are subject to change with time)
this can be achieved for example by:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="c1"># first build Mini-XML</span>
$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Applications
$ git clone https://github.com/michaelrsweet/mxml.git
$ <span class="nb">cd</span> mxml
$ ./configure --prefix<span class="o">=</span>/usr/local
$ make
$ sudo make install
$ <span class="c1"># second build NeXus</span>
$ <span class="nb">cd</span> ..
$ git clone https://github.com/nexusformat/code.git nexus/code
$ <span class="nb">cd</span> nexus
$ <span class="c1"># build NeXus out-of-source</span>
$ mkdir build
$ <span class="nb">cd</span> build
$ cmake ../code -DENABLE_HDF4<span class="o">=</span><span class="m">1</span> -DENABLE_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_MXML<span class="o">=</span><span class="m">1</span>
$ cmake --build ./ --clean-first -- -j8
$ sudo make install
</pre></div>
</div>
</div>
<div class="section" id="index-34">
<span id="id18"></span><h4>ROOT<a class="headerlink" href="#index-34" title="Permalink to this headline"></a></h4>
<p>ROOT 5.34/xx is supported as legacy version only and will likely to be dropped in 2018. <strong>The default now is ROOT 6.xx/yy!</strong></p>
<div class="section" id="id19">
<h5>ROOT installed via package installer<a class="headerlink" href="#id19" title="Permalink to this headline"></a></h5>
<p>The lazy way to get <tt class="docutils literal"><span class="pre">ROOT</span></tt> installed is via package installer. If your macOS is directly supported
by the <tt class="docutils literal"><span class="pre">ROOT</span></tt> people you can download the package installer from the <tt class="docutils literal"><span class="pre">ROOT</span></tt> <a class="reference external" href="https://root.cern.ch/downloading-root">download page</a>.
Choose the latest <tt class="docutils literal"><span class="pre">ROOT</span></tt> release and download you macOS version dmg-file, <em>e.g.</em> for macOS 10.13 (High Sierra)
it is at the time of writting <tt class="docutils literal"><span class="pre">root_v6.14.00.macosx64-10.13-clang91.dmg</span></tt>. After the installation
<tt class="docutils literal"><span class="pre">ROOT</span></tt> will be installed under <tt class="docutils literal"><span class="pre">/Application</span></tt> as owner root. In order to ease your life for the
steps to follow and assuming you are the only guy working on your Mac, you could change the owner and group of the <tt class="docutils literal"><span class="pre">ROOT</span></tt> directory:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /Applications
$ sudo chown -R &lt;username&gt; root_v6.14.00
$ sudo chgrp -R staff root_v6.14.00
$ sudo ln -s root_v6.14.00 root
</pre></div>
</div>
</div>
<div class="section" id="id21">
<h5>ROOT installed from source<a class="headerlink" href="#id21" title="Permalink to this headline"></a></h5>
<p>The best way to get <tt class="docutils literal"><span class="pre">ROOT</span></tt> exactly the way needed for <tt class="docutils literal"><span class="pre">musrfit</span></tt> is to install it from source.
Before describing it, please make sure that you have installed all required packages listed under
<a class="reference internal" href="#supported-operating-systems"><em>Requested Software</em></a> (<em>e.g.</em> <tt class="docutils literal"><span class="pre">fftw</span></tt>, <tt class="docutils literal"><span class="pre">gsl</span></tt>, etc).</p>
<p>For the following it is assumed that <tt class="docutils literal"><span class="pre">ROOT</span></tt> shall be installed under <tt class="docutils literal"><span class="pre">$HOME/Applications</span></tt>. If you want
to install it somewhere else, just systematically replace the related terms of the following description.
For the following list of commands the &#8216;$&#8217; will be given, the command prompt. Do not enter it! Also some
comments will be added starting with a &#8216;#&#8217; which can be omitted. They are only there to explain what is going on.</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Applications
$ git clone http://root.cern.ch/git/root.git
$ <span class="nb">cd</span> root
$ git tag -l
$ <span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-10-xx</span>
$ <span class="c1"># where xx is the highest listed number, e.g. v6-14-00</span>
$ git checkout -b v6-14-00 v6-14-00
$ <span class="c1"># now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.</span>
$ <span class="c1"># We will use the cmake out-of-source approach here.</span>
$ mkdir root_build
$ <span class="nb">cd</span> root_build
$ cmake ../ -Dgminimal<span class="o">=</span>ON -Dasimage<span class="o">=</span>ON -Dmathmore<span class="o">=</span>ON -Dminuit2<span class="o">=</span>ON -Dxml<span class="o">=</span>ON -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
$ <span class="c1"># next will be the make. If running on a multicore CPU you can speed up tremendously by calling</span>
$ <span class="c1"># make with the option -j &lt;number&gt;, where &lt;number&gt; is the number of threads which you want to give,</span>
$ <span class="c1"># e.g. make -j8</span>
$ cmake --build ./ --clean-first -- -j8
$ <span class="c1"># make will take quite a while</span>
$ make install
</pre></div>
</div>
<p>For further details see <a class="reference external" href="https://root.cern.ch/building-root">Installing ROOT from Source</a>.</p>
</div>
<div class="section" id="id23">
<h5>Setting up Environment Variables for ROOT and musrfit<a class="headerlink" href="#id23" title="Permalink to this headline"></a></h5>
<p>Since Apple in its wisdom decided that programs started from a shell are treated differently than Apps if it is coming to
system variables, we need to work harder compared to a Linux system.</p>
<p><strong>For Mac OS X &lt; 10.8:</strong></p>
<p>In order to finalize the <tt class="docutils literal"><span class="pre">ROOT</span></tt> installation and to prepare already the installation of <tt class="docutils literal"><span class="pre">musrfit</span></tt> and <tt class="docutils literal"><span class="pre">musredit</span></tt>
this is a good time for setting necessary environment variables for the use in Mac OS X. Here it assumed that you
installed <tt class="docutils literal"><span class="pre">ROOT</span></tt> from source. If you downloaded the binary package, you will need to adopt the paths accordingly.
Put the following lines (without the comments in parentheses and with the paths adjusted to your local installation)
into the file <tt class="docutils literal"><span class="pre">~/.MacOSX/environment.plist</span></tt> and re-login:</p>
<div class="highlight-xml"><div class="highlight"><pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span class="cp">&lt;!DOCTYPE plist PUBLIC &quot;-//Apple//DTD PLIST 1.0//EN&quot; &quot;http://www.apple.com/DTDs/PropertyList-1.0.dtd&quot;&gt;</span>
<span class="nt">&lt;plist</span> <span class="na">version=</span><span class="s">&quot;1.0&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;dict&gt;</span>
<span class="nt">&lt;key&gt;</span>MUSRFITPATH<span class="nt">&lt;/key&gt;</span>
<span class="nt">&lt;string&gt;</span>$HOME/Applications/root/root_exec/bin<span class="nt">&lt;/string&gt;</span> (where to find the musrfit executables)
<span class="nt">&lt;key&gt;</span>QTDIR<span class="nt">&lt;/key&gt;</span>
<span class="nt">&lt;string&gt;</span>/opt/local/lib/qt3mac<span class="nt">&lt;/string&gt;</span> (where to find Qt3 (for musrgui) or Qt4 (for musredit))
<span class="nt">&lt;key&gt;</span>ROOTSYS<span class="nt">&lt;/key&gt;</span>
<span class="nt">&lt;string&gt;</span>$HOME/Applications/root/root_exec<span class="nt">&lt;/string&gt;</span> (where to find the ROOT system)
<span class="nt">&lt;/dict&gt;</span>
<span class="nt">&lt;/plist&gt;</span>
</pre></div>
</div>
<p><strong>For Mac OS X ≥ 10.8:</strong></p>
<p>One needs to add some system variables in <tt class="docutils literal"><span class="pre">~/.profile</span></tt>:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">ROOTSYS</span><span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
<span class="nb">export</span> <span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin:<span class="nv">$QTDIR</span>/bin:<span class="nv">$PATH</span>
<span class="nb">export</span> <span class="nv">LD_LIBRARY_PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/lib:<span class="nv">$LD_LIBRARY_PATH</span>
launchctl setenv ROOTSYS <span class="nv">$ROOTSYS</span>
launchctl setenv MUSRFITPATH <span class="nv">$MUSRFITPATH</span>
launchctl setenv PATH <span class="nv">$PATH</span>
launchctl setenv LD_LIBRARY_PATH <span class="nv">$LD_LIBRARY_PATH</span>
</pre></div>
</div>
<p>After this you will need to &#8220;execute&#8221; <tt class="docutils literal"><span class="pre">.profile</span></tt> before proceeding:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">source</span> <span class="nv">$HOME</span>/.profile
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="index-35">
<span id="id24"></span><h3>musrfit<a class="headerlink" href="#index-35" title="Permalink to this headline"></a></h3>
<p>First, the most recent source code should be downloaded. First, the most recent source code should be downloaded.
The preferred way of doing so is to clone the <tt class="docutils literal"><span class="pre">musrfit</span></tt> repository via git. Assuming the code should be located
in <tt class="docutils literal"><span class="pre">~/Applications/musrfit</span></tt> this is achieved most easily calling from the termin</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> ~/Applications
$ git clone https://bitbucket.org/muonspin/musrfit.git
$ <span class="c1"># Only if legacy ROOT 5.xx.yy is used include the next line</span>
$ <span class="nb">cd</span> musrfit<span class="p">;</span> git checkout root5
</pre></div>
</div>
<p>or</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> ~/Applications
$ git clone git://gitlab.psi.ch/nemu/musrfit.git
$ <span class="c1"># Only if legacy ROOT 5.xx.yy is used include the next line</span>
$ <span class="nb">cd</span> musrfit<span class="p">;</span> git checkout root5
</pre></div>
</div>
<p>If a local repository clone is already present, one can update it using:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> ~/Applications/musrfit
$ git pull
</pre></div>
</div>
<p>As an alternative (<em>if git is not available</em>), the source code can also be downloaded from the following
web-page: <a class="reference external" href="https://bitbucket.org/muonspin/musrfit/downloads">musrfit at bitbucket</a>.</p>
<div class="section" id="index-36">
<span id="id25"></span><h4>musrfit build with automake<a class="headerlink" href="#index-36" title="Permalink to this headline"></a></h4>
<p>After the source-code extraction the <tt class="docutils literal"><span class="pre">autogen.sh</span></tt> script is called to prepare the build environment.
If it has been executed successfully the <tt class="docutils literal"><span class="pre">configure</span></tt> script should be ready to collect all the information needed
to create the Makefiles. If <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support <tt class="docutils literal"><span class="pre">NeXus</span></tt> data files this has to be enabled by specifying the
<tt class="docutils literal"><span class="pre">--enable-NeXus</span></tt> switch when calling configure. For an overview of all available options just call <tt class="docutils literal"><span class="pre">./configure</span> <span class="pre">--help</span></tt>.
Besides the standard options there are a few special options which should be mentioned here:</p>
<dl class="docutils">
<dt><strong>- -prefix</strong></dt>
<dd>Specify the installation prefix, <em>e.g.</em> <tt class="docutils literal"><span class="pre">$ROOTSYS</span></tt> if already defined (by default: <tt class="docutils literal"><span class="pre">/usr/local</span></tt>).</dd>
<dt><strong>- -with-rootsys</strong></dt>
<dd>Specify the top of the <tt class="docutils literal"><span class="pre">ROOT</span></tt> installation directory, <em>e.g.</em> <tt class="docutils literal"><span class="pre">$ROOTSYS</span></tt> if already defined.</dd>
<dt><strong>- -with-fftw3</strong></dt>
<dd>Specify the prefix of the <tt class="docutils literal"><span class="pre">FFTW3</span></tt> installation. <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> or <tt class="docutils literal"><span class="pre">/usr</span></tt>.</dd>
<dt><strong>- -with-gsl</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">GSL</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> or <tt class="docutils literal"><span class="pre">/usr</span></tt>.</dd>
<dt><strong>- -with-boostinc</strong></dt>
<dd>Set the path to the header files of the <tt class="docutils literal"><span class="pre">Boost</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local/include</span></tt> or <tt class="docutils literal"><span class="pre">/usr/include</span></tt>.</dd>
<dt><strong>- -with-hdf4</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">HDF4</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> (only useful in conjunction with the <tt class="docutils literal"><span class="pre">NeXus</span></tt> support).</dd>
<dt><strong>- -with-hdf5</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">HDF5</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr</span></tt> (only useful in conjunction with the <tt class="docutils literal"><span class="pre">NeXus</span></tt> support).</dd>
<dt><strong>- -with-nexus</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">NeXus</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/local</span></tt> (only useful in conjunction with the <tt class="docutils literal"><span class="pre">NeXus</span></tt> support).</dd>
<dt><strong>- -with-qt3</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">Qt3</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/lib/qt-3.3</span></tt> (only useful in conjunction with building <tt class="docutils literal"><span class="pre">musrgui</span></tt>).</dd>
<dt><strong>- -with-qt4</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">Qt4</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/lib/qt47</span></tt> (only useful in conjunction with building <tt class="docutils literal"><span class="pre">musredit</span></tt>).</dd>
<dt><strong>- -with-qt5</strong></dt>
<dd>Set the prefix of the <tt class="docutils literal"><span class="pre">Qt5</span></tt> installation, <em>e.g.</em> <tt class="docutils literal"><span class="pre">/usr/lib64</span></tt> (only useful in conjunction with building <tt class="docutils literal"><span class="pre">musredit</span></tt>).</dd>
<dt><strong>- -enable-NeXus</strong></dt>
<dd>Enable the support of <tt class="docutils literal"><span class="pre">NeXus</span></tt> data files (requires the <tt class="docutils literal"><span class="pre">HDF4</span></tt>, <tt class="docutils literal"><span class="pre">HDF5</span></tt> and <tt class="docutils literal"><span class="pre">NeXus</span></tt> libraries to be installed).</dd>
<dt><strong>- -disable-editor</strong></dt>
<dd>Disable the integrated building of <tt class="docutils literal"><span class="pre">musredit</span></tt>/<tt class="docutils literal"><span class="pre">musrgui</span></tt>.</dd>
<dt><strong>- -disable-omp</strong></dt>
<dd>Switches off the <a class="reference external" href="http://en.wikipedia.org/wiki/OpenMP">OpenMP</a> features of <tt class="docutils literal"><span class="pre">musrfit</span></tt> (parallelization of the <span class="math">\(\chi^2\)</span> calculation when compiled with GCC ≥ 4.2).</dd>
</dl>
<p>Normally it should not be necessary to make use of any of the options except for specifying the installation path with <tt class="docutils literal"><span class="pre">--prefix</span></tt>. The
other paths should be detected automatically. If this does not work for some reason the configure script will terminate and ask for the
information. When the configure script has been called successfully everything is ready for building the <tt class="docutils literal"><span class="pre">musrfit</span></tt> libraries and executables.
A standard installation sequence (without <tt class="docutils literal"><span class="pre">NeXus</span></tt> support) might then look like (In case the normal user has no write permissions to the
<tt class="docutils literal"><span class="pre">$ROOTSYS</span></tt> and the installation path the &#8220;make install&#8221; commands have to be executed as superuser.):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit
$ sh autogen.sh
$ ./configure --prefix<span class="o">=</span><span class="nv">$ROOTSYS</span>
$ make
$ make install
$ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div>
</div>
</div>
<div class="section" id="index-37">
<span id="id27"></span><h4>musrfit build with cmake<a class="headerlink" href="#index-37" title="Permalink to this headline"></a></h4>
<p>Currently the following configuration switches for <tt class="docutils literal"><span class="pre">musrfit</span></tt> are available:</p>
<dl class="docutils">
<dt><strong>-DCMAKE_INSTALL_PREFIX=&lt;prefix-path&gt;</strong></dt>
<dd>Specify the installation prefix, <em>i.e.</em> the place where <tt class="docutils literal"><span class="pre">musrfit</span></tt> shall be installed, <em>e.g.</em> <tt class="docutils literal"><span class="pre">$ROOTSYS</span></tt> if already defined (by default: <tt class="docutils literal"><span class="pre">/usr/local</span></tt>).</dd>
<dt><strong>-Dnexus=&lt;value&gt;</strong></dt>
<dd>enable/disable the support of <tt class="docutils literal"><span class="pre">NeXus</span></tt> data files (requires the <tt class="docutils literal"><span class="pre">HDF4</span></tt>, <tt class="docutils literal"><span class="pre">HDF5</span></tt> and <tt class="docutils literal"><span class="pre">NeXus</span></tt> libraries to be installed).
&lt;value&gt;=1 enables <tt class="docutils literal"><span class="pre">NeXus</span></tt>, &lt;value&gt;=0 disables <tt class="docutils literal"><span class="pre">NeXus</span></tt>. The default setting, <em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">NeXus</span></tt> support is disabled.</dd>
<dt><strong>-DASlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>. The default setting, <em>i.e.</em> the
switch is not provided is <tt class="docutils literal"><span class="pre">ASlibs</span></tt> support is disabled. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><em>user libs</em></a>.</dd>
<dt><strong>-DBMWlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>. The default setting, <em>i.e.</em> the
switch is not provided is <tt class="docutils literal"><span class="pre">BMWlibs</span></tt> support is disabled. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><em>user libs</em></a>.</dd>
<dt><strong>-DBNMRlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>. The default setting,
<em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt> support is disabled.</dd>
<dt><strong>-Dqt_based_tools=&lt;value&gt;</strong></dt>
<dd>Will try to get <tt class="docutils literal"><span class="pre">musredit</span></tt>, <tt class="docutils literal"><span class="pre">musrWiz</span></tt>, <tt class="docutils literal"><span class="pre">musrStep</span></tt>, and <tt class="docutils literal"><span class="pre">mupp</span></tt> installed, if <tt class="docutils literal"><span class="pre">Qt</span></tt> is found.
By default this is enabled. Again &lt;value&gt;=0 means disabled, &lt;value&gt;=1 enabled.</dd>
<dt><strong>-Dqt_version=&lt;value&gt;</strong></dt>
<dd>Allows to specify which <tt class="docutils literal"><span class="pre">Qt</span></tt> version shall be tried. &lt;value&gt; can take the values: <tt class="docutils literal"><span class="pre">AUTO,</span> <span class="pre">3,</span> <span class="pre">4,</span> <span class="pre">5</span></tt>.
If the value is set to <tt class="docutils literal"><span class="pre">AUTO</span></tt>, this highest installed version is chosen, otherwise the specified version is used.</dd>
<dt><strong>-Dtry_OpenMP=&lt;value&gt;</strong></dt>
<dd>Will check if <tt class="docutils literal"><span class="pre">OpenMP</span></tt> support is possible, and if yes use it. The default is enabled</dd>
</dl>
<p>Normally it should not be necessary to make use of any of the options except for specifying the installation path with <tt class="docutils literal"><span class="pre">-DCMAKE_INSTALL_PREFIX</span></tt>.
<tt class="docutils literal"><span class="pre">musrfit</span></tt> build with <tt class="docutils literal"><span class="pre">cmake</span></tt> takes the <tt class="docutils literal"><span class="pre">out-of-source</span></tt> approach. Therefore a typical configuration / make / install process including
<tt class="docutils literal"><span class="pre">NeXus</span></tt> support would look like</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit
$ mkdir build
$ <span class="nb">cd</span> build
$ cmake ../ -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$ROOTSYS</span> -Dnexus<span class="o">=</span><span class="m">1</span>
<span class="c1"># below it is assumed that multiple cores are present, hence the -j8 option</span>
$ cmake --build ./ --clean-first -- -j8
$ make install
$ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div>
</div>
</div>
<div class="section" id="id28">
<h4>musrfit last step of the installation<a class="headerlink" href="#id28" title="Permalink to this headline"></a></h4>
<p>In order to finish the installation of <tt class="docutils literal"><span class="pre">musrfit</span></tt> two more things should be done:</p>
<ul class="simple">
<li>Define the <tt class="docutils literal"><span class="pre">MUSRFITPATH</span></tt> environment variable containing the path to the <tt class="docutils literal"><span class="pre">musrfit</span></tt> executables and <tt class="docutils literal"><span class="pre">XML</span></tt> files.
<em>E.g.</em> if the location of the example above is used append the following line to the <tt class="docutils literal"><span class="pre">~/.bashrc</span></tt> and <tt class="docutils literal"><span class="pre">~/.bash_profile</span></tt>
(and then either restart the shell or call the same commands once more from the shell):</li>
</ul>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
</pre></div>
</div>
<ul class="simple">
<li>Adjust the paths where <tt class="docutils literal"><span class="pre">musrfit</span></tt> will search for data files in the installed <tt class="docutils literal"><span class="pre">musrfit_startup.xml</span></tt>. For
detailed information on this XML file refer to the <a class="reference internal" href="user-manual.html#musrfit-startup"><em>manual</em></a>.</li>
</ul>
</div>
</div>
<div class="section" id="index-38">
<span id="id29"></span><h3>musredit<a class="headerlink" href="#index-38" title="Permalink to this headline"></a></h3>
<p>In the latest version of <tt class="docutils literal"><span class="pre">musrfit</span></tt> the configure script tries to determine automatically the highest
available Qt version. In case this is found, the editor <tt class="docutils literal"><span class="pre">musredit</span></tt> is built already together with <tt class="docutils literal"><span class="pre">musrfit</span></tt>.
If not, one can try to call the configure script with the <strong>&#8211;with-qt5</strong> option (<tt class="docutils literal"><span class="pre">automake</span></tt>). <tt class="docutils literal"><span class="pre">cmake</span></tt> will
determine everthing automatically. To install this editor separately, <em>i.e.</em> by “hand” do</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit/src/musredit_qt5
$ <span class="c1"># for some distributions you will need qmake-qt5 for the next command</span>
$ qmake musredit.pro
</pre></div>
</div>
<p>If everything went fine, <tt class="docutils literal"><span class="pre">musredit</span></tt> can be compiled and installed:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ make
$ make install
</pre></div>
</div>
<p>In case one does not like the executable <tt class="docutils literal"><span class="pre">musredit</span></tt> to be copied to the default installation directory
<tt class="docutils literal"><span class="pre">$ROOTSYS/bin</span></tt> the last make install can be skipped and the executable can be copied somewhere else instead.</p>
</div>
<div class="section" id="musrgui-obsolete">
<h3>musrgui (obsolete)<a class="headerlink" href="#musrgui-obsolete" title="Permalink to this headline"></a></h3>
<p>If Qt3 is set up the installation of the <tt class="docutils literal"><span class="pre">musrfit</span></tt> editor can be done as follows from within the shell:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> ~/Applications/musrfit/src/musrgui
$ qmake musrgui.pro
$ make
$ make install
</pre></div>
</div>
<p>The last command copies <tt class="docutils literal"><span class="pre">musrgui.app</span></tt> to the standard program directory <tt class="docutils literal"><span class="pre">/Applications</span></tt>.</p>
<p>Under some circumstances it might happen, that if <tt class="docutils literal"><span class="pre">musrgui</span></tt> was called from Finder the necessary libraries
for executing <tt class="docutils literal"><span class="pre">musrfit</span></tt> could not be found. In that case, the only workaround for the moment is to export
the environment variable <tt class="docutils literal"><span class="pre">DYLD_LIBRARY_PATH</span></tt> in the shell and call <tt class="docutils literal"><span class="pre">musrgui</span></tt> from a terminal! In order to
accomplish that, add the following lines to <tt class="docutils literal"><span class="pre">~/.profile</span></tt> and call <tt class="docutils literal"><span class="pre">musrgui</span></tt> with the specified command:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">DYLD_LIBRARY_PATH</span><span class="o">=</span>/opt/root-system/lib:/sw/lib:<span class="nv">$DYLD_LIBRARY_PATH</span>
<span class="nb">alias</span> <span class="nv">mgui</span><span class="o">=</span><span class="s1">&#39;/Applications/musrgui.app/Contents/MacOS/musrgui&#39;</span>
</pre></div>
</div>
</div>
<div class="section" id="id30">
<h3>Check the installation<a class="headerlink" href="#id30" title="Permalink to this headline"></a></h3>
<p>In order to perform a quick test for finding out if the installation has been completed successfully, a few msr
files together with the corresponding data files can be found in the musrfit source tree at <tt class="docutils literal"><span class="pre">doc/examples/</span></tt>.
If <tt class="docutils literal"><span class="pre">musrgui</span></tt> has been installed, just open one of the <tt class="docutils literal"><span class="pre">test-*.msr</span></tt> files in the editor and test the <tt class="docutils literal"><span class="pre">musrfit</span></tt>
functionalities. Otherwise, if only the terminal should be used, as an initial test for instance the following could be done:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> ~/Applications/musrfit/doc/examples
$ musrview test-histo-ROOT-NPP.msr
</pre></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms</a><ul>
<li><a class="reference internal" href="#supported-operating-systems-and-software-requirements">Supported Operating Systems and Software Requirements</a></li>
<li><a class="reference internal" href="#os-restrictions">OS Restrictions</a></li>
<li><a class="reference internal" href="#gnu-linux">GNU/Linux</a><ul>
<li><a class="reference internal" href="#requirements">Requirements</a><ul>
<li><a class="reference internal" href="#everything-but-root-and-nexus">Everything but ROOT and NeXus</a></li>
<li><a class="reference internal" href="#installation-of-nexus-requirements-optional">Installation of NeXus requirements (optional)</a></li>
<li><a class="reference internal" href="#index-16">ROOT</a></li>
</ul>
</li>
<li><a class="reference internal" href="#musrfit">musrfit</a><ul>
<li><a class="reference internal" href="#musrfit-build-with-automake">musrfit build with automake</a></li>
<li><a class="reference internal" href="#musrfit-build-with-cmake">musrfit build with cmake</a></li>
<li><a class="reference internal" href="#musrfit-last-step-of-the-installation">musrfit last step of the installation</a></li>
</ul>
</li>
<li><a class="reference internal" href="#musredit">musredit</a></li>
<li><a class="reference internal" href="#musrgui-obsolate">musrgui (obsolate)</a></li>
<li><a class="reference internal" href="#check-the-installation">Check the installation</a></li>
</ul>
</li>
<li><a class="reference internal" href="#ms-windows">MS Windows</a><ul>
<li><a class="reference internal" href="#id5">Requirements</a><ul>
<li><a class="reference internal" href="#setting-up-cygwin">Setting up Cygwin</a></li>
<li><a class="reference internal" href="#id6">Everything but ROOT and NeXus</a></li>
<li><a class="reference internal" href="#index-23">Installation of NeXus requirements (optional)</a></li>
<li><a class="reference internal" href="#index-24">ROOT</a></li>
</ul>
</li>
<li><a class="reference internal" href="#index-25">musrfit</a><ul>
<li><a class="reference internal" href="#index-26">musrfit build with automake</a></li>
<li><a class="reference internal" href="#index-27">musrfit build with cmake</a></li>
</ul>
</li>
<li><a class="reference internal" href="#index-28">musredit</a></li>
<li><a class="reference internal" href="#id13">musrgui (obsolate)</a></li>
<li><a class="reference internal" href="#id14">Check the installation</a></li>
<li><a class="reference internal" href="#potential-problems">Potential Problems</a></li>
</ul>
</li>
<li><a class="reference internal" href="#mac-os-x-macos">Mac OS X / macOS</a><ul>
<li><a class="reference internal" href="#requirements-macports">Requirements (MacPorts)</a><ul>
<li><a class="reference internal" href="#index-30">Installation of NeXus requirements (optional)</a></li>
<li><a class="reference internal" href="#index-31">ROOT</a></li>
</ul>
</li>
<li><a class="reference internal" href="#requirements-fink">Requirements (Fink)</a><ul>
<li><a class="reference internal" href="#index-33">Installation of NeXus requirements (optional)</a></li>
<li><a class="reference internal" href="#index-34">ROOT</a></li>
</ul>
</li>
<li><a class="reference internal" href="#index-35">musrfit</a><ul>
<li><a class="reference internal" href="#index-36">musrfit build with automake</a></li>
<li><a class="reference internal" href="#index-37">musrfit build with cmake</a></li>
<li><a class="reference internal" href="#id28">musrfit last step of the installation</a></li>
</ul>
</li>
<li><a class="reference internal" href="#index-38">musredit</a></li>
<li><a class="reference internal" href="#musrgui-obsolete">musrgui (obsolete)</a></li>
<li><a class="reference internal" href="#id30">Check the installation</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<h4>Previous topic</h4>
<p class="topless"><a href="user-libs.html"
title="previous chapter">Documentation of user libs (user functions)</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="setup-dks.html"
title="next chapter">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> / <tt class="docutils literal"><span class="pre">DKS</span></tt>: High Speed Fitting with GPU&#8217;s</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/setup-standard.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="setup-dks.html" title="Setting up musrfit / DKS: High Speed Fitting with GPUs"
>next</a> |</li>
<li class="right" >
<a href="user-libs.html" title="Documentation of user libs (user functions)"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.4.0 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>
</html>