iFit: Installation

  1. Requirements
    1. Stand-alone / run-time release / no Matlab license required
    2. Matlab - source code release
    3. C compiler (optional)
    4. Fortran compiler (optional)
    5. Python/NumPy (optional)
    6. McStas / McXtrace (optional, neutron scattering instrument ray-tracing)
    7. Lattice-dynamics (optional, DFT ab-initio)
    8. Nuclear engineering (optional)
  2. Obtaining the package / Download
  3. Installation - stand-alone distribution
    1. On Debian Linux systems
    2. On Other Linux systems
    3. On MacOSX systems
    4. On Windows systems
  4. Installation - VirtualMachine
  5. Installation - source distribution
    1. Recompiling external commands
  6. What's next ?
  7. Subscribe to the user mailinglist


In short, you do not need many dependencies. Basic usage only requires a running system, and to install the iFit package. Further add-ons can be installed later.

Stand-alone / run-time release / no Matlab license required

the iFit standaloneWhen installing a 'stand-alone' release of iFit, you only need to install the Matlab Compiler Runtime (free), available below. There is NO other dependency. The package contains everything required. The stand-alone package is distributed for Linux, Windows and Mac OSX systems. See below to download the required stand-alone package.

The stand-alone version provides full iFit functionality at no cost. You can execute any script (list of commands) using iFit and Matlab functions. However, you can not define new functions.
Refer to the 'stand-alone' release of iFit page for more information on the features and limitations.

Matlab - source code release

The only requirement is to have Matlab installed. Any Matlab version from 7.4 (R2007a) will do, no need for any additional toolbox. This is a commercial product. Student versions can be bought for lower prices, as well as Academic licenses (e.g. for Universities). See below to download the required source package.

C compiler (optional)

In principle, the external executable files (looktxt, cbf_uncompress) are shipped with the package, so that the software is ready to run. However, in the event of a required re-compilation, a C compiler is often shipped with Matlab (and installed automatically). The Loaders library may use it sporadically. This is not required for stand-alone versions. Refer to the Changes/Bugs page in case of troubles.

Fortran compiler (optional)

The CIF/CFL/PCR/ShelX file support is available when the cif2hkl program can be compiled (usually this is done automatically). We supply these executable files in the Download/binary section of the iFit web site. In principle, you do not need this. This is not required for stand-alone versions. In case you would, we recommend to install gfortran, which exists for all systems (for windows, get the single file installer). Refer to the Changes/Bugs page in case of troubles.

Python/NumPy (optional)

iFit can be transparently used from Python/NumPy. In principle, this is better suited for users not wanting to use Matlab, preferring the Python language. You will need to install Python and NumPy. We recommend the Python(x,y) for Windows, Anaconda, or Enthought Canopy for all systems. Refer to our PyFit help page.

McStas / McXtrace (optional, neutron scattering instrument ray-tracing)

In case you wish to use iFit in order to perform iterative/optimised McStas/McXtrace neutron Monte-Carlo ray-tracing simulations, you obviously need to install these packages. Refer to our McStas help page.

Lattice-dynamics (optional, DFT ab-initio)

In case you wish to perform lattice dynamics computations to estimate the phonon dispersion relations in solid state materials, you will need to install at least the ASE. Please read the Phonons documentation. Warning: Most of the DFT codes are designed to run on Linux systems. We thus recommend you start from a Debian-class system, or use a Virtual machine.

Nuclear engineering (optional)

To facilitate the handling of e.g. ENDF and ACE files, the PyNE environment may be installed.
Ubuntu LinuxWe prefer Linux systems, such as Ubuntu, when handling large data sets, and performing McStas optimizations, so that we fully use multi-core systems (e.g. through threads and MPI). You may use our ILL/CS Live Ubuntu-iFit ready-to-run systems with Phonons, McStas and iFit (standalone) all pre-installed, to try-out.

Obtaining the package / Download

The package is currently available from the ifit.mccode.org web site:

