musrfit/doc/html/setup-standard.html

1145 lines
96 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>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.9.1 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.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" />
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> musrfit
</a>
<div class="version">
1.9
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="cite.html">How to Cite <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>?</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="user-manual.html">User manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="user-libs.html">Documentation of user libs (user functions)</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Setting up <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> on Different Platforms</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#supported-operating-systems-and-software-requirements">Supported Operating Systems and Software Requirements</a></li>
<li class="toctree-l2"><a class="reference internal" href="#os-restrictions">OS Restrictions</a></li>
<li class="toctree-l2"><a class="reference internal" href="#gnu-linux">GNU/Linux</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#requirements">Requirements</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#everything-but-root-and-nexus">Everything but ROOT and NeXus</a></li>
<li class="toctree-l4"><a class="reference internal" href="#installation-of-nexus-requirements-optional">Installation of NeXus requirements (optional)</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-16">ROOT</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#musrfit">musrfit</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#musrfit-build-with-cmake">musrfit build with cmake</a></li>
<li class="toctree-l4"><a class="reference internal" href="#musrfit-last-step-of-the-installation">musrfit last step of the installation</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#musredit">musredit</a></li>
<li class="toctree-l3"><a class="reference internal" href="#musrgui-deprecated">musrgui (deprecated)</a></li>
<li class="toctree-l3"><a class="reference internal" href="#check-the-installation">Check the installation</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#ms-windows">MS Windows</a></li>
<li class="toctree-l2"><a class="reference internal" href="#mac-os-x-macos">Mac OS X / macOS</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#requirements-macports">Requirements (MacPorts)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#index-22">Installation of NeXus requirements (optional)</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-23">ROOT</a></li>
<li class="toctree-l4"><a class="reference internal" href="#notes-on-macos-catalina-and-newer">Notes on macOS Catalina and newer</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#requirements-homebrew">Requirements (Homebrew)</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#index-25">Installation of NeXus requirements (optional)</a></li>
<li class="toctree-l4"><a class="reference internal" href="#index-26">ROOT</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#index-27">musrfit</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#index-28">musrfit build with cmake</a></li>
<li class="toctree-l4"><a class="reference internal" href="#id16">musrfit last step of the installation</a></li>
</ul>
</li>
<li class="toctree-l3"><a class="reference internal" href="#index-29">musredit</a></li>
<li class="toctree-l3"><a class="reference internal" href="#musrgui-obsolete">musrgui (obsolete)</a></li>
<li class="toctree-l3"><a class="reference internal" href="#id18">Check the installation</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="setup-dks.html">Setting up <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> / <code class="docutils literal notranslate"><span class="pre">DKS</span></code>: High Speed Fitting with GPUs</a></li>
<li class="toctree-l1"><a class="reference internal" href="musredit.html"><code class="docutils literal notranslate"><span class="pre">musredit</span></code>: the GUI Based Interface to <code class="docutils literal notranslate"><span class="pre">musrfit</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">musrfit</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Setting up <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> on Different Platforms</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/setup-standard.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="setting-up-musrfit-on-different-platforms">
<span id="musrfit-setup"></span><span id="index-0"></span><h1>Setting up <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> 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"><span class="std std-ref">musrfit</span></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> (<code class="docutils literal notranslate"><span class="pre">gcc</span></code>, <code class="docutils literal notranslate"><span class="pre">g++</span></code>), the build tool <a class="reference external" href="https://cmake.org/">cmake</a> is needed. Furthermore the helper
tool <a class="reference external" href="http://pkg-config.freedesktop.org/wiki/">pkg-config</a> needs to be in place, 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 <code class="docutils literal notranslate"><span class="pre">C</span></code> and <code class="docutils literal notranslate"><span class="pre">C++</span></code> 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 <code class="docutils literal notranslate"><span class="pre">C</span></code> 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 <code class="docutils literal notranslate"><span class="pre">XML</span> <span class="pre">C</span></code> 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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> 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>). <code class="docutils literal notranslate"><span class="pre">HDF4</span></code> is “outdated” and its support will soon be dropped. The single only reason why it is still required is that ISIS is not able to cope to implement HDF5 V2 of the NeXus muon instrument specification which has been agreed in 2012!</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 <code class="docutils literal notranslate"><span class="pre">XML</span></code> library that can be used to read and write <code class="docutils literal notranslate"><span class="pre">XML</span></code> and <code class="docutils literal notranslate"><span class="pre">XML</span></code>-like data files. <em>Required version ≥ 2.2</em> (see <a class="reference external" href="http://www.minixml.org/">minixml</a>).
Currently the <code class="docutils literal notranslate"><span class="pre">MXML</span></code> support in <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> is broken and hence you will <strong>not</strong> need to install <code class="docutils literal notranslate"><span class="pre">minixml</span></code> for the time being.</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 <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> / <code class="docutils literal notranslate"><span class="pre">musredit</span></code> 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>). Currently the <strong>Qt5</strong> is the main development part. Qt6 just kicked in, but is not widely available yet.</dd>
</dl>
<p>Each of the following sections focusing on the installation of <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> 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>,
and <cite>manjaro &lt;https://de.manjaro.org/&gt;</cite>.</dd>
<dt><strong>Mac OS X/macOS</strong></dt>
<dd>No serious problems are currently known for macOS ≥ 10.6. <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> is ARM M1 ready.</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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> running are:</p>
<ul class="last simple">
<li>via installation of Linux via the Microsoft App store for Windows 10/11 (see <a class="reference external" href="https://docs.microsoft.com/en-us/windows/wsl/install">Install Linux on Windows with WSL</a>).</li>
<li>via installation of the virtual machine on which you install Linux (probably the easiest for most Windows users).</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 except <code class="docutils literal notranslate"><span class="pre">ROOT/CERN</span></code> and <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> 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 $ it is the shell prompt of your system):</p>
<p>For <strong>Qt4</strong> (deprecated):</p>
<blockquote>
<div><div class="highlight-bash notranslate"><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/Qt6</strong>:</p>
<blockquote>
<div><div class="highlight-bash notranslate"><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
</pre></div>
</div>
</div></blockquote>
<p>If using <code class="docutils literal notranslate"><span class="pre">Qt6</span></code> replace <code class="docutils literal notranslate"><span class="pre">qt5-qtbase-devel</span> <span class="pre">qt5-qtsvg-devel</span></code> by <code class="docutils literal notranslate"><span class="pre">qt6-qtbase-devel</span> <span class="pre">qt6-qtsvg-devel</span></code></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> (deprecated):</p>
<blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ apt-get install git cmake libboost-dev libboost-filesystem-dev libboost-system-dev libgsl-dev libfftw3-dev libxml2-dev libqt4-dev libqtwebkit-dev
</pre></div>
</div>
</div></blockquote>
<p>For <strong>Qt5/Qt6</strong>:</p>
<blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ apt-get install git cmake libboost-dev libboost-filesystem-dev libboost-system-dev libgsl-dev libfftw3-dev libxml2-dev qt5-default qtbase5-dev libqt5svg5-dev
</pre></div>
</div>
</div></blockquote>
<p>If using <code class="docutils literal notranslate"><span class="pre">Qt6</span></code> replace <code class="docutils literal notranslate"><span class="pre">qt5-default</span> <span class="pre">qtbase5-dev</span> <span class="pre">libqt5svg5-dev</span></code> by <code class="docutils literal notranslate"><span class="pre">qt6-default</span> <span class="pre">qtbase6-dev</span> <span class="pre">libqt6svg6-dev</span></code></p>
<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 “install software on linux”…</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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> should support reading/writing data files in the <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> format the further required
software has to be set up. The required libraries and header files could either be available through the users
GNU/Linux distribution or if this is not the case, the packages can be installed from the source code. In principle
NeXus should support <code class="docutils literal notranslate"><span class="pre">MXML</span></code>, <code class="docutils literal notranslate"><span class="pre">HDF4</span></code>, and <code class="docutils literal notranslate"><span class="pre">HDF5</span></code>. At the time of this writing, the <code class="docutils literal notranslate"><span class="pre">MXML</span></code> support in the
NeXus project is broken, and <code class="docutils literal notranslate"><span class="pre">HDF4</span></code> is outdated on most platforms, yet since ISIS/RAL is still <strong>not</strong> up-to-date <code class="docutils literal notranslate"><span class="pre">HDF4</span></code> still
needs to be dragged on (comment: if you are a ISIS user, please complain about <code class="docutils literal notranslate"><span class="pre">HDF4</span></code>). Hence, the necessary packages to build <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> are <code class="docutils literal notranslate"><span class="pre">HDF4</span></code> and <code class="docutils literal notranslate"><span class="pre">HDF5</span></code>. This means, for a rpm-package based distro try something like:</p>
<blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ yum install hdf-devel hdf5-devel
</pre></div>
</div>
</div></blockquote>
<p>and on a deb-package based distro try something like:</p>
<blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ apt-get install libhdf4-dev libhdf5-dev
</pre></div>
</div>
</div></blockquote>
<p><strong>Only NeXus Version ≥ 4.4 is support!</strong></p>
<p>Even though there might exist binary packages for the <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> 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 <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> compiled from source (lines starting with # are comments <em>only</em>):</p>
<div class="highlight-bash notranslate"><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
$ 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">0</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>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 by <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>, 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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>. <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 <code class="docutils literal notranslate"><span class="pre">libX11-devel</span></code>, <code class="docutils literal notranslate"><span class="pre">libXft-devel</span></code>, <code class="docutils literal notranslate"><span class="pre">libXpm-devel</span></code>, and <code class="docutils literal notranslate"><span class="pre">libXext-devel</span></code>:</p>
<div class="highlight-bash notranslate"><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 <code class="docutils literal notranslate"><span class="pre">libx11-dev</span></code>, <code class="docutils literal notranslate"><span class="pre">libxft-dev</span></code>, <code class="docutils literal notranslate"><span class="pre">libxpm-dev</span></code>, and <code class="docutils literal notranslate"><span class="pre">libxext-dev</span></code>:</p>
<div class="highlight-bash notranslate"><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"><span class="std std-ref">Required Software</span></a> (<em>e.g.</em> fftw, gsl, <em>etc</em>).</p>
<p>In the following it is assumed that <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> shall be installed under <code class="docutils literal notranslate"><span class="pre">$HOME/Apps</span></code>. 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 $ will be given, the command prompt. Do not enter it! Also some comments will
be added starting with a # which can be omitted. They are only there to explain what is going on.</p>
<div class="highlight-bash notranslate"><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://github.com/root-project/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-22-06</span>
$ <span class="c1"># or the latest official release number</span>
$ git checkout -b v6-22-06 v6-22-06
$ <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 <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> installation, therefore the following is suggested:</p>
<ul>
<li><p class="first">As superuser create a file <code class="docutils literal notranslate"><span class="pre">/etc/ld.so.conf.d/cern-root.conf</span></code> where the path to the lib directory of <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> is
added and call <code class="docutils literal notranslate"><span class="pre">/sbin/ldconfig</span></code> afterwards. In the example mentioned above one way of doing this is
(<code class="docutils literal notranslate"><span class="pre">&lt;home&gt;</span></code> has to be the path to your home, <em>e.g.</em> <code class="docutils literal notranslate"><span class="pre">/home/luke_skywalker</span></code>):</p>
<div class="highlight-bash notranslate"><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 <code class="docutils literal notranslate"><span class="pre">~/.bashrc</span></code> and/or <code class="docutils literal notranslate"><span class="pre">~/.bash_profile</span></code>
(<code class="docutils literal notranslate"><span class="pre">~./profile</span></code> 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 notranslate"><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 notranslate"><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 you can proceed with the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> installatio. First, the most
recent source code should be downloaded. The preferred way of doing so is to clone the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> repository via git.
Assuming the code should be located in <code class="docutils literal notranslate"><span class="pre">$HOME/Apps</span></code> this is achieved most easily calling from the terminal</p>
<div class="highlight-bash notranslate"><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="nb">cd</span> musrfit
</pre></div>
</div>
<p>or</p>
<div class="highlight-bash notranslate"><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="nb">cd</span> musrfit
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">after cloning the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> repo you will automatically be on the
<code class="docutils literal notranslate"><span class="pre">root6</span></code> 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 notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit
$ git pull
$ <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-cmake">
<span id="index-18"></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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> 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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> shall be installed, <em>e.g.</em> <code class="docutils literal notranslate"><span class="pre">$ROOTSYS</span></code> if already defined (by default: <code class="docutils literal notranslate"><span class="pre">/usr/local</span></code>).</dd>
<dt><strong>-Dnexus=&lt;value&gt;</strong></dt>
<dd>enable/disable the support of <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> data files (requires the <code class="docutils literal notranslate"><span class="pre">HDF4</span></code>, <code class="docutils literal notranslate"><span class="pre">HDF5</span></code> and <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> libraries to be installed).
&lt;value&gt;=1 enables <code class="docutils literal notranslate"><span class="pre">NeXus</span></code>, &lt;value&gt;=0 disables <code class="docutils literal notranslate"><span class="pre">NeXus</span></code>. The default setting, <em>i.e.</em> the switch is not provided is <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> support is disabled.</dd>
<dt><strong>-DASlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <code class="docutils literal notranslate"><span class="pre">ASlibs</span></code>. &lt;value&gt;=1 enables the <code class="docutils literal notranslate"><span class="pre">ASlibs</span></code>, &lt;value&gt;=0 disables the <code class="docutils literal notranslate"><span class="pre">ASlibs</span></code>. The default setting, <em>i.e.</em> the
switch is not provided is <code class="docutils literal notranslate"><span class="pre">ASlibs</span></code> support is disabled. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><span class="std std-ref">user libs</span></a>.</dd>
<dt><strong>-DBMWlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <code class="docutils literal notranslate"><span class="pre">BMWlibs</span></code>. &lt;value&gt;=1 enables the <code class="docutils literal notranslate"><span class="pre">BMWlibs</span></code>, &lt;value&gt;=0 disables the <code class="docutils literal notranslate"><span class="pre">BMWlibs</span></code>. The default setting, <em>i.e.</em> the
switch is not provided is <code class="docutils literal notranslate"><span class="pre">BMWlibs</span></code> support is disabled. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><span class="std std-ref">user libs</span></a>.</dd>
<dt><strong>-DBNMRlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <code class="docutils literal notranslate"><span class="pre">BNMRlibs</span></code>. &lt;value&gt;=1 enables the <code class="docutils literal notranslate"><span class="pre">BNMRlibs</span></code>, &lt;value&gt;=0 disables the <code class="docutils literal notranslate"><span class="pre">BNMRlibs</span></code>. The default setting,
<em>i.e.</em> the switch is not provided is <code class="docutils literal notranslate"><span class="pre">BNMRlibs</span></code> support is disabled.</dd>
<dt><strong>-Dqt_based_tools=&lt;value&gt;</strong></dt>
<dd>Will try to get <code class="docutils literal notranslate"><span class="pre">musredit</span></code>, <code class="docutils literal notranslate"><span class="pre">musrWiz</span></code>, <code class="docutils literal notranslate"><span class="pre">musrStep</span></code>, and <code class="docutils literal notranslate"><span class="pre">mupp</span></code> installed, if <code class="docutils literal notranslate"><span class="pre">Qt</span></code> 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 <code class="docutils literal notranslate"><span class="pre">Qt</span></code> version shall be tried. &lt;value&gt; can take the values: <code class="docutils literal notranslate"><span class="pre">AUTO,</span> <span class="pre">3,</span> <span class="pre">4,</span> <span class="pre">5,</span> <span class="pre">6</span></code>.
If the value is set to <code class="docutils literal notranslate"><span class="pre">AUTO</span></code>, 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 <code class="docutils literal notranslate"><span class="pre">OpenMP</span></code> 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 <code class="docutils literal notranslate"><span class="pre">-DCMAKE_INSTALL_PREFIX</span></code>.
<code class="docutils literal notranslate"><span class="pre">musrfit</span></code> build with <code class="docutils literal notranslate"><span class="pre">cmake</span></code> takes the <code class="docutils literal notranslate"><span class="pre">out-of-source</span></code> approach. Therefore a typical configuration / make / install process including
<code class="docutils literal notranslate"><span class="pre">NeXus</span></code> support would look like</p>
<div class="highlight-bash notranslate"><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-19"></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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> executables and <code class="docutils literal notranslate"><span class="pre">XML</span></code> files.
<em>E.g.</em> if the location of the example above is used append the following line to the <code class="docutils literal notranslate"><span class="pre">~/.bashrc</span></code> and
<code class="docutils literal notranslate"><span class="pre">~/.bash_profile</span></code> (and then either restart the shell, source the file, or call the same commands once more from the shell):</p>
<div class="highlight-bash notranslate"><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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> will search for data files in the installed <code class="docutils literal notranslate"><span class="pre">musrfit_startup.xml</span></code>. For
detailed information on this XML file refer to the <a class="reference internal" href="user-manual.html#musrfit-startup"><span class="std std-ref">manual</span></a>.</p>
</li>
</ul>
</div></blockquote>
</div>
</div>
<div class="section" id="musredit">
<span id="index-20"></span><h3>musredit<a class="headerlink" href="#musredit" title="Permalink to this headline"></a></h3>
<p>In the latest version of <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> the configure script tries to determine automatically the highest available <code class="docutils literal notranslate"><span class="pre">Qt</span></code> version.
In case this is found, the editor <code class="docutils literal notranslate"><span class="pre">musredit</span></code> is built already together with <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>.</p>
</div>
<div class="section" id="musrgui-deprecated">
<h3>musrgui (deprecated)<a class="headerlink" href="#musrgui-deprecated" title="Permalink to this headline"></a></h3>
<p>If <code class="docutils literal notranslate"><span class="pre">Qt4.6</span></code> or higher is not available but <code class="docutils literal notranslate"><span class="pre">Qt3</span></code> is set up <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> can be installed. For this please
follow the instructions for the <code class="docutils literal notranslate"><span class="pre">musredit</span></code> installation where simply every <code class="docutils literal notranslate"><span class="pre">musredit</span></code> occurrence has to
be replaced by <code class="docutils literal notranslate"><span class="pre">musrgui</span></code>. If there are problems during the <code class="docutils literal notranslate"><span class="pre">qmake</span></code> step, <em>e.g.</em>
“uic: File generated with too old version of Qt Designer”, this most probably means the <code class="docutils literal notranslate"><span class="pre">Qt4</span></code> version of <code class="docutils literal notranslate"><span class="pre">qmake</span></code>
is being used. In order to use the <code class="docutils literal notranslate"><span class="pre">Qt3</span></code> 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 <code class="docutils literal notranslate"><span class="pre">/usr/lib/qt-3.3/bin/qmake</span></code>.</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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> source tree at <code class="docutils literal notranslate"><span class="pre">doc/examples/</span></code>.
If <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> has been installed, just open one of the <code class="docutils literal notranslate"><span class="pre">test-*.msr</span></code> files in the editor and test the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>
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 notranslate"><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">For adventurous guys using Windows 10/11, there is the possibility to activate the built in Ubuntu bash-shell. It allows
to install <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> as described in the Linux section. For details to setup the Linux sub-system for MS Windows
see <a class="reference external" href="https://docs.microsoft.com/en-us/windows/wsl/install">Install Linux on Windows with WSL</a>.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Another possibility is to setup linux as a virtual machine with VirtualBox are other alike tools. This way you separate
Linux / ROOT / musrfit from the default MS Windows system.</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 <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> or <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> 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 <code class="docutils literal notranslate"><span class="pre">...\My</span> <span class="pre">Documents\...</span></code></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>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">macOS 13 alias <strong>Ventura</strong>: <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> is ready for <strong>Ventura</strong> on Intel <strong>and</strong> M1 (Apple Silicon) based macs, both running natively.
The <code class="docutils literal notranslate"><span class="pre">DKS</span></code> version of <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> for macOS <strong>Ventura</strong> is ready as well.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Starting from macOS Catalina some acpects are slightly different compared to older macOS versions, so if it happens that you have installed
one of these last versions, please first check <a class="reference internal" href="#note-on-catalina"><span class="std std-ref">Notes on macOS Catalina and newer</span></a> before you proceed.</p>
</div>
<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="https://brew.sh/">Homebrew</a> — which provides open-source software is employed to fulfill the basic software requirements of <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>.
In the following, both possibilities (using MacPorts or Homebrew) are described but it is emphasized here that
it should be followed only <em>one</em> of the possible routes .</p>
<div class="admonition warning">
<p class="first admonition-title">Warning</p>
<p class="last">If you decide to upgrade your macOS, e.g. from <code class="docutils literal notranslate"><span class="pre">High</span> <span class="pre">Sierra</span></code> to <code class="docutils literal notranslate"><span class="pre">Mojave</span></code>, you will typically need to
unistall <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>, <code class="docutils literal notranslate"><span class="pre">ROOT</span></code>, and <a class="reference external" href="https://www.macports.org/">MacPorts</a> / <a class="reference external" href="https://brew.sh/">Homebrew</a> first, do the upgrade of the macOS and start the
installation of <a class="reference external" href="https://www.macports.org/">MacPorts</a> / <a class="reference external" href="https://brew.sh/">Homebrew</a> , <code class="docutils literal notranslate"><span class="pre">ROOT</span></code>, and <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> from scratch!</p>
</div>
<div class="section" id="requirements-macports">
<span id="index-21"></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 <code class="docutils literal notranslate"><span class="pre">MacPorts</span></code> 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 <code class="docutils literal notranslate"><span class="pre">XCode</span></code> ≥ 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 notranslate"><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 <a class="reference external" href="http://xquartz.macosforge.org/trac">XQuartz</a>. If <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> runs without <code class="docutils literal notranslate"><span class="pre">XQuartz</span></code> <em>do not</em>
install it.</dd>
</dl>
<p>After installing the <code class="docutils literal notranslate"><span class="pre">Xcode</span></code> 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 <code class="docutils literal notranslate"><span class="pre">/opt/local</span></code>. 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 notranslate"><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 notranslate"><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 <code class="docutils literal notranslate"><span class="pre">/opt/local/etc/macports/sources.conf</span></code>: At the end of the file, comment the line beginning with <code class="docutils literal notranslate"><span class="pre">rsync://</span></code> and
add a new line pointing to your local copy, <em>e.g.</em></p>
<div class="highlight-bash notranslate"><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 notranslate"><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 notranslate"><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
</pre></div>
</div>
<p>With <code class="docutils literal notranslate"><span class="pre">Qt5</span></code>, <code class="docutils literal notranslate"><span class="pre">musredit</span></code> will be installed. If it happens that you used <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> in the past,
please change over to <code class="docutils literal notranslate"><span class="pre">musredit</span></code> since there will be no further development for <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> anymore!</p>
<div class="section" id="index-22">
<span id="id6"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-22" title="Permalink to this headline"></a></h4>
<p><em>Only</em> if <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> should support reading data files in the <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> format the further required packages are set up:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ sudo port -v install hdf4 hdf5
</pre></div>
</div>
<p><strong>Only NeXus Version ≥ 4.4 is support!</strong></p>
<p>To get things compiled do:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <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">0</span> ../code
$ make
$ sudo make install
</pre></div>
</div>
</div>
<div class="section" id="index-23">
<span id="id7"></span><h4>ROOT<a class="headerlink" href="#index-23" title="Permalink to this headline"></a></h4>
<p><strong>The default ROOT version is based on 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 <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> installed is via package installer. If your macOS is directly supported
by the <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> people you can download the package installer from the <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> <a class="reference external" href="https://root.cern.ch/downloading-root">download page</a>.
Choose the latest <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> 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 <code class="docutils literal notranslate"><span class="pre">root_v6.16.00.macosx64-10.13-clang91.dmg</span></code>. After the installation
<code class="docutils literal notranslate"><span class="pre">ROOT</span></code> will be installed under <code class="docutils literal notranslate"><span class="pre">/Application</span></code> 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 <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> directory:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /Applications
$ sudo chown -R &lt;username&gt; root_v6.22.00
$ sudo chgrp -R staff root_v6.22.00
$ sudo ln -s root_v6.22.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 <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> exactly the way needed for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> 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"><span class="std std-ref">Requested Software</span></a> (<em>e.g.</em> <code class="docutils literal notranslate"><span class="pre">fftw</span></code>, <code class="docutils literal notranslate"><span class="pre">gsl</span></code>, etc).</p>
<p>For the following it is assumed that <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> shall be installed under <code class="docutils literal notranslate"><span class="pre">$HOME/Applications</span></code>. 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 $ will be given, the command prompt. Do not enter it! Also some
comments will be added starting with a # which can be omitted. They are only there to explain what is going on.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Applications
$ git clone http://github.com/root-project/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-xx-yy</span>
$ <span class="c1"># where xx is the highest listed number, e.g. v6-22-06</span>
$ git checkout -b v6-22-06 v6-22-06
$ <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><span class="m">1</span> -Dasimage<span class="o">=</span><span class="m">1</span> -Dmathmore<span class="o">=</span><span class="m">1</span> -Dminuit2<span class="o">=</span><span class="m">1</span> -Dxml<span class="o">=</span><span class="m">1</span> -Dopengl<span class="o">=</span><span class="m">1</span> -Dbuiltin_glew<span class="o">=</span><span class="m">1</span> -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 <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> installation and to prepare already the installation of <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> and <code class="docutils literal notranslate"><span class="pre">musredit</span></code>
this is a good time for setting necessary environment variables for the use in Mac OS X. Here it assumed that you
installed <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> 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 <code class="docutils literal notranslate"><span class="pre">~/.MacOSX/environment.plist</span></code> and re-login:</p>
<div class="highlight-xml notranslate"><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 <code class="docutils literal notranslate"><span class="pre">~/.profile</span></code>:</p>
<div class="highlight-bash notranslate"><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">DYLD_LIBRARY_PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/lib:<span class="nv">$DYLD_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 DYLD_LIBRARY_PATH <span class="nv">$DYLD_LIBRARY_PATH</span>
</pre></div>
</div>
<p>After this you will need to “execute” <code class="docutils literal notranslate"><span class="pre">.profile</span></code> or <code class="docutils literal notranslate"><span class="pre">.zprofile</span></code> before proceeding:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">source</span> <span class="nv">$HOME</span>/.profile
</pre></div>
</div>
</div>
</div>
<div class="section" id="notes-on-macos-catalina-and-newer">
<span id="note-on-catalina"></span><h4>Notes on macOS Catalina and newer<a class="headerlink" href="#notes-on-macos-catalina-and-newer" title="Permalink to this headline"></a></h4>
<p>Apple introduced a couple of changes starting from macOS Catalina compared to its previous versions of macOS which might
be a stumble block. Here I <strong>very</strong> briefly try to add some notes in order to get a smooth installation for
<code class="docutils literal notranslate"><span class="pre">musrfit</span></code>.</p>
<ol class="arabic">
<li><p class="first">You should switch from the bash to the zsh. Please check, e.g. <a class="reference external" href="https://scriptingosx.com/2019/06/moving-to-zsh/">Moving to zsh</a>.</p>
</li>
<li><p class="first">Instead of <code class="docutils literal notranslate"><span class="pre">.profile</span></code> you will need to setup a <code class="docutils literal notranslate"><span class="pre">.zprofile</span></code>.</p>
</li>
<li><p class="first">macports: currently there is a little nuisance with the <code class="docutils literal notranslate"><span class="pre">fftw-3</span></code> port. My bug report is already out since a while
but no proper fix is available. The workaround to get it right is to install the port from source which is done by</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ port -s install fftw-3
</pre></div>
</div>
<p>If you fail to do so, you might trigger a crash in the Fourier transform for 2^N, N=12.</p>
</li>
</ol>
</div>
</div>
<div class="section" id="requirements-homebrew">
<span id="index-24"></span><h3>Requirements (Homebrew)<a class="headerlink" href="#requirements-homebrew" title="Permalink to this headline"></a></h3>
<p>Before proceeding with the usage of <a class="reference external" href="https://brew.sh/">Homebrew</a>, 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 <code class="docutils literal notranslate"><span class="pre">XCode</span></code> ≥ 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 notranslate"><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 <a class="reference external" href="http://xquartz.macosforge.org/trac">XQuartz</a>. If <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> runs without <code class="docutils literal notranslate"><span class="pre">XQuartz</span></code> <em>do not</em>
install it.</dd>
</dl>
<p>After installing the <code class="docutils literal notranslate"><span class="pre">Xcode</span></code> tools go to the <a class="reference external" href="https://brew.sh/">Homebrew</a> page, and follow the installation instructions there.</p>
<p>The essential packages (called formulae) which you will need to install are</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cmake</span> <span class="n">boost</span> <span class="n">gsl</span> <span class="n">fftw</span> <span class="n">qt6</span> <span class="n">root</span>
</pre></div>
</div>
<p>For example to install <code class="docutils literal notranslate"><span class="pre">cmake</span></code> this is done the following way:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ brew install cmake
</pre></div>
</div>
<div class="section" id="index-25">
<span id="id9"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-25" title="Permalink to this headline"></a></h4>
<p><em>Only</em> if <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> should support reading data files in the <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> format the further required
packages can be installed through Homebrew (Note: <code class="docutils literal notranslate"><span class="pre">hdf4</span></code> is not supported anymore):</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ brew install hdf5
</pre></div>
</div>
<p>Unfortunately, the <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> libraries have to be compiled and installed directly from
the source code. Given the respective version number 4.4 (which are subject to change with time)
this can be achieved for example by:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="c1"># 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_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_HDF4<span class="o">=</span><span class="m">0</span> -DENABLE_MXML<span class="o">=</span><span class="m">0</span>
$ cmake --build ./ --clean-first -- -j8
$ sudo make install
</pre></div>
</div>
</div>
<div class="section" id="index-26">
<span id="id10"></span><h4>ROOT<a class="headerlink" href="#index-26" title="Permalink to this headline"></a></h4>
<p><strong>The default ROOT version is based on ROOT 6.xx/yy!</strong></p>
<div class="section" id="root-installed-via-homebrew">
<h5>ROOT installed via Homebrew<a class="headerlink" href="#root-installed-via-homebrew" title="Permalink to this headline"></a></h5>
<p>If you have installed <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> via the Homebrew formula, you are done with the <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> part here
and can go straight the the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> setup below.</p>
</div>
<div class="section" id="id11">
<h5>ROOT installed from source<a class="headerlink" href="#id11" title="Permalink to this headline"></a></h5>
<p>The best way to get <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> exactly the way needed for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> 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"><span class="std std-ref">Requested Software</span></a> (<em>e.g.</em> <code class="docutils literal notranslate"><span class="pre">fftw</span></code>, <code class="docutils literal notranslate"><span class="pre">gsl</span></code>, etc).</p>
<p>For the following it is assumed that <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> shall be installed under <code class="docutils literal notranslate"><span class="pre">$HOME/Applications</span></code>. 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 $ will be given, the command prompt. Do not enter it! Also some
comments will be added starting with a # which can be omitted. They are only there to explain what is going on.</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Applications
$ git clone http://github.com/root-project/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-xx-yy</span>
$ <span class="c1"># where xx is the highest listed number, e.g. v6-26-04</span>
$ git checkout -b v6-26 v6-26-04
$ <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><span class="m">1</span> -Dasimage<span class="o">=</span><span class="m">1</span> -Dmathmore<span class="o">=</span><span class="m">1</span> -Dminuit2<span class="o">=</span><span class="m">1</span> -Dxml<span class="o">=</span><span class="m">1</span> -Dopengl<span class="o">=</span><span class="m">1</span> -Dbuiltin_glew<span class="o">=</span><span class="m">1</span> -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="id13">
<h5>Setting up Environment Variables for ROOT and musrfit<a class="headerlink" href="#id13" 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 <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> installation and to prepare already the installation of <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> and <code class="docutils literal notranslate"><span class="pre">musredit</span></code>
this is a good time for setting necessary environment variables for the use in Mac OS X. Here it assumed that you
installed <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> 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 <code class="docutils literal notranslate"><span class="pre">~/.MacOSX/environment.plist</span></code> and re-login:</p>
<div class="highlight-xml notranslate"><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 <code class="docutils literal notranslate"><span class="pre">~/.profile</span></code>:</p>
<p>If <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> has been installed via Homebrew:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">ROOTSYS</span><span class="o">=</span>/usr/local
<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">DYLD_LIBRARY_PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/lib/root:<span class="nv">$DYLD_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 DYLD_LIBRARY_PATH <span class="nv">$DYLD_LIBRARY_PATH</span>
</pre></div>
</div>
<p>If <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> has been installed via source/compilation:</p>
<div class="highlight-bash notranslate"><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 “execute” <code class="docutils literal notranslate"><span class="pre">.zprofile</span></code> before proceeding:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">source</span> <span class="nv">$HOME</span>/.zprofile
</pre></div>
</div>
</div>
</div>
</div>
<div class="section" id="index-27">
<span id="id14"></span><h3>musrfit<a class="headerlink" href="#index-27" 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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> repository via git. Assuming the code should be located
in <code class="docutils literal notranslate"><span class="pre">~/Applications/musrfit</span></code> this is achieved most easily calling from the termin</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> ~/Applications
$ git clone https://bitbucket.org/muonspin/musrfit.git
$ <span class="nb">cd</span> musrfit
</pre></div>
</div>
<p>or</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> ~/Applications
$ git clone git://gitlab.psi.ch/nemu/musrfit.git
$ <span class="nb">cd</span> musrfit
</pre></div>
</div>
<p>If a local repository clone is already present, one can update it using:</p>
<div class="highlight-bash notranslate"><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-28">
<span id="id15"></span><h4>musrfit build with cmake<a class="headerlink" href="#index-28" title="Permalink to this headline"></a></h4>
<p>Currently the following configuration switches for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> 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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> shall be installed, <em>e.g.</em> <code class="docutils literal notranslate"><span class="pre">$ROOTSYS</span></code> if already defined (by default: <code class="docutils literal notranslate"><span class="pre">/usr/local</span></code>).</dd>
<dt><strong>-Dnexus=&lt;value&gt;</strong></dt>
<dd>enable/disable the support of <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> data files (requires the <code class="docutils literal notranslate"><span class="pre">HDF4</span></code>, <code class="docutils literal notranslate"><span class="pre">HDF5</span></code> and <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> libraries to be installed).
&lt;value&gt;=1 enables <code class="docutils literal notranslate"><span class="pre">NeXus</span></code>, &lt;value&gt;=0 disables <code class="docutils literal notranslate"><span class="pre">NeXus</span></code>. The default setting, <em>i.e.</em> the switch is not provided is <code class="docutils literal notranslate"><span class="pre">NeXus</span></code> support is disabled.</dd>
<dt><strong>-DASlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <code class="docutils literal notranslate"><span class="pre">ASlibs</span></code>. &lt;value&gt;=1 enables the <code class="docutils literal notranslate"><span class="pre">ASlibs</span></code>, &lt;value&gt;=0 disables the <code class="docutils literal notranslate"><span class="pre">ASlibs</span></code>. The default setting, <em>i.e.</em> the
switch is not provided is <code class="docutils literal notranslate"><span class="pre">ASlibs</span></code> support is disabled. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><span class="std std-ref">user libs</span></a>.</dd>
<dt><strong>-DBMWlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <code class="docutils literal notranslate"><span class="pre">BMWlibs</span></code>. &lt;value&gt;=1 enables the <code class="docutils literal notranslate"><span class="pre">BMWlibs</span></code>, &lt;value&gt;=0 disables the <code class="docutils literal notranslate"><span class="pre">BMWlibs</span></code>. The default setting, <em>i.e.</em> the
switch is not provided is <code class="docutils literal notranslate"><span class="pre">BMWlibs</span></code> support is disabled. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><span class="std std-ref">user libs</span></a>.</dd>
<dt><strong>-DBNMRlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <code class="docutils literal notranslate"><span class="pre">BNMRlibs</span></code>. &lt;value&gt;=1 enables the <code class="docutils literal notranslate"><span class="pre">BNMRlibs</span></code>, &lt;value&gt;=0 disables the <code class="docutils literal notranslate"><span class="pre">BNMRlibs</span></code>. The default setting,
<em>i.e.</em> the switch is not provided is <code class="docutils literal notranslate"><span class="pre">BNMRlibs</span></code> support is disabled.</dd>
<dt><strong>-Dqt_based_tools=&lt;value&gt;</strong></dt>
<dd>Will try to get <code class="docutils literal notranslate"><span class="pre">musredit</span></code>, <code class="docutils literal notranslate"><span class="pre">musrWiz</span></code>, <code class="docutils literal notranslate"><span class="pre">musrStep</span></code>, and <code class="docutils literal notranslate"><span class="pre">mupp</span></code> installed, if <code class="docutils literal notranslate"><span class="pre">Qt</span></code> 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 <code class="docutils literal notranslate"><span class="pre">Qt</span></code> version shall be tried. &lt;value&gt; can take the values: <code class="docutils literal notranslate"><span class="pre">AUTO,</span> <span class="pre">3,</span> <span class="pre">4,</span> <span class="pre">5,</span> <span class="pre">6</span></code>.
If the value is set to <code class="docutils literal notranslate"><span class="pre">AUTO</span></code>, 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 <code class="docutils literal notranslate"><span class="pre">OpenMP</span></code> 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 <code class="docutils literal notranslate"><span class="pre">-DCMAKE_INSTALL_PREFIX</span></code>.
<code class="docutils literal notranslate"><span class="pre">musrfit</span></code> build with <code class="docutils literal notranslate"><span class="pre">cmake</span></code> takes the <code class="docutils literal notranslate"><span class="pre">out-of-source</span></code> approach. Therefore a typical configuration / make / install process including
<code class="docutils literal notranslate"><span class="pre">NeXus</span></code> support would look like</p>
<div class="highlight-bash notranslate"><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="id16">
<h4>musrfit last step of the installation<a class="headerlink" href="#id16" title="Permalink to this headline"></a></h4>
<p>In order to finish the installation of <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> two more things should be done:</p>
<ul class="simple">
<li>Define the <code class="docutils literal notranslate"><span class="pre">MUSRFITPATH</span></code> environment variable containing the path to the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> executables and <code class="docutils literal notranslate"><span class="pre">XML</span></code> files.
<em>E.g.</em> if the location of the example above is used append the following line to the <code class="docutils literal notranslate"><span class="pre">~/.bashrc</span></code> and <code class="docutils literal notranslate"><span class="pre">~/.bash_profile</span></code>
(and then either restart the shell or call the same commands once more from the shell):</li>
</ul>
<div class="highlight-bash notranslate"><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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> will search for data files in the installed <code class="docutils literal notranslate"><span class="pre">musrfit_startup.xml</span></code>. For
detailed information on this XML file refer to the <a class="reference internal" href="user-manual.html#musrfit-startup"><span class="std std-ref">manual</span></a>.</li>
</ul>
</div>
</div>
<div class="section" id="index-29">
<span id="id17"></span><h3>musredit<a class="headerlink" href="#index-29" title="Permalink to this headline"></a></h3>
<p>In the latest version of <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> the configure script tries to determine automatically the highest
available Qt version. In case this is found, the editor <code class="docutils literal notranslate"><span class="pre">musredit</span></code> is built already together with <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>.
If not, try the following:</p>
<div class="highlight-bash notranslate"><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, <code class="docutils literal notranslate"><span class="pre">musredit</span></code> can be compiled and installed:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ make
$ make install
</pre></div>
</div>
<p>In case one does not like the executable <code class="docutils literal notranslate"><span class="pre">musredit</span></code> to be copied to the default installation directory
<code class="docutils literal notranslate"><span class="pre">$ROOTSYS/bin</span></code> 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 <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> editor can be done as follows from within the shell:</p>
<div class="highlight-bash notranslate"><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 <code class="docutils literal notranslate"><span class="pre">musrgui.app</span></code> to the standard program directory <code class="docutils literal notranslate"><span class="pre">/Applications</span></code>.</p>
<p>Under some circumstances it might happen, that if <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> was called from Finder the necessary libraries
for executing <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> could not be found. In that case, the only workaround for the moment is to export
the environment variable <code class="docutils literal notranslate"><span class="pre">DYLD_LIBRARY_PATH</span></code> in the shell and call <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> from a terminal! In order to
accomplish that, add the following lines to <code class="docutils literal notranslate"><span class="pre">~/.profile</span></code> and call <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> with the specified command:</p>
<div class="highlight-bash notranslate"><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="id18">
<h3>Check the installation<a class="headerlink" href="#id18" 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 <code class="docutils literal notranslate"><span class="pre">doc/examples/</span></code>.
If <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> has been installed, just open one of the <code class="docutils literal notranslate"><span class="pre">test-*.msr</span></code> files in the editor and test the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>
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 notranslate"><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>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="setup-dks.html" class="btn btn-neutral float-right" title="Setting up musrfit / DKS: High Speed Fitting with GPUs" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="user-libs.html" class="btn btn-neutral" title="Documentation of user libs (user functions)" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</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="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>