#---------------------------------------------------------------------
# INSTALL
#---------------------------------------------------------------------

There are currently two ways to build musrfit,

1) using automake tool chain (this will be phased out until 2019)
2) using cmake tool chain (this will be the default starting from now)

In what follows we assume that the system variable ROOTSYS is already
defined and points to the installation directory of CERN/ROOT.

#----------------------------------
# Install using automake tool chain
#----------------------------------

To get it built:

   sh autogen.sh
   ./configure --prefix=$ROOTSYS             (or where ever musrfit should be installed)
   make
   make install                              (as superuser -- maybe)
   /sbin/ldconfig                            (as superuser)   

configure comes with a couple of options. For details execute

  ./configure --help

or check under http://lmu.web.psi.ch/musrfit/user/MUSR/MusrFitSetup.html
for a detailed description.

For example, to include NeXus support and BNMRlibs,

   sh autogen.sh
   ./configure --enable-NeXus --enable-BNMRlibs --prefix=$ROOTSYS 
   make 
   make install                              (as superuser -- maybe)
   /sbin/ldconfig                            (as superuser)
   
If all goes well, you should be good to go ;-)

#----------------------------------
# Install using cmake tool chain
#----------------------------------

cmake minimal required version is 3.6.

musrfit supports only out-of-source cmake build! Hence, go to the musrfit
directory and

   mkdir build
   cd build 
   cmake ../ -DCMAKE_INSTALL_PREFIX=$ROOTSYS (or where ever musrfit should be installed)
   cmake --build ./ --clean-first
   make install                              (as superuser -- maybe)
   /sbin/ldconfig                            (as superuser)
    
cmake configuration allows a couple of switches.  For details check the documentation at 

   http://lmu.web.psi.ch/musrfit/user/MUSR/MusrFitSetup.html

An example with NeXus support and BMWlibs needed would look like this

   mkdir build
   cd build
   cmake ../ -Dnexus=1 -DBMWlibs=1 -DCMAKE_INSTALL_PREFIX=$ROOTSYS 
   cmake --build ./ --clean-first
   make install                              (as superuser -- maybe)
   /sbin/ldconfig                            (as superuser)

If all goes well, you should be good to go ;-)

#----------------------------------
# Link to the documentation
#----------------------------------

More information regarding software requirements and installation can be found at

   http://lmu.web.psi.ch/musrfit/user/MUSR/MusrFitSetup.html

#---------------------------------------------------------------------
# good luck ...
#---------------------------------------------------------------------