matlabSource code
Requires a Matlab license to run [ Download zip, 50 Mb, Changes ]
linux Linux
64 bits:
Debian: see below.
Other: Use the MCR bin installer and zip archives.
windows Windows
64 bits: Use the MCR installer then the iFit installer.
mac Mac OSX 64 bits: Use the iFit.app, which includes the MCR (no need to install it separately). Use Ctrl-click/Open to allow the application the first time.
iso-usbVirtualBox appliance (OVA)
For all computers using VirtualBox. Get it HERE or HERE. Assign 4 Gb mem, all your CPU cores. Login 'lambda' with 'illill'.

Installation - stand-alone distribution

Debian-class systems (e.g. Ubuntu, Mint, Debian, etc...) are our best choice. To get a complete new system, first install e.g. Ubuntu (see here), then apply the following procedure to add iFit.

On Debian Linux systems

An easy way to install packages on an already installed Debian-class system is to make use of the mccode.org repository. Use e.g. for Ubuntu 16.04 Xenial:

% cd /etc/apt/sources.list.d
% sudo wget http://packages.mccode.org/debian/mccode-xenial.list
or for Ubuntu 14.04 Trusty/Debian 8 Jessie
% sudo wget http://packages.mccode.org/debian/mccode.list
% sudo apt-get update
% sudo apt-get install ifit mcrinstaller libxmu6 libxt6 libxp6 libxpm4 libxc1
and for Phonons, McStas and nuclear engineering stuff
% sudo apt-get install ifit-phonons pyne mcstas-suite

This can also be done from e.g. Synaptic (menu Settings/repositories) and Ubuntu Software Center (menu Edit/Software Sources) ; tab Other Software/Add... Then select packages ifit and mcrinstaller and install them.
If you use the Debian package installers (.deb), nothing else is required. Double click the deb packages (MCR, then iFit) and wait. Then you can start iFit from the Dash or from menu Applications/Education/iFit. Drag-n-drop of data files is possible on the iFit launcher, as well as on operator icons from /usr/local/ifit/.

You can also install the packages manually by directly accessing our Deb repository, get the Debian packages, e.g. ifit-x.y and mcrinstaller, then (fix the file names):

% sudo dpkg -i ifit-x.y-amd64.deb mcrinstaller-7.13-amd64.deb libxp6

If you do not have Matlab, the installer will ask you if you wish to use iFit as a replacement, then will automatically create a link:

% sudo ln -s /usr/local/ifit/ifit /usr/local/bin/matlab

On Other Linux systems

We recommend to install the MCR in /opt/MATLAB (requires administrative privileges).

chmod u+x MCRINstaller.bin
sudo ./MCRInstaller.bin

Prefer the /opt/MATLAB location.
Then install the iFit stand-alone package where-ever you wish (/usr/local/ifit is recommended). Launch ifit from there.
If you have not installed the MCR in /opt/MATLAB, you need to define the MCRROOT environment variable to its location prior to starting iFit :

export MCRROOT=/opt/MATLAB/MATLAB_Compiler_Runtime/v713/

If you do not have Matlab and wish to use iFit as a replacement, create a link:

% sudo ln -s /usr/local/ifit/ifit /usr/local/bin/ifit
% sudo ln -s /usr/local/ifit/ifit /usr/local/bin/matlab

On MacOSX systems

The prepared iFit App contains the Matlab Runtime which does not need to be installed separately.

To Open the iFit App the first time and pass the authentication step, press the left Ctrl key and click the iFit icon (after extraction from the ZIP). Then select the Open button.

You can also place the iFit directory in /Applications or /usr/local/ifit, and create links, especially if you do not have Matlab and wish to use iFit as a replacement:

% sudo ln -s /usr/local/ifit/ifit /usr/local/bin/ifit
% sudo ln -s /usr/local/ifit/ifit /usr/local/bin/matlab
Recent MacOSX systems (El capitan, Sierra) provide a Java 7 or 8 version, whereas the standalone requires a Java 6. Install the Java 6 from here, then install iFit standalone.
Also, you may need to install an X server. Get it at https://www.xquartz.org/.

Warning: install all DFT codes for Phonons is not easy under Mac OSX. We then recommend you run a VirtualBox machine (see below). Refer to the dedicated phonon-oriented installation.

