musrfit/doc/html/user/MUSR/MusrFitSetup.html
2016-04-28 11:12:49 +02:00

928 lines
79 KiB
HTML

<!DOCTYPE html><html lang="en">
<!-- Mirrored from intranet.psi.ch/MUSR/MusrFitSetup?cover=print by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 28 Apr 2016 07:39:42 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8"><!-- /Added by HTTrack -->
<head>
<link rel="stylesheet" href="../pub/System/HeadlinesPlugin/style.css" type="text/css" media="all" />
<title> MUSR :: MusrFitSetup</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1.5, user-scalable=yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-status-bar-style" content="black-translucent" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
<link rel="icon" href="../pub/Main/WebPreferences/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="../pub/Main/WebPreferences/favicon.ico" type="image/x-icon" />
<link rel="alternate" href="https://intranet.psi.ch/wiki/bin/edit/MUSR/MusrFitSetup?t=1461829165" type="application/x-wiki" title="edit MusrFitSetup" />
<meta name="TEXT_NUM_TOPICS" content="Number of topics:" />
<meta name="TEXT_MODIFY_SEARCH" content="Modify search" />
<meta name="robots" content="noindex" /><link rel="alternate" type="application/rss+xml" title="RSS Feed" href="WebRsshtml.html" />
<base /><!--[if IE]></base><![endif]--><link class='head FOOTNOTEPLUGIN_LINKCSS' rel="stylesheet" href="../pub/System/FootNotePlugin/styles.css" type="text/css" media="all" /><!--FOOTNOTEPLUGIN_LINKCSS-->
<link class='head JQUERYPLUGIN::COMMENT' rel='stylesheet' href='../pub/System/CommentPlugin/commentf5b6.css?version=3.0' type='text/css' media='all' /><!--JQUERYPLUGIN::COMMENT-->
<link class='head SMILIESPLUGIN' rel='stylesheet' href='../pub/System/SmiliesPlugin/smilies.css' type='text/css' media='all' /><!--SMILIESPLUGIN-->
<link class='head CLASSIFICATIONPLUGIN::CSS' rel="stylesheet" href="../pub/System/ClassificationPlugin/styles.css" media="all" /><!--CLASSIFICATIONPLUGIN::CSS--><link rel='stylesheet' href='../pub/System/SkinTemplates/base.css' media='all' type='text/css' />
<style type="text/css" media="all">
@import url('../pub/System/PatternSkinTheme/layout.css');
@import url('../pub/System/PatternSkinTheme2009/style.css');
@import url('../pub/System/PatternSkinTheme2009/colors.css');
</style>
<link rel='stylesheet' href='../pub/System/PatternSkinTheme2009/column_left.css' media='all' type='text/css' />
<link rel='stylesheet' href='../pub/System/PatternSkinTheme2009/variant_twiki.css' media='all' type='text/css' /><style type="text/css" media="all">
/* Styles that are set using variables */
.patternBookView .foswikiTopRow,
.patternWebIndicator,
.patternWebIndicator a {
background-color:#D0D0D0;
}
#patternTopBarContents { background-image:url(../pub/System/PatternSkin/header5.gif); background-repeat:repeat-x;}
#patternTopBarContents { background-color:#ffffff;}
.patternBookView {
border-color:#D0D0D0;
}
.patternPreviewPage #patternMain {
/* uncomment to set the preview image */
/*background-image:url("/pub/System/PreviewBackground/preview2bg.gif");*/
}
</style>
<style type="text/css" media="all">
@import url("../pub/System/PsiSkin/psicolors.css");
@import url("../pub/System/PsiSkin/psistyle.css");
.foswikiTopic {overflow: hidden;}
</style>
<link rel='stylesheet' href='../pub/System/PatternSkin/print.css' media='all' type='text/css' />
<!--[if IE 7 ]><style type="text/css" media="screen">
.foswikiAttachments,
.foswikiForm,
.foswikiHelp,
.foswikiPreviewArea,
.patternPreviewPage .foswikiForm,
.patternSigLine,
.patternToolBar,
.patternTop,
.patternTopicAction,
#patternSideBarContents .patternLeftBarPersonal,
#patternSideBarContents h2,
#patternSideBarContents li,
#patternTopBarButtons ul {
height:1%;
}
#patternSideBarContents .patternLeftBarPersonal {
width:100%;
}
.foswikiFormStep {
height:100%;
}
#foswikiLogin {
margin-left: 25%;
margin-right: 25%;
}
#foswikiLogin .foswikiFormSteps {
width:auto;
}
#foswikiLogin input[type="text"],
#foswikiLogin input[type="password"] {
width: auto;
}
.patternShadow {
border:10px solid #fff;
margin-top:10px;
margin-bottom:10px;
border:2px solid #ccc;
}
</style><![endif]-->
<!--[if lte IE 9]>
<![endif]-->
<!--[if gt IE 9]><!-->
<!--<![endif]-->
<!--JQUERYPLUGIN-->
<!--JQUERYPLUGIN::MIGRATE-->
<!--JQUERYPLUGIN::LIVEQUERY-->
<!--JQUERYPLUGIN::FOSWIKI-->
<!--JavascriptFiles/foswikiString-->
<!--JQUERYPLUGIN::FOSWIKI::PREFERENCES-->
<!--JQUERYPLUGIN::METADATA-->
<!--JavascriptFiles/foswikiForm-->
<!--JQUERYPLUGIN::COMMENT-->
<!--JavascriptFiles/foswikiPref-->
<!--JQUERYPLUGIN::CHILI-->
<!--PatternSkin/pattern--><link class='head FOOTNOTEPLUGIN_LINKCSS' rel="stylesheet" href="../pub/System/FootNotePlugin/styles.css" type="text/css" media="all" /><!--FOOTNOTEPLUGIN_LINKCSS-->
</head>
<body class="foswikiNoJs patternViewPage patternPrintPage">
<span id="PageTop"></span><div class="foswikiPage"><div id="patternScreen">
<div id="patternPageShadow">
<div id="patternPage">
<div id="patternOuter" class="clear">
<div id="patternFloatWrap">
<div id="patternMain">
<div id="patternMainContents">
<div class="patternContent"><div class="foswikiTopic"> <h1 id="Setting_up_61_61musrfit_61_61_on_Different_Platforms"> Setting up <code><b>musrfit</b></code> on Different Platforms </h1>
<p></p>
<div class="foswikiToc" id="foswikiTOC"> <ul>
<li> <a href="MusrFitSetup.html#Setting_up_61_61musrfit_61_61_on_Different_Platforms"> Setting up musrfit on Different Platforms </a>
</li> <li> <a href="MusrFitSetup.html#A_1_Supported_Operating_Systems_and_Software_Requirements"> 1 Supported Operating Systems and Software Requirements </a>
</li> <li> <a href="MusrFitSetup.html#A_2_OS_Restrictions"> 2 OS Restrictions </a>
</li> <li> <a href="MusrFitSetup.html#A_3_GNU_47Linux"> 3 GNU/Linux </a> <ul>
<li> <a href="MusrFitSetup.html#A_3.1_Requirements"> 3.1 Requirements </a> <ul>
<li> <a href="MusrFitSetup.html#A_3.1.1_Everything_but_61_61ROOT_61_61_and_61_61NeXus_61_61"> 3.1.1 Everything but ROOT and NeXus </a>
</li> <li> <a href="MusrFitSetup.html#A_3.1.2_Installation_of_61_61NeXus_61_61_requirements_40optional_41"> 3.1.2 Installation of NeXus requirements (optional) </a>
</li> <li> <a href="MusrFitSetup.html#A_3.1.3_61_61ROOT_61_61"> 3.1.3 ROOT </a>
</li></ul>
</li> <li> <a href="MusrFitSetup.html#A_3.2_61_61musrfit_61_61"> 3.2 musrfit </a>
</li> <li> <a href="MusrFitSetup.html#A_3.3_61_61musredit_61_61"> 3.3 musredit </a>
</li> <li> <a href="MusrFitSetup.html#A_3.4_61_61musrgui_61_61"> 3.4 musrgui </a>
</li> <li> <a href="MusrFitSetup.html#A_3.5_Check_of_the_installation"> 3.5 Check of the installation </a>
</li></ul>
</li> <li> <a href="MusrFitSetup.html#A_4_MS_Windows"> 4 MS Windows </a> <ul>
<li> <a href="MusrFitSetup.html#A_4.1_Requirements"> 4.1 Requirements </a> <ul>
<li> <a href="MusrFitSetup.html#A_4.1.1_Setting_up_Cygwin"> 4.1.1 Setting up Cygwin </a>
</li> <li> <a href="MusrFitSetup.html#A_4.1.2_Installation_of_61_61NeXus_61_61_requirements_40optional_41"> 4.1.2 Installation of NeXus requirements (optional) </a>
</li> <li> <a href="MusrFitSetup.html#A_4.1.3_61_61ROOT_61_61"> 4.1.3 ROOT </a>
</li></ul>
</li> <li> <a href="MusrFitSetup.html#A_4.2_61_61musrfit_61_61"> 4.2 musrfit </a>
</li> <li> <a href="MusrFitSetup.html#A_4.3_61_61musredit_61_61"> 4.3 musredit </a>
</li> <li> <a href="MusrFitSetup.html#A_4.4_61_61musrgui_61_61"> 4.4 musrgui </a>
</li> <li> <a href="MusrFitSetup.html#A_4.5_Check_of_the_installation"> 4.5 Check of the installation </a>
</li> <li> <a href="MusrFitSetup.html#A_4.6_Possible_problems"> 4.6 Possible problems </a>
</li></ul>
</li> <li> <a href="MusrFitSetup.html#A_5_Mac_OS_X"> 5 Mac OS X </a> <ul>
<li> <a href="MusrFitSetup.html#A_5.1_Requirements_40_61_61MacPorts_61_61_41"> 5.1 Requirements (MacPorts) </a> <ul>
<li> <a href="MusrFitSetup.html#A_5.1.1_Everything_but_61_61ROOT_61_61_and_61_61NeXus_61_61"> 5.1.1 Everything but ROOT and NeXus </a>
</li> <li> <a href="MusrFitSetup.html#A_5.1.2_Installation_of_61_61NeXus_61_61_requirements_40optional_41"> 5.1.2 Installation of NeXus requirements (optional) </a>
</li> <li> <a href="MusrFitSetup.html#A_5.1.3_61_61ROOT_61_61"> 5.1.3 ROOT </a>
</li></ul>
</li> <li> <a href="MusrFitSetup.html#A_5.2_Requirements_40_61_61Fink_61_61_41"> 5.2 Requirements (Fink) </a> <ul>
<li> <a href="MusrFitSetup.html#A_5.2.1_Everything_but_61_61ROOT_61_61_and_61_61NeXus_61_61"> 5.2.1 Everything but ROOT and NeXus </a>
</li> <li> <a href="MusrFitSetup.html#A_5.2.2_Installation_of_61_61NeXus_61_61_requirements_40optional_41"> 5.2.2 Installation of NeXus requirements (optional) </a>
</li> <li> <a href="MusrFitSetup.html#A_5.2.3_61_61ROOT_61_61"> 5.2.3 ROOT </a>
</li></ul>
</li> <li> <a href="MusrFitSetup.html#A_5.3_61_61musrfit_61_61"> 5.3 musrfit </a>
</li> <li> <a href="MusrFitSetup.html#A_5.4_61_61musredit_61_61"> 5.4 musredit </a>
</li> <li> <a href="MusrFitSetup.html#A_5.5_61_61musrgui_61_61_40obsolete_41"> 5.5 musrgui (obsolete) </a>
</li> <li> <a href="MusrFitSetup.html#A_5.6_Check_of_the_installation"> 5.6 Check of the installation </a>
</li></ul>
</li></ul>
</div>
<p></p>
<h1 id="A_1_Supported_Operating_Systems_and_Software_Requirements"> 1 Supported Operating Systems and Software Requirements </h1>
<p></p>
This page is intended to demonstrate for the interested user which steps are necessary to set up the <a href="http://www.gnu.org/philosophy/free-sw.html">free software</a> &mu;SR data analysis framework <code><a href="MusrFit.html">musrfit</a></code>. While the preferred way is to run the software on <strong>GNU/Linux</strong> or <strong>MacOS X</strong>, with some restrictions it can also be set up under <strong>MS Windows</strong> (cygwin, only for the very brave, probably it is easier for most MS Windows users to install a Virtual Machine running Linux). <span class='foswikiRedFG'>In case <code>musrfit</code> 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!</span>
<p></p>
<span id="ReqSw"></span>
Apart from <a href="http://gcc.gnu.org/">GCC, the GNU Compiler Collection</a> (gcc, g++), the GNU build tools <a href="http://www.gnu.org/software/autoconf/">autoconf</a>, <a href="http://www.gnu.org/software/automake/">automake</a> and <a href="http://www.gnu.org/software/libtool/">libtool</a> as well as the helper tool <a href="http://pkg-config.freedesktop.org/wiki/">pkg-config</a> <code>musrfit</code> requires the installation of a few open-source libraries and programs including their header packages:
$ <a href="http://www.boost.org/">boost C++ libraries</a>: The powerful <code>Spirit</code> parser framework used by <code>musrfit</code> is included in that collection of libraries. <em>Required version &#8805; 1.33</em>
$ <a href="http://www.gnu.org/software/gsl/">GNU Scientific Library</a>: A numerical <code>C</code> and <code>C++</code> library which provides efficient implementations of various mathematical routines. <em>Required version &#8805; 1.9</em>
$ <a href="http://www.fftw.org/">FFTW</a>: A <code>C</code> implementation for the fast computation of discrete Fourier transforms. <em>Required version &#8805; 3.1</em>
$ <a href="http://root.cern.ch/">ROOT</a>: A <code>C++</code> data analysis framework developed at <a href="http://www.cern.ch/">CERN</a>. <em>Required version &#8805; 5.22</em>
$ <a href="http://xmlsoft.org/">libxml2</a>: The <code>XML</code> <code>C</code> parser and toolkit of <a href="http://www.gnome.org/">Gnome</a>. <em>Required version &#8805; 2.0</em>
<p></p>
<span id="ReqSwNeXus"></span>
Additionally, <span class='foswikiRedFG'>only if</span> <code>musrfit</code> should support reading of data files in the <code>NeXus</code> format the following libraries are needed:
$ <a href="http://www.hdfgroup.org/products/hdf4/">HDF4</a>: A library and multi-object file format for storing and managing data.
$ <a href="http://www.hdfgroup.org/HDF5/">HDF5</a>: A data model, library, and file format for storing and managing data.
$ <a href="http://www.minixml.org/">minixml</a>: A small <code>XML</code> library that can be used to read and write <code>XML</code> and <code>XML</code> -like data files. <em>Required version &#8805; 2.2</em>
$ <a href="http://www.nexusformat.org/">NeXus</a>: A common data format for neutron, x-ray, and muon science.
<p></p>
If optionally the editor and graphical user interface <code><a href="MusrGui.html">musrgui</a></code> / <code><a href="MusrGui.html">musredit</a></code> is going to be installed there is one further requirement:
$ <a href="http://qt.nokia.com/">Qt</a>: A cross-platform application and user interface framework. <em>Required version &#8805; 3.3 &#38; &#8810; 4.0 (<code>musrgui</code>) <strong>OR</strong> &#8805; 4.6 (<code>musredit</code>)</em>
<p></p>
Each of the following sections focusing on the installation of <code>musrfit</code> on the different operating systems will also give a brief introduction on the installation of the requirements before the actual <code>musrfit</code> installation is described.
<p></p>
<h1 id="A_2_OS_Restrictions"> 2 OS Restrictions </h1>
Before the further installation will be described, please note the following restrictions: <dl>
<dt> GNU/Linux </dt><dd> No serious problems are known at the moment.
</dd> <dt> MS Windows </dt><dd> The setup of <code>musrfit</code> (including the requirements) using <code>Visual C++</code> has not been tested. If anybody likes to do this: Just go ahead and have fun! However, not very much assistance can be expected, although it would be an interesting experiment.
</dd> <dt> Mac OS X </dt><dd> On <code>10.6 Snow Leopard</code> <code>Qt3</code> for Mac is not supported any more since this was based on a 32-bit only API. <code>Snow Leopard</code> -users are advised to use the <code>Qt4</code> based <code>musredit</code> or to rely on the standard <code>Qt3</code> version for <code>X11</code> in order to run <code>musrgui</code>. On newer Mac OS X versions (&gt;= 10.8) you should use the <code>Qt4</code> base <code>musredit</code> only.
</dd></dl>
<p></p>
<h1 id="A_3_GNU_47Linux"> 3 GNU/Linux </h1>
<h2 id="A_3.1_Requirements"> 3.1 Requirements </h2>
<h3 id="A_3.1.1_Everything_but_61_61ROOT_61_61_and_61_61NeXus_61_61"> 3.1.1 Everything but <code><b>ROOT</b></code> and <code><b>NeXus</b></code> </h3>
Depending on the GNU/Linux distribution chosen, the above mentioned software&mdash;except the <code>ROOT</code> system and the <code>NeXus</code> library&mdash;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 <strong>both</strong>, the libraries and the header (dev, devel) files.<br>
On a <a href="https://www.scientificlinux.org/">Scientific Linux</a> (<a href="http://www.redhat.com/">Red Hat</a>, other RPM-package base Linux distributions) system the following command executed as superuser from the shell will do the trick (never type the '$' it is the shell prompt of your system):
<pre class="bash">
&#36; yum install git boost-devel gsl-devel fftw-devel libxml2-devel qt-devel qtwebkit-devel
</pre>
When dealing with a distribution that uses the dpkg/apt package manager like <a href="http://www.debian.org/">Debian</a> or <a href="http://www.ubuntu.com/">Ubuntu</a> the installation would look like:
<pre class="bash">
&#36; apt-get install git libboost-dev libgsl0-dev libfftw3-dev libxml2-dev libqt4-dev libqtwebkit-dev
</pre>
Everyone should know best himself which is the way to install distribution software on the chosen distribution <img class='smily' src='../pub/Main/SmiliesPluginPSI_/wink.gif' alt='wink' title='wink' />
<p></p>
In case the distribution does not include the required software it has to be compiled from the source files which normally means to download the source code from the corresponding website, to unpack the source tree and call the following from the shell:
<pre class="bash">
&#36; ./configure
&#36; make
&#36; make install
</pre>
In order to obtain some information about the possible options for the installation, calling <code>./configure --help</code> might give some useful hints. <br>
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></p>
<h3 id="A_3.1.2_Installation_of_61_61NeXus_61_61_requirements_40optional_41"> 3.1.2 Installation of <code><b>NeXus</b></code> requirements (optional) </h3>
<span class='foswikiRedFG'>Only if</span> <code>musrfit</code> should support reading/writing data files in the <code>NeXus</code> format the further <a class="foswikiCurrentTopicLink" href="#ReqSwNeXus">required</a> software has to be set up. The required libraries and header files could either be available through the user's GNU/Linux distribution or if this is not the case, the packages can be installed from the source code. E.g. on Red Hat-like systems binary packages for <code>MXML</code>, <code>HDF4</code>, and <code>HDF5</code> might be called <code><b>mxml, mxml-devel, hdf, hdf-devel, hdf5, hdf5-devel</b></code>, on Debian-like systems <code><b>libmxml1, libmxml-dev, libhdf4-dev, libhdf5-dev</b></code>.
<p></p>
Even though there might exist binary packages for the <code>NeXus</code> library, it is best to build and install it directly from the source code which can be found <a href="http://download.nexusformat.org/kits/">here</a>.
<p></p>
<h3 id="A_3.1.3_61_61ROOT_61_61"> 3.1.3 <code><b>ROOT</b></code> </h3>
<strong>Currently only ROOT 5.34/xx is support! Do NOT try to use ROOT 6.xx/yy yet!</strong>
<p></p>
The <code>ROOT</code> system may or may not be part of the GNU/Linux distribution. Some distributions are packing <code>ROOT</code> in a manner incompatible with the way it is needed for <code>musrfit</code>. <strong>Therefore we advise to install <code>ROOT</code> from source</strong>. Before installing <code>ROOT</code> from source you will need to install some additional header packages.
<p></p>
For RPM based systems (RedHat, Fedora, etc) this will likely to be <strong>libX11-devel</strong>, <strong>libXft-devel</strong>, <strong>libXpm-devel</strong>, and <strong>libXext-devel</strong>:
<pre class="bash">
&#36; yum install libX11-devel libXft-devel libXpm-devel libXext-devel
</pre>
<p></p>
For a dpkg/apt based system (Debian, Ubuntu, etc) this will likely to be <strong>libX11-dev</strong>, <strong>libxft-dev</strong>, <strong>libxpm-dev</strong>, and <strong>libxext-dev</strong>:
<pre class="bash">
&#36; apt-get install libX11-dev libxft-dev libxpm-dev libxext-dev
</pre>
<p></p>
Also make sure that you have installed all required packages listed under <a class="foswikiCurrentTopicLink" href="#ReqSw">Requested Software</a> (e.g. fftw, gsl, etc).
<p></p>
For the following it is assumed that <code>ROOT</code> shall be installed under <code>$HOME/Apps</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 <strong>not</strong> 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.
<pre class="bash">
&#36; cd &#36;HOME
&#36; # creat the Apps directory if not already present
&#36; mkdir Apps
&#36; cd Apps
&#36; git clone http://root.cern.ch/git/root.git
&#36; cd root
&#36; git tag -l
&#36; # git tag -l will list all available tags. In the next command choose the tag v5-34-xx
&#36; # where xx is the highest listed number, e.g. v5-34-32
&#36; git checkout -b v5-34-32 v5-34-32
&#36; # now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.
&#36; ./configure --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
&#36; # next will be the make. If running on a multicore CPU you can speed up tremendously by calling
&#36; # make with the option -j &#60;number&#62;, where &#60;number&#62; is the number of threads which you want to give,
&#36; # e.g. make -j8
&#36; make
</pre>
<p></p>
What is still missing is that the system should be told where to find the <code>ROOT</code> installation, therefore the following is suggested: <ul>
<li> As superuser create a file <strong>/etc/ld.so.conf.d/cern-root.conf</strong> where the path to the <code>lib</code> directory of <code>ROOT</code> is added and call <strong>/sbin/ldconfig</strong> afterwards. In the example mentioned above one way of doing this is (<strong>&lt;home&gt;</strong> has to be the path to your home, e.g. /home/luke_skywalker): <pre class="bash">
&#36; echo &#34;&#60;home&#62;/Apps/root/lib&#34; &#62;&#62; /etc/ld.so.conf.d/cern-root.conf
&#36; /sbin/ldconfig
</pre>
</li> <li> <span class='foswikiRedFG'>Additionally</span>, as normal user one should append the following lines to the <strong>~/.bashrc</strong> and/or <strong>~/.bash_profile</strong> (<strong>~./profile</strong> 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: <pre class="bash">
&#36; export ROOTSYS&#61;&#36;HOME/Apps/root
&#36; export PATH&#61;&#36;ROOTSYS/bin:&#36;PATH
</pre>
</li></ul>
<p></p>
If an update of <code>ROOT</code> is needed, simple do the following:<pre class="bash">
&#36; cd &#36;HOME/Apps/root
&#36; git pull
&#36; make
</pre>
<p></p>
<span id="MusrFitInstallation"></span>
<h2 id="A_3.2_61_61musrfit_61_61"> 3.2 <code><b>musrfit</b></code> </h2>
When all required software has been set up it can be proceeded with the <code>musrfit</code> installation. First, the most recent source code should be downloaded. The preferred way of doing so is to <strong>clone</strong> the musrfit repository via git. Assuming the code should be located in <strong>$HOME/Apps</strong> this is achieved most easily calling from the terminal
<pre class="bash">
&#36; cd &#36;HOME/Apps
&#36; git clone https://bitbucket.org/muonspin/musrfit.git
</pre>
or
<pre class="bash">
&#36; cd &#36;HOME/Apps
&#36; git clone git://gitorious.psi.ch/nemu/musrfit.git
</pre>
<p></p>
<strong>Note:</strong> musrfit has moved from svn to git. In case you still have an <em>old</em> svn version of musrfit, it is advised to remove it first. For svn users: for a smooth transition from svn to git, please check the following link:
<a href="http://www.git-tower.com/blog/git-for-subversion-users-cheat-sheet/">Git for Subversion Users - A Cheat Sheet</a>.
<p></p>
If a local repository clone is already present, one can update it using:
<pre class="bash">
&#36; cd &#36;HOME/Apps/musrfit
&#36; git pull
&#36; # the new version now needs to be compiled and installed
&#36; make
&#36; make install
</pre>
<p></p>
<span class='foswikiRedFG'>As an alternative (if git is not available)</span>, the source code can also be downloaded from the following web-page: <a href="https://bitbucket.org/muonspin/musrfit/downloads">musrfit at bitbucket</a>.
<p></p>
After the source-code extraction the <strong>autogen.sh</strong> script is called to prepare the build environment. If it has been executed successfully the <strong>configure</strong> script should be ready to collect all the information needed to create the Makefiles. <span class='foswikiRedFG'>If <code>musrfit</code> should support <code>NeXus</code> data files this has to be enabled by specifying the <strong>--enable-NeXus</strong> switch when calling <strong>configure</strong>.</span> For an overview of all available options just call <code>./configure --help</code>. Besides the standard options there are a few special options which should be mentioned here:
<p></p> <dl>
<dt> --prefix </dt><dd> Specify the installation prefix, e.g. /opt/root-system (<em>by default: /usr/local</em>)
</dd> <dt> --with-rootsys </dt><dd> Specify the top of the <code>ROOT</code> installation directory, e.g. /opt/root-system
</dd> <dt> --with-fftw3 </dt><dd> Specify the prefix of the <code>FFTW3</code> installation. e.g. /usr/local or /usr
</dd> <dt> --with-gsl </dt><dd> Set the prefix of the <code>GSL</code> installation, e.g. /usr/local or /usr
</dd> <dt> --with-boostinc </dt><dd> Set the path to the header files of the <code>Boost</code> installation, e.g. /usr/local/include or /usr/include
</dd> <dt> --with-hdf4 </dt><dd> Set the prefix of the <code>HDF4</code> installation, e.g. /usr/local (<em>only useful in conjunction with the <code>NeXus</code> support</em>)
</dd> <dt> --with-hdf5 </dt><dd> Set the prefix of the <code>HDF5</code> installation, e.g. /usr (<em>only useful in conjunction with the <code>NeXus</code> support</em>)
</dd> <dt> --with-nexus </dt><dd> Set the prefix of the <code>NeXus</code> installation, e.g. /usr/local (<em>only useful in conjunction with the <code>NeXus</code> support</em>)
</dd> <dt> --with-qt3 </dt><dd> Set the prefix of the <code>Qt3</code> installation, e.g. /usr/lib/qt-3.3 (<em>only useful in conjunction with building <code>musrgui</code></em>)
</dd> <dt> --with-qt4 </dt><dd> Set the prefix of the <code>Qt4</code> installation, e.g. /usr/lib/qt47 (<em>only useful in conjunction with building <code>musredit</code></em>)
</dd> <dt> --enable-NeXus </dt><dd> Enable the support of <code>NeXus</code> data files (<em>requires the <code>HDF4</code>, <code>HDF5</code> and <code>NeXus</code> libraries to be installed</em>).
</dd> <dt> --disable-editor </dt><dd> Disable the integrated building of <code>musredit</code>/<code>musrgui</code>.
</dd> <dt> --disable-omp </dt><dd> Switches off the <a href="http://en.wikipedia.org/wiki/OpenMP">OpenMP</a> features of <code>musrfit</code> (parallelization of the &chi;<sup>2</sup> calculation when compiled with GCC &ge; 4.2)
</dd></dl>
<p></p>
Normally it should not be necessary to make use of any of the options except for specifying the installation path with <strong>--prefix</strong>. The other paths should be detected automatically. If this does not work for some reason the <strong>configure</strong> script will terminate and ask for the information.
When the <strong>configure</strong> script has been called successfully everything is ready for building the <code>musrfit</code> libraries and executables. A standard installation sequence (without <code>NeXus</code> support) might then look like<a name="FootNote1text"></a><span class="FootNoteTextLink" title="In case the normal user has no write permissions to the &#38;&#35;36&#59;ROOTSYS and the installation path the &#34;make install&#34; commands have to be executed as superuser&#46;"><a class="foswikiCurrentTopicLink" href="#FootNote1note">(3)</a></span>:
<pre class="bash">
&#36; cd &#36;HOME/Apps/musrfit
&#36; sh autogen.sh
&#36; ./configure --prefix&#61;&#36;ROOTSYS
&#36; make
&#36; make install
&#36; /sbin/ldconfig # (as superuser)
</pre>
In order to finish the installation of <code>musrfit</code> two more things should be done: <ul>
<li> Define the <strong>MUSRFITPATH</strong> environment variable containing the path to the <code>musrfit</code> executables and XML files. E.g. if the location of the example above is used append the following line to the <strong>~/.bashrc</strong> and <strong>~/.bash_profile</strong> (and then either restart the shell or call the same commands once more from the shell): <pre class="bash">
export MUSRFITPATH&#61;/opt/root-system/bin
</pre>
</li> <li> Adjust the paths where <code>musrfit</code> will search for data files in the installed <strong>musrfit_startup.xml</strong>. For detailed information on this XML file refer to the <a href="MusrFit.html#MusrfitStartupXml">manual</a>.
</li></ul>
<p></p>
<span id="MusrGuiInstallLinux"></span>
<h2 id="A_3.3_61_61musredit_61_61"> 3.3 <code><b>musredit</b></code> </h2>
<span class='foswikiBlueFG'>In the latest version of <code>musrfit</code> the configure script tries to determine automatically if <code>Qt4.6</code> or higher is set up on the machine. In case this is found, the editor <code>musredit</code> is built already together with <code>musrfit</code>. <em>If not</em>, one can either try to call the configure script with the "--with-qt4" option or install this editor separately:</span>
<pre class="bash">
&#36; cd &#36;HOME/Apps/musrfit/src/musredit
&#36; # for some distributions you will need qmake-qt4 for the next command
&#36; qmake musredit.pro
</pre>
If everything went fine <code>musredit</code> can be compiled and installed:
<pre class="bash">
&#36; make
&#36; make install
</pre>
In case one does not like the executable <strong>musredit</strong> to be copied to the default installation directory $ROOTSYS/bin the last "make install" can be skipped and the executable can be copied somewhere else instead. However, the <strong>musredit_startup.xml</strong> should go to the installation directory <strong>MUSRFITPATH</strong> of the <code>musrfit</code> executables.
Eventually, in the installed <strong>musredit_startup.xml</strong> the path specifications should be adjusted to match the local <code>musrfit</code> installation. For detailed information on this XML file refer to the <a href="MusrGui.html#MusrguiStartupXml">manual</a>.
<p></p>
<h2 id="A_3.4_61_61musrgui_61_61"> 3.4 <code><b>musrgui</b></code> </h2>
If <code>Qt4.6</code> or higher is not available but <code>Qt3</code> is set up <code>musrgui</code> can be installed. For this please follow the instructions for the <a class="foswikiCurrentTopicLink" href="#MusrGuiInstallLinux">musredit installation</a> where simply every <code>musredit</code> occurrence has to be replaced by <code>musrgui</code>.<br>
If there are problems during the <code>qmake</code> step, e.g. "uic: File generated with too old version of Qt Designer", this most probably means the <code>Qt4</code> version of qmake is being used. In order to use the <code>Qt3</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 /usr/lib/qt-3.3/bin/qmake.
<p></p>
<h2 id="A_3.5_Check_of_the_installation"> 3.5 Check of the installation </h2>
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>musrfit</code> source tree at <strong>doc/examples/</strong>.<br>
If <code>musrgui</code> has been installed, just open one of the <strong>test-&#42;.msr</strong> files in the editor and test the <code>musrfit</code> functionalities. Otherwise, if only the terminal should be used, as an initial test for instance the following could be done:
<pre class="bash">
&#36; cd &#36;HOME/Apps/musrfit/doc/examples
&#36; musrview test-histo-ROOT-NPP.msr
</pre>
<p></p>
<p></p>
<p></p>
Notes
<p></p>
<a name="FootNote1note"></a><span class="FootNoteLabel"><a href="#FootNote1text"><b>3</b></a></span>: <span class="FootNote">In case the normal user has no write permissions to the &#36;ROOTSYS and the installation path the "make install" commands have to be executed as superuser.</span>
<p></p>
<p></p>
<p></p>
<hr />
<p></p>
<h1 id="A_4_MS_Windows"> 4 MS Windows </h1>
Under Windows a native installation is not supported but there is the possibility to run <code>musrfit</code> through <a href="http://www.cygwin.com/">Cygwin</a> which has the great advantage that one gains additionally various nice <code>UNIX</code> tools also for other purposes <img class='smily' src='../pub/Main/SmiliesPluginPSI_/wink.gif' alt='wink' title='wink' /> <br>
<span class='foswikiRedFG'>Please also be aware of the fact that the X server which is going to be installed with Cygwin has to be started (e.g. by selecting it from the "Programs" folder) before any graphical application (<code>musrview</code>, <code>musrgui</code>, etc.) is run</span>.
<p></p>
<span class='foswikiPinkFG'>One more advice: Please never try to install either <code>ROOT</code> or <code>musrfit</code> from or to a directory containing spaces in the absolute path or in case you do, do not wonder if some errors occur!<br>
msr files, however, might be saved in such directories like ...\My Documents\...</span>
<p></p>
<h2 id="A_4.1_Requirements"> 4.1 Requirements </h2>
<h3 id="A_4.1.1_Setting_up_Cygwin"> 4.1.1 Setting up Cygwin </h3>
For the start go to the Cygwin website, download the <a href="http://cygwin.com/setup.exe">setup file</a> and use it to install <strong>Cygwin 1.7</strong>. During the installation process you will be asked where you want to install Cygwin and normally the default choice should just be fine.
At some point you will be asked which packages should be installed&mdash;make sure that you choose at least the following (or packages with revisions close to the following) in order to fulfill the <code>musrfit</code> requirements and be able to work with this base system:
<p></p>
<code><b>a2ps, alternatives, autoconf, automake, base-cygwin, base-files, base-passwd bash, bash-completion, bc, binutils, bison, boost, boost-devel, bzip2, cmake, colorgcc, coreutils, curl, cygutils, cygwin, editrights, fftw3, findutils, flex, font-adobe-dpi100, font-adobe-dpi75, font-alias, font-bitstream-dpi100, font-bitstream-dpi75, font-encodings, font-ibm-type1, font-sun-misc, font-util, font-xfree86-type1, fontconfig, freeglut, gawk, gcc-tools-autoconf, gcc-tools-automake, gcc4, gcc4-core, gcc4-fortran, gcc4-g++, gccmakedep, gd, gettext, ghostscript, ghostscript-fonts-std, giflib, gmp, grep, groff, gsl, gsl-apps, gsl-devel, gv, gzip, inputproto, jasper, jpeg, lapack, less, libboost, libbz2_1, libcharset1, libcurl4, libfftw3-devel, libfftw3_3, libgcc1, libgd-devel, libgif-devel, libGL-devel, libGL1, libGLU-devel, libGLU1, libglut-devel, libglut3, libgmp-devel libgmp3, libgomp1, libICE-devel, libICE6, libjpeg-devel, libjpeg62, liblapack-devel, libmpfr-devel, libmpfr1, libncurses-devel, libncurses9, libOSMesa-devel, libOSMesa7, libpng, libpng14, libpng14-devel, libreadline6, libSM-devel, libSM6, libssh2_1, libstdc++6, libstdc++6-devel, libtiff-devel, libtiff5, libtool, libX11-devel, libX11_6, libXau-devel, libXau6, libXaw7, libxcb-devel, libxcb-xlib-devel libXcursor-devel, libXcursor1, libXdmcp-devel, libXdmcp6, libXext-devel, libXext6, libXfixes-devel, libXfixes3, libXfont-devel, libXfont1, libXft-devel, libXft2, libXi-devel, libXi6, libxkbfile1, libxml2, libxml2-devel, libXmu-devel, libXmu6, libXpm-devel, libXpm4, libXrender-devel, libXrender1, libXt-devel, libXt6, login, m4, make, makedepend, man, mpfr, nano, opengl, openssh, openssl, pdftk, perl, ping, pkg-config, psutils, python, qt3, qt3-bin, qt3-devel, readline, rebase, rgb, rsync, run, screen, sed, subversion, tar, tcltk, terminfo, unzip, util-linux, vim, w32api, which, X-start-menu-icons, xauth, xextproto, xfontsel, xinit, xkbcomp, xkeyboard-config, xkill, xlogo, xlsfonts, xorg-cf-files, xorg-scripts, xorg-server, xproto, xrdb, xrefresh, xset, xterm, zip, zlib, zlib-devel, zlib0, libQt3Support4-devel, libQtAssistantClient4-devel, libQtCore4-devel, libQtDBus4-devel, libQtDesigner4-devel, libQtGui4-devel, libQtHelp4-devel, libQtNetwork4-devel, libQtOpenGL4-devel, libQtScript4-devel, libQtScriptTools4-devel, libQtSql4-devel, libQtSvg4-devel, libQtTest4-devel, libQtWebKit4-devel, libQtXml4-devel, libQtXmlPatterns4-devel</b></code>
<p></p>
After these installations already most of the required software is present and the Cygwin shell can be started now for the further steps! Inside the shell the <code>POSIX</code> naming convention applies, therefore, paths will be given with separating <strong>/</strong> instead of <strong>\</strong> in <code>DOS</code>. The file structure accessible through this shell can also be accessed through the Windows Explorer&mdash;just go to the directory which you specified as "cygwin root" during the installation: this is the equivalent to <strong>/</strong> in the shell. By default, the different hard drives or network shares like <strong>C:\</strong> can be found at <strong>/cygdrive/c/</strong> in the shell&mdash;the cygdrive prefix can in principle also be changed but for now we stick to the default.
<p></p>
Since later on the <code>boost</code> header files should be used and in the standard Cygwin installation these are found at a version specific location, the later handling will be easier if a symbolic link to these files is created now in the terminal (in case it had not been present before):
<pre class="bash">
&#36; ln -sf /usr/include/boost-x&#95;yy&#95;z/boost /usr/include/boost
</pre>
where <strong>x_yy_z</strong> has to be substituted by the correct version number, e.g. <strong>1_33_1</strong>.
<p></p>
<h3 id="A_4.1.2_Installation_of_61_61NeXus_61_61_requirements_40optional_41"> 4.1.2 Installation of <code><b>NeXus</b></code> requirements (optional) </h3>
<span class='foswikiRedFG'>Only if</span> <code>musrfit</code> should support reading data files in the <code>NeXus</code> format the further <a class="foswikiCurrentTopicLink" href="#ReqSwNeXus">required</a> software has to be set up. Under Cygwin of all the required libraries only <code>HDF5</code> is available. The packages <code><b>hdf5</b></code> and <code><b>libhdf5-devel</b></code> can be installed through the Cygwin setup. One should also make sure that <code><b>bison</b></code>, <code><b>flex</b></code> and a package containing <nobr><b>/usr/lib/librpc.a</b></nobr> (e.g. <code><b>sunrpc</b></code> = <strong>4.0-3</strong>, <span class='foswikiRedFG'>but not</span> <code><b>sunrpc</b></code> = <strong>4.0-4</strong>) are installed.
<p></p>
All other libraries have to be built from the sources. The following lines will track the installation of <code>JPEG</code> <strong>6b</strong>, <code>MXML</code> <strong>2.9</strong>, <code>HDF</code> <strong>4.2.7-patch1</strong>, and <code>NeXus</code> <strong>4.3.2</strong>. The version numbers and source-code locations might of course change with time but should be easily adjustable.
<pre class="bash">
&#36; cd
&#36; mkdir nexus
&#36; cd nexus
&#36; curl http://www.hdfgroup.org/ftp/lib-external/jpeg/src/jpegsrc.v6b.tar.gz -G &#124; tar xz
&#36; cd jpeg-6b
&#36; ./configure --prefix&#61;/usr/local --enable-static
&#36; make
&#36; make install
&#36; cd ..
&#36; curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G &#124; tar xz
&#36; cd mxml-2.9
&#36; ./configure --prefix&#61;/usr/local --enable-static
&#36; make
&#36; make install
&#36; cd ..
&#36; curl http://www.hdfgroup.org/ftp/HDF/HDF&#95;Current/src/hdf-4.2.7-patch1.tar.gz -G &#124; tar xz
&#36; cd hdf-4.2.7-patch1
&#36; ./configure --prefix&#61;/usr/local --enable-static --disable-fortran --with-jpeg&#61;/usr/local
&#36; make
&#36; make install
&#36; cd ..
&#36; curl http://download.nexusformat.org/kits/nexus-4.3.2-20140413svn1919.tar.gz -G &#124; tar xz
&#36; cd nexus-4.3.2-20140413svn1919
&#36; ./configure --prefix&#61;/usr/local --with-hdf4&#61;/usr/local --with-hdf5&#61;/usr --with-xml&#61;/usr/local
&#36; make
&#36; make install
</pre>
<p></p>
<h3 id="A_4.1.3_61_61ROOT_61_61"> 4.1.3 <code><b>ROOT</b></code> </h3>
In order to install the <code>ROOT</code> system, there are two possibilities: <ul>
<li> Download the precompiled <strong>Cygwin GCC 4.3</strong> package of the most recent <code>ROOT</code> version from the <a href="http://root.cern.ch/drupal/content/downloading-root">web page</a> and unpack it <span class='foswikiRedFG'>in a Cygwin shell</span> (in order to get the line endings correctly) at the final location. Suppose the package has been downloaded to <strong>C:\</strong> and the <code>ROOT</code> tree should be in <strong>C:\root</strong>, this is achieved by:<pre class="bash">
&#36; cd /cygdrive/c
&#36; tar xzf root&#95;v5.xx.yy.win32gcc-gcc-4.3.tar.gz
</pre>
</li> <li> If due to some reason there was no precompiled <strong>Cygwin GCC 4.3</strong> package available or <code>ROOT</code> should be built from source, one has to visit the <a href="http://root.cern.ch/drupal/content/downloading-root">web page</a>, download the 'complete source tree for all systems' and save it for instance in <strong>C:\</strong>.<br>Then go to the Cygwin shell and unpack this source tree, configure<a name="FootNote2text"></a><span class="FootNoteTextLink" title=" When using &#61;GCC&#61; &#38;&#35;8805&#59; 4&#46;2 please make sure that the environment variables &#42;USE_PARALLEL_MINUIT2&#42; and &#42;USE_OPENMP&#42; are <em>not</em> set&#33; Otherwise &#61;MINUIT2&#61; will be compiled with parallelization support and cannot be used together with &#61;musrfit&#61; afterwards since the &#61;musrfit&#61; code is <em>not</em> fully thread&#45;safe&#33; When compiled with &#61;GCC&#61; &#38;&#35;8805&#59; 4&#46;2 &#61;musrfit&#61; itself will parallelize the &#38;chi&#59;&#60;sup&#62;2&#60;&#47;sup&#62; calculation&#46;"><a class="foswikiCurrentTopicLink" href="#FootNote2note">(2)</a></span> it (here using the minimal set of options) and compile it as follows right below:<pre class="bash">
&#36; cd /cygdrive/c
&#36; tar xzf root&#95;v5.xx.yy.source.tar.gz
&#36; cd root
&#36; ./configure win32gcc --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
&#36; make
</pre>
</li></ul>
<p></p>
In order to finalize the <code>ROOT</code> installation and to prepare already the installation of <code>musrfit</code> and <code>musredit</code> this is a good time for setting necessary environment variables for the use in Cygwin. For accomplishing that put the following lines at the end of the <strong>/home/Username/.bashrc</strong> (<strong>C:\cygwin\home\Username\.bashrc</strong> for the user "Username" and the "cygwin root" at "C:\cygwin"):
<pre class="bash">
export DISPLAY&#61;:0.0
export QTDIR&#61;/usr/lib/qt4
export ROOTSYS&#61;/cygdrive/c/root
export PATH&#61;&#36;ROOTSYS/bin:&#36;QTDIR/bin:/usr/i686-pc-cygwin/bin:&#36;PATH
export MUSRFITPATH&#61;&#36;ROOTSYS/bin
</pre>
<p></p>
Afterwards close the Cygwin shell and reopen it again for the installation of <code>musrfit</code>.
<p></p>
<h2 id="A_4.2_61_61musrfit_61_61"> 4.2 <code><b>musrfit</b></code> </h2>
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 musrfit repository via git. Assuming the code should be located in ~/musrfit this is achieved most easily calling from the terminal
<pre class="bash">
&#36; cd
&#36; git clone https://bitbucket.org/muonspin/musrfit.git
</pre>
or
<pre class="bash">
&#36; cd
&#36; git clone git://gitorious.psi.ch/nemu/musrfit.git
</pre>
<p></p>
<strong>Note:</strong> musrfit has moved from svn to git. In case you still have an <em>old</em> svn version of musrfit, it is advised to remove it first. For svn users: for a smooth transition from svn to git, please check the following link:
<a href="http://www.git-tower.com/blog/git-for-subversion-users-cheat-sheet/">Git for Subversion Users - A Cheat Sheet</a>.
<p></p>
If the repository had been checked out already before, one can update the local copy using:
<pre class="bash">
&#36; cd musrfit
&#36; git pull
</pre>
<p></p>
<span class='foswikiRedFG'>As an alternative (if git is not available)</span>, the source code can also be downloaded from the following web-page: <a href="https://bitbucket.org/muonspin/musrfit/downloads">musrfit at bitbucket</a>.
<p></p>
After the source-code extraction the <strong>autogen.sh</strong> script is called to prepare the build environment. If it has been executed successfully the <strong>configure</strong> script should be ready to collect all the information needed to create the Makefiles. <span class='foswikiRedFG'>If <code>musrfit</code> should support <code>NeXus</code> data files this has to be enabled by specifying the <nobr><b>--enable-static</b></nobr> <nobr><b>--enable-NeXus</b></nobr> switches when calling <strong>configure</strong>.</span> For an overview of all available options just call <code>./configure --help</code>. Besides the standard options there are a few special options which should be mentioned here:
<p></p> <dl>
<dt> --prefix </dt><dd> Specify the installation prefix, e.g. /opt/root-system (<em>by default: /usr/local</em>)
</dd> <dt> --with-rootsys </dt><dd> Specify the top of the <code>ROOT</code> installation directory, e.g. /opt/root-system
</dd> <dt> --with-fftw3 </dt><dd> Specify the prefix of the <code>FFTW3</code> installation. e.g. /usr/local or /usr
</dd> <dt> --with-gsl </dt><dd> Set the prefix of the <code>GSL</code> installation, e.g. /usr/local or /usr
</dd> <dt> --with-boostinc </dt><dd> Set the path to the header files of the <code>Boost</code> installation, e.g. /usr/local/include or /usr/include
</dd> <dt> --with-hdf4 </dt><dd> Set the prefix of the <code>HDF4</code> installation, e.g. /usr/local (<em>only useful in conjunction with the <code>NeXus</code> support</em>)
</dd> <dt> --with-hdf5 </dt><dd> Set the prefix of the <code>HDF5</code> installation, e.g. /usr (<em>only useful in conjunction with the <code>NeXus</code> support</em>)
</dd> <dt> --with-nexus </dt><dd> Set the prefix of the <code>NeXus</code> installation, e.g. /usr/local (<em>only useful in conjunction with the <code>NeXus</code> support</em>)
</dd> <dt> --with-qt3 </dt><dd> Set the prefix of the <code>Qt3</code> installation, e.g. /usr/lib/qt-3.3 (<em>only useful in conjunction with building <code>musrgui</code></em>)
</dd> <dt> --with-qt4 </dt><dd> Set the prefix of the <code>Qt4</code> installation, e.g. /usr/lib/qt47 (<em>only useful in conjunction with building <code>musredit</code></em>)
</dd> <dt> --enable-NeXus </dt><dd> Enable the support of <code>NeXus</code> data files (<em>requires the <code>HDF4</code>, <code>HDF5</code> and <code>NeXus</code> libraries to be installed</em>).
</dd> <dt> --disable-editor </dt><dd> Disable the integrated building of <code>musredit</code>/<code>musrgui</code>.
</dd> <dt> --disable-omp </dt><dd> Switches off the <a href="http://en.wikipedia.org/wiki/OpenMP">OpenMP</a> features of <code>musrfit</code> (parallelization of the &chi;<sup>2</sup> calculation when compiled with GCC &ge; 4.2)
</dd></dl>
<p></p>
Normally it should not be necessary to make use of any of the options except for specifying the installation path with <strong>--prefix</strong>. The other paths should be detected automatically. If this does not work for some reason the <strong>configure</strong> script will terminate and ask for the information.
When the <strong>configure</strong> script has been called successfully everything is ready for building the <code>musrfit</code> libraries and executables. A standard installation sequence (without <code>NeXus</code> support) might then look like:
<pre class="bash">
&#36; cd musrfit
&#36; sh autogen.sh
&#36; ./configure --prefix&#61;&#36;ROOTSYS
&#36; make
&#36; make install
</pre>
In order to finish the installation of <code>musrfit</code> the paths where <code>musrfit</code> searches for data files should be adjusted in the installed <strong>musrfit_startup.xml</strong> (/cygdrive/c/root/bin/musrfit_startup.xml or C:\root\bin\musrfit_startup.xml). The paths have to obey the <code>POSIX</code> naming convention. For detailed information on this XML file refer to the <a href="MusrFit.html#MusrfitStartupXml">manual</a>.
<p></p>
<span id="MusrEditInstallCygwin"></span>
<h2 id="A_4.3_61_61musredit_61_61"> 4.3 <code><b>musredit</b></code> </h2>
<span class='foswikiBlueFG'>In the latest version of <code>musrfit</code> the configure script tries to determine automatically if <code>Qt4.5</code> or higher is set up on the machine. In case this is found, the editor <code>musredit</code> is built already together with <code>musrfit</code>. <em>If not</em>, one can either try to call the configure script with the "--with-qt4" option or install this editor separately:</span>
<pre class="bash">
&#36; cd src/musredit
&#36; qmake-qt4 musredit.pro
</pre>
If everything went fine <code>musredit</code> can be compiled and installed:
<pre class="bash">
&#36; make
&#36; make install
</pre>
Eventually, in the installed <strong>musredit_startup.xml</strong> (<strong>/cygdrive/c/root/bin/musredit_startup.xml</strong> or <strong>C:\root\bin\musredit_startup.xml</strong>) the path specifications should be adjusted to match the local <code>musrfit</code> installation. For detailed information on this XML file refer to the <a href="MusrGui.html#MusrguiStartupXml">manual</a>.
<p></p>
<hr />
In case one likes to get the editor started just with starting the X server from the Windows start menu the file <strong>~/.startxwinrc</strong> with the following contents can be created:<pre class="bash">
#!/bin/sh
export DISPLAY&#61;:0.0
export QTDIR&#61;/usr/lib/qt4
export ROOTSYS&#61;/cygdrive/c/root
export PATH&#61;&#36;ROOTSYS/bin:&#36;QTDIR/bin:/usr/i686-pc-cygwin/bin:&#36;PATH
export MUSRFITPATH&#61;&#36;ROOTSYS/bin
musredit &#38;
</pre>
<hr />
<p></p>
<h2 id="A_4.4_61_61musrgui_61_61"> 4.4 <code><b>musrgui</b></code> </h2>
If <code>Qt4.5</code> is not available but <code>Qt3</code> is set up <code>musrgui</code> can be installed. For this please follow the instructions for the <a class="foswikiCurrentTopicLink" href="#MusrGuiInstallLinux">musredit installation</a> where simply every <code>musredit</code> occurrence has to be replaced by <code>musrgui</code>, and <code>qt4</code> is replaced by <code>qt3</code>.
<p></p>
<h2 id="A_4.5_Check_of_the_installation"> 4.5 Check of the installation </h2>
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>musrfit</code> source tree at <strong>doc/examples/</strong>.<br>
If <code>musrgui</code> has been installed, just open one of the <strong>test-&#42;.msr</strong> files in the editor and test the <code>musrfit</code> functionalities. Otherwise, if only the terminal should be used, as an initial test for instance the following could be done:
<pre class="bash">
&#36; cd doc/examples
&#36; musrview test-histo-ROOT-NPP.msr
</pre>
<p></p>
<h2 id="A_4.6_Possible_problems"> 4.6 Possible problems </h2>
It might be that especially when running on Windows 7 <code>musredit</code> and <code>musrgui</code> produce errors like a "STATUS_ACCESS_VIOLATION".
In this case, try to do the following: Close all Cygwin programs (including the terminals and X server) and run from a Windows command prompt (cmd)<pre class="bash">
&#36; C:\cygwin\bin\ash.exe /bin/rebaseall
</pre>
If this does not resolve the problem, try to change the compatibility settings of <strong>C:\cygwin\bin\sh.exe</strong> and <strong>C:\cygwin\bin\bash.exe</strong> so that they are executed with administrator privileges.
<p></p>
<h1 id="A_5_Mac_OS_X"> 5 Mac OS X </h1>
<p></p>
With Mac OS X 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&mdash;<i>either</i> <code><a href="http://www.macports.org/">MacPorts</a></code> <em>or</em> <code><a href="http://www.finkproject.org/">Fink</a></code>&mdash;which provides open-source software is employed to fulfill the basic software requirements of <code>musrfit</code>. <span class='foswikiRedFG'>In the following, both possibilities (using <code>MacPorts</code> or <code>Fink</code>) are described but it is emphasized here that it should be followed <em>only one of the possible routes</em>.
<p></p>
WARNING: The instruction for <code>Fink</code> haven't been updated/tested for quite a while and likely are slightly outdated.
</span>
<p></p>
<p></p>
<p></p>
<h2 id="A_5.1_Requirements_40_61_61MacPorts_61_61_41"> 5.1 Requirements (<code><b>MacPorts</b></code>) </h2>
<h3 id="A_5.1.1_Everything_but_61_61ROOT_61_61_and_61_61NeXus_61_61"> 5.1.1 Everything but <code><b>ROOT</b></code> and <code><b>NeXus</b></code> </h3>
Before proceeding with the usage of the <code><a href="http://www.macports.org/">MacPorts</a></code> system first a few useful tools provided by Apple together with OS X (on the installation DVD/CDs) should be installed:
$ <a href="http://developer.apple.com/technology/tools.html">Xcode tools</a>: Useful developer tools including for instance the GNU compiler collection. Starting from XCode &gt;= 4.3 the command line tools need to be installed manually. <dl>
<dt> X11 </dt><dd> The X-window system (automatically installed on 10.5 Leopard and 10.6 Snow Leopard). For 10.7 and higher you also will need to install <code><a href="http://xquartz.macosforge.org/trac">XQuartz</a></code>
</dd></dl>
<p></p>
After installing the Xcode tools go to the <a 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 <code>MacPorts</code> system will be installed in <strong>/opt/local</strong>.<br>
To be sure that the newest version of the software is used a <code>MacPorts</code> upgrade should be performed by typing in a terminal:
<pre class="bash">
&#36; sudo port -v selfupdate
</pre>
<hr />
<strong>Remark</strong>: <code>MacPorts</code> uses <a 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 (<strong>and only then</strong>) it can be done in the following way: <ol>
<li> Get a local version of the repository:<pre class="bash">
&#36; svn co http://svn.macports.org/repository/macports/trunk/dports ~/dports
</pre>
</li> <li> Edit the file <strong>/opt/local/etc/macports/sources.conf</strong>: At the end of the file, comment the line beginning with "rsync://" and add a new line pointing to your local copy, e.g.<pre class="bash">
file:///Users/username/dports
</pre>
</li> <li> Synchronize the packages:<pre class="bash">
&#36; sudo port -v -d sync
</pre>
</li></ol>
<hr />
Then the <code>MacPorts</code> system should be set up and can be used to install additional software.<br>
The installation of the software mentioned <a class="foswikiCurrentTopicLink" href="#ReqSw">above</a> is then done in the terminal:
<pre class="bash">
&#36; sudo port -v install pkgconfig autoconf automake libtool fftw-3 fftw-3-single gsl boost libxml2 qt4-mac
</pre>
With <code><b>qt4-mac</b></code>, <code>musredit</code> will be installed. If it happens that you used <code>musrgui</code> in the past, please change over to <code>musredit</code> since there will be <strong>no</strong> further development for <code>musrgui</code> anymore!
<p></p>
<h3 id="A_5.1.2_Installation_of_61_61NeXus_61_61_requirements_40optional_41"> 5.1.2 Installation of <code><b>NeXus</b></code> requirements (optional) </h3>
<p></p>
<span class='foswikiRedFG'>Only if</span> <code>musrfit</code> should support reading data files in the <code>NeXus</code> format the further <a class="foswikiCurrentTopicLink" href="#ReqSwNeXus">required</a> packages are set up:
<pre class="bash">
&#36; sudo port -v install jpeg6b hdf4 hdf5
</pre>
Unfortunately, the <code>minixml</code> and <code>NeXus</code> libraries have to be compiled and installed directly from the source code. Given the respective version numbers of <strong>2.9</strong> and <strong>4.3.2</strong> (which are subject to change with time) this can be achieved for example by:
<pre class="bash">
&#36; cd
&#36; curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G &#124; tar xz
&#36; cd mxml-2.9
&#36; ./configure --prefix&#61;/usr/local
&#36; make
&#36; sudo make install
&#36; cd ..
&#36; curl http://download.nexusformat.org/kits/nexus-4.3.2-20140413svn1919.tar.gz -G &#124; tar xz
&#36; cd nexus-4.3.2-20140413svn1919
&#36; ./configure --prefix&#61;/usr/local
&#36; make
&#36; sudo make install
</pre>
<p></p>
<h3 id="A_5.1.3_61_61ROOT_61_61"> 5.1.3 <code><b>ROOT</b></code> </h3>
The best way to get <code>ROOT</code> exactly the way needed for <code>musrfit</code> is to install it from source. Before describing it, please make sure that you have installed all required packages listed under <a class="foswikiCurrentTopicLink" href="#ReqSw">Requested Software</a> (e.g. fftw, gsl, etc).
<p></p>
For the following it is assumed that <code>ROOT</code> shall be installed under <code>$HOME/Apps</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 <strong>not</strong> 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.
<pre class="bash">
&#36; cd &#36;HOME
&#36; # creat the Apps directory if not already present
&#36; mkdir Apps
&#36; cd Apps
&#36; git clone http://root.cern.ch/git/root.git
&#36; cd root
&#36; git tag -l
&#36; # git tag -l will list all available tags. In the next command choose the tag v5-34-xx
&#36; # where xx is the highest listed number, e.g. v5-34-32
&#36; git checkout -b v5-34-32 v5-34-32
&#36; # now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.
&#36; ./configure --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
&#36; # next will be the make. If running on a multicore CPU you can speed up tremendously by calling
&#36; # make with the option -j &#60;number&#62;, where &#60;number&#62; is the number of threads which you want to give,
&#36; # e.g. make -j8
&#36; make
</pre>
<p></p>
For further details see <a href="http://root.cern.ch/drupal/content/installing-root-source">Installing ROOT from Source</a>.
<p></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>ROOT</code> installation and to prepare already the installation of <code>musrfit</code> and <code>musrgui</code> / <code>musredit</code> this is a good time for setting necessary environment variables for the use in Mac OS X. Put the following lines (without the comments in parentheses and with the paths adjusted to your local installation) into the file <strong>~/.MacOSX/environment.plist</strong> and <span class='foswikiRedFG'>re-login</span>:<br>
<pre class="html">
&#60;?xml version&#61;&#34;1.0&#34; encoding&#61;&#34;UTF-8&#34;?&#62;
&#60;!DOCTYPE plist PUBLIC &#34;-//Apple//DTD PLIST 1.0//EN&#34; &#34;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#34;&#62;
&#60;plist version&#61;&#34;1.0&#34;&#62;
&#60;dict&#62;
&#60;key&#62;MUSRFITPATH&#60;/key&#62;
&#60;string&#62;&#36;HOME/Apps/root/bin&#60;/string&#62; (where to find the musrfit executables)
&#60;key&#62;QTDIR&#60;/key&#62;
&#60;string&#62;/opt/local/lib/qt3mac&#60;/string&#62; (where to find Qt3 (for musrgui) or Qt4 (for musredit))
&#60;key&#62;ROOTSYS&#60;/key&#62;
&#60;string&#62;&#36;HOME/Apps/root&#60;/string&#62; (where to find the ROOT system)
&#60;/dict&#62;
&#60;/plist&#62;
</pre>
<p></p>
<strong>For Mac OS X &gt;= 10.8:</strong>
<p></p>
One needs to add some system variables in <strong>~/.profile</strong>:
<pre class="bash">
export ROOTSYS&#61;&#36;HOME/Apps/root
launchctl setenv ROOTSYS &#36;ROOTSYS
export MUSRFITPATH&#61;&#36;ROOTSYS/bin
launchctl setenv MUSRFITPATH &#36;MUSRFITPATH
export PATH&#61;&#36;ROOTSYS/bin:&#36;QTDIR/bin:&#36;PATH
</pre>
<p></p>
<h2 id="A_5.2_Requirements_40_61_61Fink_61_61_41"> 5.2 Requirements (<code><b>Fink</b></code>) </h2>
<h3 id="A_5.2.1_Everything_but_61_61ROOT_61_61_and_61_61NeXus_61_61"> 5.2.1 Everything but <code><b>ROOT</b></code> and <code><b>NeXus</b></code> </h3>
Before proceeding with the usage of the <code><a href="http://www.finkproject.org/">Fink</a></code> system first a few useful tools provided by Apple together with OS X (on the installation DVD/CDs) should be installed:
$ <a href="http://developer.apple.com/technology/tools.html">Xcode tools</a>: Useful developer tools including for instance the GNU compiler collection <dl>
<dt> X11 </dt><dd> The X-window-system (automatically installed on 10.5 Leopard and 10.6 Snow Leopard)
</dd></dl>
<p></p>
After installing the Xcode tools go to the <a href="http://www.finkproject.org/download/index.php?phpLang=en">Fink download page</a>, download the installer for your system and follow the installation instructions on the page.
By default the <code>Fink</code> system is installed in <strong>/sw</strong>. After the basic setup make sure that in <strong>/sw/etc/fink.conf</strong> the line starting with <strong>Trees:</strong> reads like:
<pre>
Trees: local/main stable/main stable/crypto unstable/main
</pre>
After applying the changes above to the configuration file, the <code>Fink</code> core system should be upgraded to its newest version by typing in a terminal:
<pre class="bash">
&#36; sudo fink selfupdate
</pre>
Then the <code>Fink</code> system should be set up and can be used to install additional software.<br>
The <code>Fink</code> installer package also contains a graphical user interface called <code>FinkCommander</code> and it is suggested to use that for installing the following packages (or packages with revisions close to the following)&mdash;it is necessary to compile a few packages from source since no binary packages are available, however, this is done automatically by the <code>FinkCommander</code> after you have chosen the software packages for installation:
<p></p>
<code><b>autoconf automake boost1.41.nopython boost1.41.nopython-shlibs fftw3 fftw3-shlibs gsl gsl-shlibs libtool2 libtool2-shlibs libxml2 libxml2-bin libxml2-shlibs pkgconfig qt3mac qt3mac-shlibs</b></code>
<p></p>
Under OS X 10.6 Snow Leopard it will not be possible to install <code><b>qt3mac</b></code> since the system is by default a 64-bit system and the old <code><b>qt3-mac</b></code> depends on software which is only available for 32-bit systems. It is suggested to install <code><b>qt4mac</b></code> instead and use <code>musredit</code>.
<p></p>
Also, due to some not fulfilled dependencies, it might not be possible to install FFTW3 through Fink. In this case (<span class='foswikiRedFG'>and ONLY in THIS case</span>) simply download the FFTW3 source code from <a href="http://www.fftw.org/download.html">its download page</a> and install it from a terminal using the following commands (for the FFTW version 3.x.y):
<pre class="bash">
&#36; tar xz fftw-3.x.y
&#36; cd fftw-3.x.y
&#36; ./configure --enable-single --enable-shared --enable-threads --prefix&#61;/usr/local
&#36; make
&#36; sudo make install
</pre>
<p></p>
Since later on the <code>boost</code> header files should be used and in the standard <code>Fink</code> installation these are found at a version specific location, the later handling will be easier if a symbolic link to this files is created now in the terminal (if it did not exist earlier), e.g.:
<pre class="bash">
&#36; ln -sf /sw/include/boost-x&#95;yy&#95;z/boost /sw/include/boost
</pre>
where <strong>x_yy_z</strong> has to be substituted by the correct version number, e.g. <strong>1_41_0</strong>.
<p></p>
<h3 id="A_5.2.2_Installation_of_61_61NeXus_61_61_requirements_40optional_41"> 5.2.2 Installation of <code><b>NeXus</b></code> requirements (optional) </h3>
<p></p>
<span class='foswikiRedFG'>Only if</span> <code>musrfit</code> should support reading data files in the <code>NeXus</code> format the further <a class="foswikiCurrentTopicLink" href="#ReqSwNeXus">required</a> packages can be installed through <code>Fink</code>:
<p></p>
<code><b>libjpeg hdf hdf5-18 hdf5-18-shlibs</b></code>
<p></p>
Unfortunately, the <code>minixml</code> and <code>NeXus</code> libraries have to be compiled and installed directly from the source code. Given the respective version numbers of <strong>2.9</strong> and <strong>4.3.2</strong> (which are subject to change with time) this can be achieved for example by:
<pre class="bash">
&#36; cd
&#36; curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G &#124; tar xz
&#36; cd mxml-2.9
&#36; ./configure --prefix&#61;/usr/local
&#36; make
&#36; sudo make install
&#36; cd ..
&#36; curl http://download.nexusformat.org/kits/nexus-4.3.2-20140413svn1919.tar.gz -G &#124; tar xz
&#36; cd nexus-4.3.2-20140413svn1919
&#36; ./configure --prefix&#61;/usr/local
&#36; make
&#36; sudo make install
</pre>
<p></p>
<h3 id="A_5.2.3_61_61ROOT_61_61"> 5.2.3 <code><b>ROOT</b></code> </h3>
The best way to get <code>ROOT</code> exactly the way needed for <code>musrfit</code> is to install it from source. Before describing it, please make sure that you have installed all required packages listed under <a class="foswikiCurrentTopicLink" href="#ReqSw">Requested Software</a> (e.g. fftw, gsl, etc).
<p></p>
For the following it is assumed that <code>ROOT</code> shall be installed under <code>$HOME/Apps</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 <strong>not</strong> 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.
<pre class="bash">
&#36; cd &#36;HOME
&#36; # creat the Apps directory if not already present
&#36; mkdir Apps
&#36; cd Apps
&#36; git clone http://root.cern.ch/git/root.git
&#36; cd root
&#36; git tag -l
&#36; # git tag -l will list all available tags. In the next command choose the tag v5-34-xx
&#36; # where xx is the highest listed number, e.g. v5-34-32
&#36; git checkout -b v5-34-32 v5-34-32
&#36; # now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.
&#36; ./configure --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
&#36; # next will be the make. If running on a multicore CPU you can speed up tremendously by calling
&#36; # make with the option -j &#60;number&#62;, where &#60;number&#62; is the number of threads which you want to give,
&#36; # e.g. make -j8
&#36; make
</pre>
<p></p>
For further details see <a href="http://root.cern.ch/drupal/content/installing-root-source">Installing ROOT from Source</a>.
<p></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>ROOT</code> installation and to prepare already the installation of <code>musrfit</code> and <code>musrgui</code> / <code>musredit</code> this is a good time for setting necessary environment variables for the use in Mac OS X. Put the following lines (without the comments in parentheses and with the paths adjusted to your local installation) into the file <strong>~/.MacOSX/environment.plist</strong> and <span class='foswikiRedFG'>re-login</span>:<br>
<pre class="html">
&#60;?xml version&#61;&#34;1.0&#34; encoding&#61;&#34;UTF-8&#34;?&#62;
&#60;!DOCTYPE plist PUBLIC &#34;-//Apple//DTD PLIST 1.0//EN&#34; &#34;http://www.apple.com/DTDs/PropertyList-1.0.dtd&#34;&#62;
&#60;plist version&#61;&#34;1.0&#34;&#62;
&#60;dict&#62;
&#60;key&#62;MUSRFITPATH&#60;/key&#62;
&#60;string&#62;&#36;HOME/Apps/root/bin&#60;/string&#62; (where to find the musrfit executables)
&#60;key&#62;QTDIR&#60;/key&#62;
&#60;string&#62;/opt/local/lib/qt3mac&#60;/string&#62; (where to find Qt3 (for musrgui) or Qt4 (for musredit))
&#60;key&#62;ROOTSYS&#60;/key&#62;
&#60;string&#62;&#36;HOME/Apps/root&#60;/string&#62; (where to find the ROOT system)
&#60;/dict&#62;
&#60;/plist&#62;
</pre>
<p></p>
<strong>For Mac OS X &gt;= 10.8:</strong>
<p></p>
One needs to add some system variables in <strong>~/.profile</strong>:
<pre class="bash">
export ROOTSYS&#61;&#36;HOME/Apps/root
launchctl setenv ROOTSYS &#36;ROOTSYS
export MUSRFITPATH&#61;&#36;ROOTSYS/bin
launchctl setenv MUSRFITPATH &#36;MUSRFITPATH
export PATH&#61;&#36;ROOTSYS/bin:&#36;QTDIR/bin:&#36;PATH
</pre>
<h2 id="A_5.3_61_61musrfit_61_61"> 5.3 <code><b>musrfit</b></code> </h2>
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 musrfit repository via git. Assuming the code should be located in ~/Apps/musrfit this is achieved most easily calling from the terminal
<p></p>
<pre class="bash">
&#36; cd ~/Apps
&#36; git clone https://bitbucket.org/muonspin/musrfit.git
</pre>
or
<pre class="bash">
&#36; cd ~/Apps
&#36; git clone git://gitorious.psi.ch/nemu/musrfit.git
</pre>
<p></p>
<p></p>
<strong>Note:</strong> musrfit has moved from svn to git. In case you still have an <em>old</em> svn version of musrfit, it is advised to remove it first. For svn users: for a smooth transition from svn to git, please check the following link:
<a href="http://www.git-tower.com/blog/git-for-subversion-users-cheat-sheet/">Git for Subversion Users - A Cheat Sheet</a>.
<p></p>
If a local repository clone is already present, one can update it using:
<pre class="bash">
&#36; cd ~/Apps/musrfit
&#36; git pull
</pre>
<p></p>
<span class='foswikiRedFG'>As an alternative (if git is not available)</span>, the source code can also be downloaded from the following web-page: <a href="https://bitbucket.org/muonspin/musrfit/downloads">musrfit at bitbucket</a>.
<p></p>
After the source-code extraction the <strong>autogen.sh</strong> script is called to prepare the build environment. If it has been executed successfully the <strong>configure</strong> script should be ready to collect all the information needed to create the Makefiles. <span class='foswikiRedFG'>If <code>musrfit</code> should support <code>NeXus</code> data files this has to be enabled by specifying the <strong>--enable-NeXus</strong> switch when calling <strong>configure</strong>.</span> For an overview of all available options just call <code>./configure --help</code>. Besides the standard options there are a few special options which should be mentioned here:
<p></p> <dl>
<dt> --prefix </dt><dd> Specify the installation prefix, e.g. /opt/root-system (<em>by default: /usr/local</em>)
</dd> <dt> --with-rootsys </dt><dd> Specify the top of the <code>ROOT</code> installation directory, e.g. /opt/root-system
</dd> <dt> --with-fftw3 </dt><dd> Specify the prefix of the <code>FFTW3</code> installation. e.g. /sw
</dd> <dt> --with-gsl </dt><dd> Set the prefix of the <code>GSL</code> installation, e.g. /sw
</dd> <dt> --with-boostinc </dt><dd> Set the path to the header files of the <code>Boost</code> installation, e.g. /sw/include
</dd> <dt> --with-hdf4 </dt><dd> Set the prefix of the <code>HDF4</code> installation, e.g. /sw (<em>only useful in conjunction with the <code>NeXus</code> support</em>)
</dd> <dt> --with-hdf5 </dt><dd> Set the prefix of the <code>HDF5</code> installation, e.g. /sw (<em>only useful in conjunction with the <code>NeXus</code> support</em>)
</dd> <dt> --with-nexus </dt><dd> Set the prefix of the <code>NeXus</code> installation, e.g. /usr/local (<em>only useful in conjunction with the <code>NeXus</code> support</em>)
</dd> <dt> --with-qt3 </dt><dd> Set the prefix of the <code>Qt3</code> installation, e.g. /opt/local/lib/qt-3.3 (<em>only useful in conjunction with building <code>musrgui</code></em>)
</dd> <dt> --with-qt4 </dt><dd> Set the prefix of the <code>Qt4</code> installation, e.g. /opt/local/lib/qt-4.7 (<em>only useful in conjunction with building <code>musredit</code></em>)
</dd> <dt> --enable-NeXus </dt><dd> Enable the support of <code>NeXus</code> data files (<em>requires the <code>HDF4</code>, <code>HDF5</code> and <code>NeXus</code> libraries to be installed</em>).
</dd> <dt> --disable-editor </dt><dd> Disable the integrated building of <code>musredit</code>/<code>musrgui</code>.
</dd> <dt> --disable-omp </dt><dd> Switches off the <a href="http://en.wikipedia.org/wiki/OpenMP">OpenMP</a> features of <code>musrfit</code> (parallelization of the &chi;<sup>2</sup> calculation when compiled with GCC &ge; 4.2)
</dd></dl>
<p></p>
Normally it should not be necessary to make use of any of the options except for specifying the installation path with <strong>--prefix</strong>. The other paths should be detected automatically. If this does not work for some reason the <strong>configure</strong> script will terminate and ask for the information.
When the <strong>configure</strong> script has been called successfully everything is ready for building the <code>musrfit</code> libraries and executables. A standard installation sequence (without <code>NeXus</code> support) might then look like:
<pre class="bash">
&#36; cd ~/Apps/musrfit
&#36; sh autogen.sh
&#36; ./configure --prefix&#61;&#36;ROOTSYS
&#36; make
&#36; make install
</pre>
In order to finish the installation of <code>musrfit</code> the paths where <code>musrfit</code> searches for data files should be adjusted in the installed <strong>musrfit_startup.xml</strong> ($ROOTSYS/bin/musrfit_startup.xml). For detailed information on this XML file refer to the <a href="MusrFit.html#MusrfitStartupXml">manual</a>.
<p></p>
<span id="MusrGuiInstall"></span>
<h2 id="A_5.4_61_61musredit_61_61"> 5.4 <code><b>musredit</b></code> </h2>
<span class='foswikiBlueFG'>In the latest version of <code>musrfit</code> the configure script tries to determine automatically if <code>Qt4.5</code> or higher is set up on the machine. In case this is found, the editor <code>musredit</code> is built already together with <code>musrfit</code>. <em>If not</em>, one can either try to call the configure script with the "--with-qt4" option (<strong>MacPort</strong>: for Mac OS X &lt; 10.11 this is likley <strong>/opt/local/libexec/qt4</strong>, for Mac OS X &gt;= 10.11 this is likely <strong>/usr/local/libexec/qt4</strong>) or install this editor separately:</span>
<pre class="bash">
&#36; cd ~/Apps/musrfit/src/musredit
&#36; qmake musredit.pro
</pre>
If everything went fine <code>musredit</code> can be compiled and installed:
<pre class="bash">
&#36; make
&#36; make install
</pre>
The last command copies <strong>musredit.app</strong> to the standard program directory <strong>/Applications</strong> and the <strong>musredit_startup.xml</strong> to <strong>$ROOTSYS/bin/musredit_startup.xml</strong>. Eventually, in the installed <strong>musredit_startup.xml</strong> the path specifications have to be adjusted to match the local <code>musrfit</code> installation. For detailed information on this XML file refer to the <a href="MusrGui.html#MusrguiStartupXml">manual</a>.
<p></p>
<h2 id="A_5.5_61_61musrgui_61_61_40obsolete_41"> 5.5 <code><b>musrgui</b></code> (obsolete) </h2>
If <code>Qt3</code> is set up the installation of the <code>musrfit</code> editor can be done as follows from within the shell:
<pre class="bash">
&#36; cd ~/Apps/musrfit/src/musrgui
&#36; qmake musrgui.pro
&#36; make
&#36; make install
</pre>
The last command copies <strong>musrgui.app</strong> to the standard program directory <strong>/Applications</strong> <a name="FootNote3text"></a><span class="FootNoteTextLink" title="In the case &#61;&#61;qt3&#45;mac&#61;&#61; has not been installed&#44; there will be no &#42;musrgui&#46;app&#42; but only the executable &#42;musrgui&#42; which will be placed in the directory &#42;&#36;ROOTSYS&#47;bin&#42; and has to be called from the terminal&#46;"><a class="foswikiCurrentTopicLink" href="#FootNote3note">(4)</a></span> and the <strong>musrgui_startup.xml</strong> to <strong>$ROOTSYS/bin/musrgui_startup.xml</strong>. Eventually, in the installed <strong>musrgui_startup.xml</strong> the path-specifications have to be adjusted to match the local <code>musrfit</code> installation. For detailed information on this XML file refer to the <a href="MusrGui.html#MusrguiStartupXml">manual</a>.
<p></p>
Under some circumstances it might happen, that if <code>musrgui</code> was called from <code>Finder</code> the necessary libraries for executing <code>musrfit</code> could not be found.
In that case, the only workaround for the moment is to export the environment variable <strong>DYLD_LIBRARY_PATH</strong> in the shell and call <code>musrgui</code> from a terminal!
In order to accomplish that, add the following lines to <strong>~/.profile</strong> and call <code>musrgui</code> with the specified command (e.g. mgui):
<pre class="bash">
export DYLD&#95;LIBRARY&#95;PATH&#61;/opt/root-system/lib:/sw/lib:&#36;DYLD&#95;LIBRARY&#95;PATH
alias mgui&#61;&#39;/Applications/musrgui.app/Contents/MacOS/musrgui&#39;
</pre>
<p></p>
<p></p>
<p></p>
Notes
<p></p>
<a name="FootNote2note"></a><span class="FootNoteLabel"><a href="#FootNote2text"><b>2</b></a></span>: <span class="FootNote"> When using <code>GCC</code> &#8805; 4.2 please make sure that the environment variables <strong>USE_PARALLEL_MINUIT2</strong> and <strong>USE_OPENMP</strong> are <em>not</em> set! Otherwise <code>MINUIT2</code> will be compiled with parallelization support and cannot be used together with <code>musrfit</code> afterwards since the <code>musrfit</code> code is <em>not</em> fully thread-safe! When compiled with <code>GCC</code> &#8805; 4.2 <code>musrfit</code> itself will parallelize the &chi;<sup>2</sup> calculation.</span>
<p></p>
<a name="FootNote3note"></a><span class="FootNoteLabel"><a href="#FootNote3text"><b>4</b></a></span>: <span class="FootNote">In the case <code><b>qt3-mac</b></code> has not been installed, there will be no <strong>musrgui.app</strong> but only the executable <strong>musrgui</strong> which will be placed in the directory <strong>$ROOTSYS/bin</strong> and has to be called from the terminal.</span>
<p></p>
<p></p>
<p></p>
<hr />
<p></p>
<h2 id="A_5.6_Check_of_the_installation"> 5.6 Check of the installation </h2>
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>musrfit</code> source tree at <strong>doc/examples/</strong>.<br>
If <code>musrgui</code> has been installed, just open one of the <strong>test-&#42;.msr</strong> files in the editor and test the <code>musrfit</code> functionalities. Otherwise, if only the terminal should be used, as an initial test for instance the following could be done:
<pre class="bash">
&#36; cd ~/Apps/musrfit/doc/examples
&#36; musrview test-histo-ROOT-NPP.msr
</pre>
<p></p>
-- <a href="http://www.psi.ch/low-energy-muons/people">AS</a> &amp; <a href="http://www.fsf.org/register_form?referrer=8369">BMW</a></div>
<p></p>
<p></p>
</div>
<div class="patternInfo">This topic: MUSR<span class='foswikiSeparator'>&nbsp;&gt;&nbsp;</span><a class="foswikiCurrentWebHomeLink" href="WebHome.html">WebHome</a> &gt; <a href="MusrFit.html">MusrFit</a><span class='foswikiSeparator'>&nbsp;&gt;&nbsp;</span>MusrFitSetup <br />
Topic revision: <span class='patternRevInfo'>23 Nov 2015, suter_a</span></div>
</div>
</div>
</div>
</div><div id="patternBottomBar"><div id="patternBottomBarContents"><div id="patternWebBottomBar"><span class="foswikiRight"> <a href="http://foswiki.org/"><img src="../pub/System/ProjectLogos/foswiki-badge.png" alt="This site is powered by Foswiki" title="This site is powered by Foswiki" /></a></span>Copyright &copy; by the contributing authors. All material on this collaboration platform is the property of the contributing authors. <br /> Ideas, requests, problems regarding PSI Wiki? <a href='mailto:thomas.buecklers@psi.ch?subject=PSI Wiki %20Feedback%20on%20MUSR.MusrFitSetup'>Send feedback</a></div></div></div>
</div>
</div>
</div>
</div></div><!-- /endWrap -->
<p></p>
<!-- Piwik -->
<noscript><p><img src="../piwik/piwikf832.gif?idsite=7" style="border:0" alt=""></p></noscript>
<!-- End Piwik Tag -->
</body>
<!-- Mirrored from intranet.psi.ch/MUSR/MusrFitSetup?cover=print by HTTrack Website Copier/3.x [XR&CO'2010], Thu, 28 Apr 2016 07:39:42 GMT -->
<!-- Added by HTTrack --><meta http-equiv="content-type" content="text/html;charset=utf-8"><!-- /Added by HTTrack -->
</html>