Files
musrfit/doc/html/setup-standard.html

1046 lines
112 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>
<html class="writer-html5" lang="en" data-content_root="./">
<head>
<meta charset="utf-8" /><meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.9.9 documentation</title>
<link rel="stylesheet" type="text/css" href="_static/pygments.css?v=fa44fd50" />
<link rel="stylesheet" type="text/css" href="_static/css/theme.css?v=7a5cd723" />
<script src="_static/jquery.js?v=5d32c60e"></script>
<script src="_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
<script src="_static/documentation_options.js?v=4320943d"></script>
<script src="_static/doctools.js?v=9bcbadda"></script>
<script src="_static/sphinx_highlight.js?v=dc90522c"></script>
<script src="_static/js/theme.js"></script>
<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" />
<link href="_static/style.css" rel="stylesheet" type="text/css">
</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 role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" aria-label="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="Navigation menu">
<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="Mobile navigation menu" >
<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="Page navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html" class="icon icon-home" aria-label="Home"></a></li>
<li class="breadcrumb-item active">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">
<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="Link to this heading"></a></h1>
<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="Link to this heading"></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="admonition-title">Note</p>
<p>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="simple" id="index-2">
<dt><strong>boost C++ libraries</strong></dt><dd><p>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>).</p>
</dd>
</dl>
<dl class="simple" id="index-3">
<dt><strong>GNU Scientific Library</strong></dt><dd><p>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>).</p>
</dd>
</dl>
<dl class="simple" id="index-4">
<dt><strong>FFTW</strong></dt><dd><p>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>).</p>
</dd>
</dl>
<dl class="simple" id="index-5">
<dt><strong>ROOT</strong></dt><dd><p>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>).</p>
</dd>
</dl>
<dl class="simple" id="index-6">
<dt><strong>libxml2</strong></dt><dd><p>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>).</p>
</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="simple" id="index-7">
<dt><strong>HDF4</strong></dt><dd><p>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!</p>
</dd>
</dl>
<dl class="simple" id="index-8">
<dt><strong>HDF5</strong></dt><dd><p>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>).</p>
</dd>
</dl>
<dl class="simple" id="index-9">
<dt><strong>minixml</strong></dt><dd><p>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.</p>
</dd>
</dl>
<dl class="simple" id="index-10">
<dt><strong>NeXus</strong></dt><dd><p>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>).</p>
</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="simple" id="index-11">
<dt><strong>Qt</strong></dt><dd><p>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 still supported since some older distributions are not yet supporting Qt6. <strong>Qt6</strong> is the <em>main</em> development part. Should be available on all new major distributions.</p>
</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>
</section>
<section id="os-restrictions">
<span id="index-12"></span><h2>OS Restrictions<a class="headerlink" href="#os-restrictions" title="Link to this heading"></a></h2>
<p>Before the installation procedure will be described, please note the following restrictions:</p>
<dl class="simple">
<dt><strong>GNU/Linux</strong></dt><dd><p>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> (also <a class="reference external" href="https://almalinux.org/">Alma</a>, <a class="reference external" href="https://rockylinux.org/">Rocky</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 <a class="reference external" href="https://de.manjaro.org/">Manjaro</a>.</p>
</dd>
<dt><strong>Mac OS X/macOS</strong></dt><dd><p>No serious problems are currently known for macOS ≥ 10.6. <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> is Apple Silicon ready.</p>
</dd>
<dt><strong>MS Windows</strong></dt><dd><p>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="simple">
<li><p>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>).</p></li>
<li><p>via installation of the virtual machine on which you install Linux (probably the easiest for most Windows users).</p></li>
</ul>
</dd>
</dl>
</section>
<section id="gnu-linux">
<span id="index-13"></span><span id="id1"></span><h2>GNU/Linux<a class="headerlink" href="#gnu-linux" title="Link to this heading"></a></h2>
<section id="requirements">
<span id="gnu-linux-requirements"></span><span id="index-14"></span><h3>Requirements<a class="headerlink" href="#requirements" title="Link to this heading"></a></h3>
<section id="everything-but-root-and-nexus">
<h4>Everything but ROOT and NeXus<a class="headerlink" href="#everything-but-root-and-nexus" title="Link to this heading"></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>$<span class="w"> </span>yum<span class="w"> </span>install<span class="w"> </span>git<span class="w"> </span>cmake<span class="w"> </span>boost-devel<span class="w"> </span>gsl-devel<span class="w"> </span>fftw-devel<span class="w"> </span>libxml2-devel<span class="w"> </span>qt-devel<span class="w"> </span>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>$<span class="w"> </span>yum<span class="w"> </span>install<span class="w"> </span>epel-release
$<span class="w"> </span>yum<span class="w"> </span>install<span class="w"> </span>git<span class="w"> </span>cmake<span class="w"> </span>boost-devel<span class="w"> </span>gsl-devel<span class="w"> </span>fftw-devel<span class="w"> </span>libxml2-devel<span class="w"> </span>qt6-qtbase-devel<span class="w"> </span>qt6-qtsvg-devel
</pre></div>
</div>
</div></blockquote>
<p>If using <code class="docutils literal notranslate"><span class="pre">Qt5</span></code>, since e.g. Qt6 is not available, replace <code class="docutils literal notranslate"><span class="pre">qt6-qtbase-devel</span> <span class="pre">qt6-qtsvg-devel</span></code> by <code class="docutils literal notranslate"><span class="pre">qt5-qtbase-devel</span> <span class="pre">qt5-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>$<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>git<span class="w"> </span>cmake<span class="w"> </span>libboost-dev<span class="w"> </span>libboost-filesystem-dev<span class="w"> </span>libboost-system-dev<span class="w"> </span>libgsl-dev<span class="w"> </span>libfftw3-dev<span class="w"> </span>libxml2-dev<span class="w"> </span>libqt4-dev<span class="w"> </span>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>$<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>git<span class="w"> </span>cmake<span class="w"> </span>libboost-dev<span class="w"> </span>libboost-filesystem-dev<span class="w"> </span>libboost-system-dev<span class="w"> </span>libgsl-dev<span class="w"> </span>libfftw3-dev<span class="w"> </span>libxml2-dev<span class="w"> </span>qt6-base-dev<span class="w"> </span>qt6-svg-dev
</pre></div>
</div>
</div></blockquote>
<p>If using <code class="docutils literal notranslate"><span class="pre">Qt5</span></code>, since e.g. Qt6 is not available, replace <code class="docutils literal notranslate"><span class="pre">qt6-base-dev</span> <span class="pre">qt6-svg-dev</span></code> by <code class="docutils literal notranslate"><span class="pre">qtbase5-dev</span> <span class="pre">libqt5svg5-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>
</section>
<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="Link to this heading"></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>$<span class="w"> </span>yum<span class="w"> </span>install<span class="w"> </span>hdf-devel<span class="w"> </span>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>$<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>libhdf4-dev<span class="w"> </span>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="w"> </span><span class="nb">cd</span><span class="w"> </span>Downloads
$<span class="w"> </span><span class="c1"># create a directory for the NeXus source code</span>
$<span class="w"> </span>mkdir<span class="w"> </span>nexus
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>nexus
$<span class="w"> </span><span class="c1"># get the source code from the master repository</span>
$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/nexusformat/code.git
$<span class="w"> </span><span class="c1"># next we will build NeXus out-of-source</span>
$<span class="w"> </span>mkdir<span class="w"> </span>build
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>build
$<span class="w"> </span>cmake<span class="w"> </span>-DENABLE_HDF5<span class="o">=</span><span class="m">1</span><span class="w"> </span>-DENABLE_HDF4<span class="o">=</span><span class="m">1</span><span class="w"> </span>-DENABLE_MXML<span class="o">=</span><span class="m">0</span><span class="w"> </span>../code
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./<span class="w"> </span>--clean-first
$<span class="w"> </span><span class="c1"># install needs either to be carried out as root or sudo depending on your linux flavour.</span>
$<span class="w"> </span>sudo<span class="w"> </span>cmake<span class="w"> </span>--install<span class="w"> </span>./
</pre></div>
</div>
</section>
<section id="index-16">
<span id="id4"></span><h4>ROOT<a class="headerlink" href="#index-16" title="Link to this heading"></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>$<span class="w"> </span>yum<span class="w"> </span>install<span class="w"> </span>libX11-devel<span class="w"> </span>libXft-devel<span class="w"> </span>libXpm-devel<span class="w"> </span>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>$<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>libx11-dev<span class="w"> </span>libxft-dev<span class="w"> </span>libxpm-dev<span class="w"> </span>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="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>
$<span class="w"> </span><span class="c1"># creat the Apps directory if not already present</span>
$<span class="w"> </span>mkdir<span class="w"> </span>Apps
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>Apps
$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>http://github.com/root-project/root.git
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>root
$<span class="w"> </span>git<span class="w"> </span>tag<span class="w"> </span>-l
$<span class="w"> </span><span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-xx-yy</span>
$<span class="w"> </span><span class="c1"># where xx is the highest listed number, e.g. v6-32-08.</span>
$<span class="w"> </span><span class="c1"># use only even numbers of xx</span>
$<span class="w"> </span>git<span class="w"> </span>checkout<span class="w"> </span>-b<span class="w"> </span>v6-32-08<span class="w"> </span>v6-32-08
$<span class="w"> </span><span class="c1"># now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.</span>
$<span class="w"> </span><span class="c1"># since we are using cmake build now, first we will need to create the build directory.</span>
$<span class="w"> </span>mkdir<span class="w"> </span>root_build
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>root_build
$<span class="w"> </span>cmake<span class="w"> </span>../<span class="w"> </span>-Dgminimal<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dasimage<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dmathmore<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dxml<span class="o">=</span><span class="m">1</span><span class="w"> </span>-DCMAKE_INSTALL_PREFIX<span class="o">=</span>../root_exec
$<span class="w"> </span><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="w"> </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="w"> </span><span class="c1"># e.g. cmake --build ./ --clean-first -- -j8</span>
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./<span class="w"> </span>--clean-first
$<span class="w"> </span><span class="c1"># as a last step of the ROOT build process we need to install it</span>
$<span class="w"> </span>cmake<span class="w"> </span>--install<span class="w"> </span>./
</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>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="w"> </span><span class="nb">echo</span><span class="w"> </span><span class="s2">&quot;&lt;home&gt;/Apps/root/root_exec/lib&quot;</span><span class="w"> </span>&gt;&gt;<span class="w"> </span>/etc/ld.so.conf.d/cern-root.conf
$<span class="w"> </span>/sbin/ldconfig
</pre></div>
</div>
</li>
<li><p>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="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">ROOTSYS</span><span class="o">=</span><span class="nv">$HOME</span>/Apps/root/root_exec
$<span class="w"> </span><span class="nb">export</span><span class="w"> </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="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Apps/root
$<span class="w"> </span>git<span class="w"> </span>pull
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>root_build
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./<span class="w"> </span>--clean-first
</pre></div>
</div>
</section>
</section>
<section id="musrfit">
<span id="index-17"></span><h3>musrfit<a class="headerlink" href="#musrfit" title="Link to this heading"></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="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Apps
$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>https://bitbucket.org/muonspin/musrfit.git
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>musrfit
</pre></div>
</div>
<p>or</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Apps
$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>git://gitea.psi.ch:LMU/musrfit.git
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>musrfit
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>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="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Apps/musrfit
$<span class="w"> </span>git<span class="w"> </span>pull
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>build
$<span class="w"> </span>xargs<span class="w"> </span>rm<span class="w"> </span>&lt;<span class="w"> </span>install_manifest.txt
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./<span class="w"> </span>--clean-first
$<span class="w"> </span>cmake<span class="w"> </span>--install<span class="w"> </span>./
</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>
<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="Link to this heading"></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="simple">
<dt><strong>-DCMAKE_INSTALL_PREFIX=&lt;prefix-path&gt;</strong></dt><dd><p>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>).</p>
</dd>
<dt><strong>-Dnexus=&lt;value&gt;</strong></dt><dd><p>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.</p>
</dd>
<dt><strong>-DASlibs=&lt;value&gt;</strong></dt><dd><p>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>.</p>
</dd>
<dt><strong>-DBMWlibs=&lt;value&gt;</strong></dt><dd><p>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>.</p>
</dd>
<dt><strong>-DBNMRlibs=&lt;value&gt;</strong></dt><dd><p>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.</p>
</dd>
<dt><strong>-Dqt_based_tools=&lt;value&gt;</strong></dt><dd><p>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.</p>
</dd>
<dt><strong>-Dqt_version=&lt;value&gt;</strong></dt><dd><p>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.</p>
</dd>
<dt><strong>-Dtry_OpenMP=&lt;value&gt;</strong></dt><dd><p>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</p>
</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="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Apps/musrfit
$<span class="w"> </span>mkdir<span class="w"> </span>build
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>build
$<span class="w"> </span>cmake<span class="w"> </span>../<span class="w"> </span>-DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$ROOTSYS</span><span class="w"> </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>
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./<span class="w"> </span>--clean-first<span class="w"> </span>--<span class="w"> </span>-j8
$<span class="w"> </span>cmake<span class="w"> </span>--install<span class="w"> </span>./
$<span class="w"> </span>/sbin/ldconfig<span class="w"> </span><span class="c1"># (as superuser)</span>
</pre></div>
</div>
</section>
<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="Link to this heading"></a></h4>
<p>In order to finish the installation of musrfit two more things should be done:</p>
<blockquote>
<div><ul>
<li><p>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="w"> </span><span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
</pre></div>
</div>
</li>
<li><p>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>
</section>
</section>
<section id="musredit">
<span id="index-20"></span><h3>musredit<a class="headerlink" href="#musredit" title="Link to this heading"></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>
</section>
<section id="musrgui-deprecated">
<h3>musrgui (deprecated)<a class="headerlink" href="#musrgui-deprecated" title="Link to this heading"></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>
</section>
<section id="check-the-installation">
<h3>Check the installation<a class="headerlink" href="#check-the-installation" title="Link to this heading"></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="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Apps/musrfit/doc/examples
$<span class="w"> </span>musrview<span class="w"> </span>test-histo-ROOT-NPP.msr
</pre></div>
</div>
</section>
</section>
<section id="ms-windows">
<h2>MS Windows<a class="headerlink" href="#ms-windows" title="Link to this heading"></a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>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="admonition-title">Note</p>
<p>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="admonition-title">Note</p>
<p>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>
</section>
<section id="mac-os-x-macos">
<h2>Mac OS X / macOS<a class="headerlink" href="#mac-os-x-macos" title="Link to this heading"></a></h2>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>macOS 15 alias <strong>Sequoia</strong>: <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> is ready for <strong>Sequoia</strong> on Intel <strong>and</strong> 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>Sequoia</strong> is ready as well.
This is true for the <em>Homebrew</em>, <em>MacPorts</em> still has some issues (as of 23.09.24). Typically this should be fixed in a month.</p>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>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="admonition-title">Warning</p>
<p>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>
<section id="requirements-macports">
<span id="index-21"></span><h3>Requirements (MacPorts)<a class="headerlink" href="#requirements-macports" title="Link to this heading"></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>
<dt><strong>Xcode</strong></dt><dd><p>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="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>xcode-select<span class="w"> </span>--install
$<span class="w"> </span>sudo<span class="w"> </span>xcodebuild<span class="w"> </span>-license
</pre></div>
</div>
</dd>
</dl>
</div></blockquote>
<dl class="simple">
<dt><strong>X11</strong></dt><dd><p>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.</p>
</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>$<span class="w"> </span>sudo<span class="w"> </span>port<span class="w"> </span>-v<span class="w"> </span>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>Get a local version of the repository:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>svn<span class="w"> </span>co<span class="w"> </span>http://svn.macports.org/repository/macports/trunk/dports<span class="w"> </span>~/dports
</pre></div>
</div>
</li>
<li><p>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>Synchronize the packages:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>sudo<span class="w"> </span>port<span class="w"> </span>-v<span class="w"> </span>-d<span class="w"> </span>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>$<span class="w"> </span>sudo<span class="w"> </span>port<span class="w"> </span>-v<span class="w"> </span>install<span class="w"> </span>pkgconfig<span class="w"> </span>autoconf<span class="w"> </span>automake<span class="w"> </span>libtool<span class="w"> </span>cmake<span class="w"> </span>libomp<span class="w"> </span>fftw-3<span class="w"> </span>fftw-3-single<span class="w"> </span>gsl<span class="w"> </span>boost<span class="w"> </span>libxml2<span class="w"> </span>qt6<span class="w"> </span>qt6-qtsvg
</pre></div>
</div>
<p>With <code class="docutils literal notranslate"><span class="pre">Qt6</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>
<section id="index-22">
<span id="id6"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-22" title="Link to this heading"></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>$<span class="w"> </span>sudo<span class="w"> </span>port<span class="w"> </span>-v<span class="w"> </span>install<span class="w"> </span>hdf4<span class="w"> </span>hdf5
</pre></div>
</div>
<p><em>hdf4</em> is likely not available anymore.</p>
<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="w"> </span><span class="c1"># get and install NeXus</span>
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Applications
$<span class="w"> </span><span class="c1"># get the source code from the master repository</span>
$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/nexusformat/code.git<span class="w"> </span>nexus/code
$<span class="w"> </span><span class="c1"># next we will build NeXus out-of-source</span>
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>nexus
$<span class="w"> </span>mkdir<span class="w"> </span>build
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>build
$<span class="w"> </span><span class="c1"># in case hdf4 is present</span>
$<span class="w"> </span>cmake<span class="w"> </span>-DENABLE_HDF5<span class="o">=</span><span class="m">1</span><span class="w"> </span>-DENABLE_HDF4<span class="o">=</span><span class="m">1</span><span class="w"> </span>-DENABLE_MXML<span class="o">=</span><span class="m">0</span><span class="w"> </span>../code
$<span class="w"> </span><span class="c1"># in case hdf4 is **not** present</span>
$<span class="w"> </span>cmake<span class="w"> </span>-DENABLE_HDF5<span class="o">=</span><span class="m">1</span><span class="w"> </span>-DENABLE_HDF4<span class="o">=</span><span class="m">0</span><span class="w"> </span>-DENABLE_MXML<span class="o">=</span><span class="m">0</span><span class="w"> </span>../code
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./
$<span class="w"> </span>sudo<span class="w"> </span>cmake<span class="w"> </span>--install<span class="w"> </span>./
</pre></div>
</div>
</section>
<section id="index-23">
<span id="id7"></span><h4>ROOT<a class="headerlink" href="#index-23" title="Link to this heading"></a></h4>
<p><strong>The default ROOT version is based on ROOT 6.xx/yy!</strong></p>
<section id="root-installed-via-package-installer">
<h5>ROOT installed via package installer<a class="headerlink" href="#root-installed-via-package-installer" title="Link to this heading"></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="w"> </span><span class="nb">cd</span><span class="w"> </span>/Applications
$<span class="w"> </span>sudo<span class="w"> </span>chown<span class="w"> </span>-R<span class="w"> </span>&lt;username&gt;<span class="w"> </span>root_v6.22.00
$<span class="w"> </span>sudo<span class="w"> </span>chgrp<span class="w"> </span>-R<span class="w"> </span>staff<span class="w"> </span>root_v6.22.00
$<span class="w"> </span>sudo<span class="w"> </span>ln<span class="w"> </span>-s<span class="w"> </span>root_v6.22.00<span class="w"> </span>root
</pre></div>
</div>
</section>
<section id="root-installed-from-source">
<h5>ROOT installed from source<a class="headerlink" href="#root-installed-from-source" title="Link to this heading"></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="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Applications
$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>http://github.com/root-project/root.git
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>root
$<span class="w"> </span>git<span class="w"> </span>tag<span class="w"> </span>-l
$<span class="w"> </span><span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-xx-yy</span>
$<span class="w"> </span><span class="c1"># where xx is the highest listed number, e.g. v6-32-08.</span>
$<span class="w"> </span><span class="c1"># use only even numbers of xx</span>
$<span class="w"> </span>git<span class="w"> </span>checkout<span class="w"> </span>-b<span class="w"> </span>v6-32-08<span class="w"> </span>v6-32-08
$<span class="w"> </span><span class="c1"># now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.</span>
$<span class="w"> </span><span class="c1"># We will use the cmake out-of-source approach here.</span>
$<span class="w"> </span>mkdir<span class="w"> </span>root_build
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>root_build
$<span class="w"> </span>cmake<span class="w"> </span>../<span class="w"> </span>-Dgminimal<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dasimage<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dmathmore<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dxml<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dopengl<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dbuiltin_glew<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Ddataframe<span class="o">=</span><span class="m">1</span><span class="w"> </span>-DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
$<span class="w"> </span><span class="c1"># next will be the make. If running on a multicore CPU you can speed up tremendously by calling</span>
$<span class="w"> </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="w"> </span><span class="c1"># e.g. make -j8</span>
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./<span class="w"> </span>--clean-first<span class="w"> </span>--<span class="w"> </span>-j8
$<span class="w"> </span><span class="c1"># make will take quite a while</span>
$<span class="w"> </span>cmake<span class="w"> </span>--install<span class="w"> </span>./
</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>
</section>
<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="Link to this heading"></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="w"> </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="w"> </span><span class="nt">&lt;key&gt;</span>MUSRFITPATH<span class="nt">&lt;/key&gt;</span>
<span class="w"> </span><span class="nt">&lt;string&gt;</span>$HOME/Applications/root/root_exec/bin<span class="nt">&lt;/string&gt;</span><span class="w"> </span>(where<span class="w"> </span>to<span class="w"> </span>find<span class="w"> </span>the<span class="w"> </span>musrfit<span class="w"> </span>executables)
<span class="w"> </span><span class="nt">&lt;key&gt;</span>QTDIR<span class="nt">&lt;/key&gt;</span>
<span class="w"> </span><span class="nt">&lt;string&gt;</span>/opt/local/lib/qt3mac<span class="nt">&lt;/string&gt;</span><span class="w"> </span>(where<span class="w"> </span>to<span class="w"> </span>find<span class="w"> </span>Qt3<span class="w"> </span>(for<span class="w"> </span>musrgui)<span class="w"> </span>or<span class="w"> </span>Qt4<span class="w"> </span>(for<span class="w"> </span>musredit))
<span class="w"> </span><span class="nt">&lt;key&gt;</span>ROOTSYS<span class="nt">&lt;/key&gt;</span>
<span class="w"> </span><span class="nt">&lt;string&gt;</span>$HOME/Applications/root/root_exec<span class="nt">&lt;/string&gt;</span><span class="w"> </span>(where<span class="w"> </span>to<span class="w"> </span>find<span class="w"> </span>the<span class="w"> </span>ROOT<span class="w"> </span>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">~/.zprofile</span></code>:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </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="w"> </span><span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
<span class="nb">export</span><span class="w"> </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="w"> </span><span class="nv">DYLD_LIBRARY_PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/lib:/usr/local/lib:<span class="nv">$DYLD_LIBRARY_PATH</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>ROOTSYS<span class="w"> </span><span class="nv">$ROOTSYS</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>MUSRFITPATH<span class="w"> </span><span class="nv">$MUSRFITPATH</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>PATH<span class="w"> </span><span class="nv">$PATH</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>DYLD_LIBRARY_PATH<span class="w"> </span><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">.zprofile</span></code> or <code class="docutils literal notranslate"><span class="pre">.profile</span></code> before proceeding:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span><span class="nb">source</span><span class="w"> </span><span class="nv">$HOME</span>/.profile
</pre></div>
</div>
</section>
</section>
<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="Link to this heading"></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>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>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>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>$<span class="w"> </span>port<span class="w"> </span>-s<span class="w"> </span>install<span class="w"> </span>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>
</section>
</section>
<section id="requirements-homebrew">
<span id="index-24"></span><h3>Requirements (Homebrew)<a class="headerlink" href="#requirements-homebrew" title="Link to this heading"></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>
<dt><strong>Xcode</strong></dt><dd><p>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="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span>xcode-select<span class="w"> </span>--install
$<span class="w"> </span>sudo<span class="w"> </span>xcodebuild<span class="w"> </span>-license
</pre></div>
</div>
</dd>
<dt><strong>X11</strong></dt><dd><p>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.</p>
</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">libomp</span> <span class="n">boost</span> <span class="n">gsl</span> <span class="n">fftw</span> <span class="n">qt6</span> <span class="p">(</span><span class="n">root</span><span class="p">)</span>
</pre></div>
</div>
<p>The preferred installation of root would be from source (see below), hence it is set here in parenthesis.
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>$<span class="w"> </span>brew<span class="w"> </span>install<span class="w"> </span>cmake
</pre></div>
</div>
<section id="index-25">
<span id="id9"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-25" title="Link to this heading"></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>$<span class="w"> </span>brew<span class="w"> </span>install<span class="w"> </span>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="w"> </span><span class="c1"># build NeXus</span>
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>..
$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>https://github.com/nexusformat/code.git<span class="w"> </span>nexus/code
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>nexus
$<span class="w"> </span><span class="c1"># build NeXus out-of-source</span>
$<span class="w"> </span>mkdir<span class="w"> </span>build
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>build
$<span class="w"> </span>cmake<span class="w"> </span>../code<span class="w"> </span>-DENABLE_HDF5<span class="o">=</span><span class="m">1</span><span class="w"> </span>-DENABLE_HDF4<span class="o">=</span><span class="m">0</span><span class="w"> </span>-DENABLE_MXML<span class="o">=</span><span class="m">0</span>
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./<span class="w"> </span>--clean-first<span class="w"> </span>--<span class="w"> </span>-j8
$<span class="w"> </span>sudo<span class="w"> </span>cmake<span class="w"> </span>--install<span class="w"> </span>./
</pre></div>
</div>
</section>
<section id="index-26">
<span id="id10"></span><h4>ROOT<a class="headerlink" href="#index-26" title="Link to this heading"></a></h4>
<p><strong>The default ROOT version is based on ROOT 6.xx/yy!</strong></p>
<section id="root-installed-via-homebrew">
<h5>ROOT installed via Homebrew<a class="headerlink" href="#root-installed-via-homebrew" title="Link to this heading"></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>
</section>
<section id="id11">
<h5>ROOT installed from source<a class="headerlink" href="#id11" title="Link to this heading"></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="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Applications
$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>http://github.com/root-project/root.git
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>root
$<span class="w"> </span>git<span class="w"> </span>tag<span class="w"> </span>-l
$<span class="w"> </span><span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-xx-yy</span>
$<span class="w"> </span><span class="c1"># where xx is the highest listed number, e.g. v6-32-08.</span>
$<span class="w"> </span><span class="c1"># use only even numbers of xx</span>
$<span class="w"> </span>git<span class="w"> </span>checkout<span class="w"> </span>-b<span class="w"> </span>v6-32<span class="w"> </span>v6-32-08
$<span class="w"> </span><span class="c1"># now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.</span>
$<span class="w"> </span><span class="c1"># We will use the cmake out-of-source approach here.</span>
$<span class="w"> </span>mkdir<span class="w"> </span>root_build
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>root_build
$<span class="w"> </span>cmake<span class="w"> </span>../<span class="w"> </span>-Dgminimal<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dasimage<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dmathmore<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dxml<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dopengl<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Dbuiltin_glew<span class="o">=</span><span class="m">1</span><span class="w"> </span>-Ddataframe<span class="o">=</span><span class="m">1</span><span class="w"> </span>-DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
$<span class="w"> </span><span class="c1"># next will be the make. If running on a multicore CPU you can speed up tremendously by calling</span>
$<span class="w"> </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="w"> </span><span class="c1"># e.g. make -j8</span>
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./<span class="w"> </span>--clean-first<span class="w"> </span>--<span class="w"> </span>-j8
$<span class="w"> </span><span class="c1"># make will take quite a while</span>
$<span class="w"> </span>cmake<span class="w"> </span>--install<span class="w"> </span>./
</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>
</section>
<section id="id13">
<h5>Setting up Environment Variables for ROOT and musrfit<a class="headerlink" href="#id13" title="Link to this heading"></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="w"> </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="w"> </span><span class="nt">&lt;key&gt;</span>MUSRFITPATH<span class="nt">&lt;/key&gt;</span>
<span class="w"> </span><span class="nt">&lt;string&gt;</span>$HOME/Applications/root/root_exec/bin<span class="nt">&lt;/string&gt;</span><span class="w"> </span>(where<span class="w"> </span>to<span class="w"> </span>find<span class="w"> </span>the<span class="w"> </span>musrfit<span class="w"> </span>executables)
<span class="w"> </span><span class="nt">&lt;key&gt;</span>QTDIR<span class="nt">&lt;/key&gt;</span>
<span class="w"> </span><span class="nt">&lt;string&gt;</span>/opt/local/lib/qt3mac<span class="nt">&lt;/string&gt;</span><span class="w"> </span>(where<span class="w"> </span>to<span class="w"> </span>find<span class="w"> </span>Qt3<span class="w"> </span>(for<span class="w"> </span>musrgui)<span class="w"> </span>or<span class="w"> </span>Qt4<span class="w"> </span>(for<span class="w"> </span>musredit))
<span class="w"> </span><span class="nt">&lt;key&gt;</span>ROOTSYS<span class="nt">&lt;/key&gt;</span>
<span class="w"> </span><span class="nt">&lt;string&gt;</span>$HOME/Applications/root/root_exec<span class="nt">&lt;/string&gt;</span><span class="w"> </span>(where<span class="w"> </span>to<span class="w"> </span>find<span class="w"> </span>the<span class="w"> </span>ROOT<span class="w"> </span>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">~/.zprofile</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="w"> </span><span class="nv">ROOTSYS</span><span class="o">=</span>/usr/local
<span class="nb">export</span><span class="w"> </span><span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
<span class="nb">export</span><span class="w"> </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="w"> </span><span class="nv">DYLD_LIBRARY_PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/lib/root:/usr/local/lib:<span class="nv">$DYLD_LIBRARY_PATH</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>ROOTSYS<span class="w"> </span><span class="nv">$ROOTSYS</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>MUSRFITPATH<span class="w"> </span><span class="nv">$MUSRFITPATH</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>PATH<span class="w"> </span><span class="nv">$PATH</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>DYLD_LIBRARY_PATH<span class="w"> </span><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="w"> </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="w"> </span><span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
<span class="nb">export</span><span class="w"> </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="w"> </span><span class="nv">LD_LIBRARY_PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/lib:/usr/local/lib:<span class="nv">$LD_LIBRARY_PATH</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>ROOTSYS<span class="w"> </span><span class="nv">$ROOTSYS</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>MUSRFITPATH<span class="w"> </span><span class="nv">$MUSRFITPATH</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>PATH<span class="w"> </span><span class="nv">$PATH</span>
launchctl<span class="w"> </span>setenv<span class="w"> </span>LD_LIBRARY_PATH<span class="w"> </span><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="w"> </span><span class="nb">source</span><span class="w"> </span><span class="nv">$HOME</span>/.zprofile
</pre></div>
</div>
</section>
</section>
</section>
<section id="index-27">
<span id="id14"></span><h3>musrfit<a class="headerlink" href="#index-27" title="Link to this heading"></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="w"> </span><span class="nb">cd</span><span class="w"> </span>~/Applications
$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>https://bitbucket.org/muonspin/musrfit.git
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>musrfit
</pre></div>
</div>
<p>or</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>~/Applications
$<span class="w"> </span>git<span class="w"> </span>clone<span class="w"> </span>git://gitea.psi.ch:LMU/musrfit.git
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </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="w"> </span><span class="nb">cd</span><span class="w"> </span>~/Applications/musrfit
$<span class="w"> </span>git<span class="w"> </span>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>
<section id="index-28">
<span id="id15"></span><h4>musrfit build with cmake<a class="headerlink" href="#index-28" title="Link to this heading"></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="simple">
<dt><strong>-DCMAKE_INSTALL_PREFIX=&lt;prefix-path&gt;</strong></dt><dd><p>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>).</p>
</dd>
<dt><strong>-Dnexus=&lt;value&gt;</strong></dt><dd><p>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.</p>
</dd>
<dt><strong>-DASlibs=&lt;value&gt;</strong></dt><dd><p>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>.</p>
</dd>
<dt><strong>-DBMWlibs=&lt;value&gt;</strong></dt><dd><p>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>.</p>
</dd>
<dt><strong>-DBNMRlibs=&lt;value&gt;</strong></dt><dd><p>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.</p>
</dd>
<dt><strong>-Dqt_based_tools=&lt;value&gt;</strong></dt><dd><p>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.</p>
</dd>
<dt><strong>-Dqt_version=&lt;value&gt;</strong></dt><dd><p>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.</p>
</dd>
<dt><strong>-Dtry_OpenMP=&lt;value&gt;</strong></dt><dd><p>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</p>
</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.</p>
<p>In order to have <strong>OpenMP</strong> available, which allows parallel processing of the fitter, you will need to guide <code class="docutils literal notranslate"><span class="pre">cmake</span></code> to where it can find it. For a <code class="docutils literal notranslate"><span class="pre">Homebrew</span></code> installation, this would be</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">OpenMP_ROOT</span><span class="o">=</span><span class="k">$(</span>brew<span class="w"> </span>--prefix<span class="k">)</span>/opt/libomp
</pre></div>
</div>
<p>and for a <code class="docutils literal notranslate"><span class="pre">MacPorts</span></code> installation, something like</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span><span class="nb">export</span><span class="w"> </span><span class="nv">OpenMP_ROOT</span><span class="o">=</span>/opt/local/lib/libomp
</pre></div>
</div>
<p>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="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Apps/musrfit
$<span class="w"> </span>mkdir<span class="w"> </span>build
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>build
$<span class="w"> </span>cmake<span class="w"> </span>../<span class="w"> </span>-DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$ROOTSYS</span><span class="w"> </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>
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./<span class="w"> </span>--clean-first<span class="w"> </span>--<span class="w"> </span>-j8
$<span class="w"> </span>cmake<span class="w"> </span>--install<span class="w"> </span>./
$<span class="w"> </span>/sbin/ldconfig<span class="w"> </span><span class="c1"># (as superuser)</span>
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If you use <code class="docutils literal notranslate"><span class="pre">MacPorts</span></code> you will likely need to guide cmake where to find <code class="docutils literal notranslate"><span class="pre">qt6</span></code>.
You will need to provide the path to the necessary <code class="docutils literal notranslate"><span class="pre">cmake</span></code> files. This is done
from the command line via the switch <code class="docutils literal notranslate"><span class="pre">CMAKE_PREFIX_PATH</span></code>.
The configuration, build, and install process might look like this:</p>
</div>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span><span class="nv">$HOME</span>/Apps/musrfit
$<span class="w"> </span>mkdir<span class="w"> </span>build
$<span class="w"> </span><span class="nb">cd</span><span class="w"> </span>build
$<span class="w"> </span>cmake<span class="w"> </span>../<span class="w"> </span>-DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$ROOTSYS</span><span class="w"> </span>-Dnexus<span class="o">=</span><span class="m">1</span><span class="w"> </span>-DCMAKE_PREFIX_PATH<span class="o">=</span><span class="s2">&quot;/opt/local/libexec/qt6/lib/cmake;/opt/local/include/libomp&quot;</span>
<span class="c1"># below it is assumed that multiple cores are present, hence the -j8 option</span>
$<span class="w"> </span>cmake<span class="w"> </span>--build<span class="w"> </span>./<span class="w"> </span>--clean-first<span class="w"> </span>--<span class="w"> </span>-j8
$<span class="w"> </span>cmake<span class="w"> </span>--install<span class="w"> </span>./
$<span class="w"> </span>/sbin/ldconfig<span class="w"> </span><span class="c1"># (as superuser)</span>
</pre></div>
</div>
</section>
<section id="id16">
<h4>musrfit last step of the installation<a class="headerlink" href="#id16" title="Link to this heading"></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><p>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):</p></li>
</ul>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span><span class="nb">export</span><span class="w"> </span><span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
</pre></div>
</div>
<ul class="simple">
<li><p>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>
</section>
</section>
<section id="index-29">
<span id="id17"></span><h3>musredit<a class="headerlink" href="#index-29" title="Link to this heading"></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>.</p>
</section>
<section id="musrgui-obsolete">
<h3>musrgui (obsolete)<a class="headerlink" href="#musrgui-obsolete" title="Link to this heading"></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="w"> </span><span class="nb">cd</span><span class="w"> </span>~/Applications/musrfit/src/musrgui
$<span class="w"> </span>qmake<span class="w"> </span>musrgui.pro
$<span class="w"> </span>make
$<span class="w"> </span>make<span class="w"> </span>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="w"> </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="w"> </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>
</section>
<section id="id18">
<h3>Check the installation<a class="headerlink" href="#id18" title="Link to this heading"></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="w"> </span><span class="nb">cd</span><span class="w"> </span>~/Applications/musrfit/doc/examples
$<span class="w"> </span>musrview<span class="w"> </span>test-histo-ROOT-NPP.msr
</pre></div>
</div>
</section>
</section>
</section>
</div>
</div>
<footer><div class="rst-footer-buttons" role="navigation" aria-label="Footer">
<a href="user-libs.html" class="btn btn-neutral float-left" title="Documentation of user libs (user functions)" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
<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" aria-hidden="true"></span></a>
</div>
<hr/>
<div role="contentinfo">
<p>&#169; Copyright 2025, Andreas Suter.
<span class="lastupdated">Last updated on Jun 07, 2025.
</span></p>
</div>
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script>
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>