On Windows systems

Install the MCR by double-clicking the corresponding MCRInstaller.exe. The install location defaults to C:\Program Files\MATLAB. Then use the iFit installer.

To launch iFit, click on the 'ifit' icon in the installation directory. You can also drag-n-drop files on the iFit icon to directly import data files and plot them (Linux and Windows systems). This also works when using the operators short cuts included in the iFit standalone directory (under Linux).

Warning: Phonons: installing all DFT codes for Phonons is not easy under Windows. We then recommend you run a VirtualBox machine (see below), or use the Windows Subsystem. Refer to the dedicated phonon-oriented installation.

Installation - VirtualMachine

It is possible to use a prepared distribution containing iFit, Phonons and McStas, all pre-installed. Get it HERE

Install e.g. VirtualBox. Then import our VirtualBox Appliance (OVA). This is a pre-installed Virtual machine with iFit, Phonons, McStas and PyNE. Assign it e.g. 4 Gb memory, 30 Gb disk, and all your CPU cores. The user account is 'lambda' and its pass word is 'illill'.

Installation - source distribution

You just need to copy the iFit directory somewhere, say in /path/to.
  1. Extract first the iFit archive if needed.
  2. Just drag-drop the iFit directory in the target location that suits you.
For our users who love challenges and command lines, this may be achieved e.g. with
% unzip iFit.zip
% cp -r iFit /path/to
Start Matlab by clicking on its icon or typing the matlab command in a terminal.Matlab icon
% matlab
In order to use iFit, you need to import all its methods into Matlab each time you start it (this may be automated from the startup.m file).
>> addpath(genpath('/path/to/iFit'))
This can also be done from the Matlab menu File/Set Path.../Add with subfolders... then enter the iFit location, and Save. That's all !

A list of fixed bugs and release history is recorded in the Changes page.

Recompiling external commands

Windows 64 (XP, Vista, 7, 8)
The Loaders sub library and cif2hkl make use of MeX/external commands. Pre-compiled versions for Windows systems are shipped with the package but this binary may fail with some Matlab releases.

It is possible for re-compilation to use the Matlab compilation infrastructure 'mex'. In that case, it is required to install a compatible C compiler (currently Microsoft Visual C++). The required downloads are, in order, C++ Express then the SDK (for Matlab >= 2010). Older Microsoft Visual C++ 2008 [ISO] can also be used together with the SDK for Windows 7 + NET 3.5 [amd64 ISO]). Just use the default installation settings, then use
>> mex -setup							% select compiler
[1] Microsoft Windows VS2008
>> addpath(genpath('/location/to/iFit')) % install iFit
>> iLoad compile % reload importer methods and recompile looktxt, cbf_uncompress and cif2hkl
When mex is not configured, you may install any C compiler of: gcc, ifc, pgcc, clang/llvm, tcc.
To compile cif2hkl, you should install a Fortran compiler such as: gfortran, g95, pgfc, ifort.

Then force the recompilation of external commands with:
>> iLoad compile
Other systems (Windows 32, Linux, MacOSX)
All other platforms provide a valid C compiler
In order to check and force the recompilation of external commands, launch
>> iLoad compile
from the Matlab prompt. The C compiler to use may have to be specified with the command '>> mex -setup'. Send me the newly compiled looktxt MeX file in a tar.gz/zip archive, so that I update/add it to the distribution.

Refer to the related item in the Changes/Bugs page, especially for manual compilation.

What's next ?

You may test the package integrity by issuing the command:
>> ifittest
which will test, in a few minutes, all the examples given in this documentation and report failures. In principle all should go right. Refer to the iFit Help in case of trouble.
You may start with the Quick Start or the miFit page to learn what iFit can do for you.

Subscribe to the user mailinglist

The ifit-users is the list set-up in order to exchange information (issues, questions, announcements). Messages should be sent to ifit-users@mail.mccode.org.

You may register by entering your email address and press subscribe:

E. Farhi - iFit Installation - Nov. 27, 2018 $Revision: 1280 $ - back to Main iFit Page ILL,
          Grenoble, France <www.ill.eu>