iFit: Changes and Bugs


  1. Releases and Changes
  2. Bugs list:
    1. File path names do not support spaces
    2. Data set maximum size
    3. CDF files written by Matlab can not be read by other software (hdfview, ncBrowse)
    4. Convolution brings strange results (Models/fconv)
    5. Too many warnings displayed
    6. Execution/compilation issue with text files importer (iLoad/iData/load, looktxt, CrysFML/cif2hkl)
    7. Limitations in the standalone (binary) package
    8. McStas and external programs can not be found from Matlab/iFit
    9. iFit standalone can not be launched (libmwmclmcrrt.so)
    10. iFit crashes when typing special characters (accents, ...)
    11. iFit fails with a message such as 'version `GFORTRAN_1.4' not found' or 'version `GCC_4.3.0' not found'
    12. Import of a text file fails
    13. Model sqw_phonon fails with Dacapo/Jacapo and MPI

Releases and Changes

Bugs list:

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. The test may be aborted by closing the progress bar window.

Please report bugs to ifit-users@mccode.org or to me [farhi (at) ill.fr]. You are encouraged to register to the ifit-users list.

File path names do not support spaces

Under Windows systems, file names including spaces, such as in 'My Documents' may not be supported properly. In this case, move your files and directories to another location which does not contain spaces.

Data set maximum size

The iFit package may currently handle routinely data sets up to few 100 Mb. Larger data sets can still be loaded, but are restricted by the disk access and the available memory. Currently, text files can be read at about 8 Mb/s, mainly limited by the hard disk speed. Some binary files can be imported faster (HDF initial access is nearly immediate, whatever be the file size). We recommend to use SSD to load files with increased efficiency.

CDF files written by Matlab can not be read by other software (hdfview, ncBrowse)

The CDF format (which you can view with OpenDX and Autoplot) is incompatible with the NetCDF one (which you can e.g. view with ncview, hdfview, ncBrowse, Panoply). In such cases, we recommend to rather export in HDF5 format with:
>> save(object, 'file.hdf5')

Convolution brings strange results (Models/fconv)

The fconv function (FFT convolution) provided in the Models sub-library requires the two signals sampling not to be too coarse. Axes values too sparse will lead to inaccurate results. One solution is to re-sample the signals with more points. For iData objects, this can be achieved with e.g. the interp(object, 3) to triple the number of points along axes.

Too many warnings displayed

If the warnings being displayed produce too much output, you may reduce the level of verbosity with:
>> warning off backtrace	% reduce the warning message length
>> warning off % suppress all warnings (not recommended)

Execution/compilation issue with text files importer (iLoad/iData/load, looktxt, CrysFML/cif2hkl)

You should first try the automatic fix procedure:
>> iLoad('force')	% checks and possibly re-compiles text and CBF importers
>> iLoad('compile') % fully re-compiles text and CBF importers
The recompilation tries to:
  1. use the matlab mex command (requires a valid C compiler supported by Matlab) ;
  2. use of any other C compiler such as gcc, ifc, pgcc, clang/llvm, tcc;
  3. use any Fortran compiler such as gfortran, g95, pgfc, ifort.
Most systems provide a default C compiler.
You may need to select the compiler with the mex -setup command from Matlab, but as said above, any other compiler can be used.

In some cases, the provided iFit/Loaders/private/looktxt commands may fail to execute (wrong architecture, missing library).
Under Windows 64bit systems, you may need the Visual C++ runtime libraries e.g. msvc[mpr]90.dll which are provided with the Visual C++ installation (see below), to put in the Windows system directory.

It has been reported that MeX compilation may fail when spaces are part of the path name to the iFit location (esp. under Windows systems). Move iFit to an other location which does not include spaces in its name (e.g. avoid My Documents) for compilation.

Manual compilation

If all this fails, you can try a manual compilation as follows.

A C compiler is required to make use of the generic text importer looktxt. Navigate to the iFit/Libraries/Loaders/private directory, and issue:
# gcc -O2 -o looktxt looktxt.c -lm
A Fortran compiler is required when using cif2hkl (CIF,CFL,PCR,ShelX files), especially for the Rietveld model function. Navigate to the iFit/Scripts/Models/scattering/powder_diffraction directory and issue:
# gfortran -O2 -o cif2hkl cif2hkl.F90 -lm
which creates a cif2hkl executable file, used by iFit. Remove the collateral *.mod files.

Once done, check from iFit:
>> iLoad('force')	% checks and possibly re-compiles text and CBF importers
Refer to the related item in the Install page.

Limitations in the standalone (binary) package

When running the standalone version (binary), new Matlab functions can not be defined, except anonymous functions (inline). You may use iFunc models as a substitute. Also, the doc, web and edit commands are limited, and may not work properly, depending on the system.

McStas and external programs can not be found from Matlab/iFit

The location of executable programs available from the system are stored in the PATH environment variable. But on some systems (e.g. MacOSX), this variable is not fully initialised when used from Matlab/iFit.

The following issue may show-up for any external program launched from Matlab/iFit, e.g. McStas, PHON, Quantum Espress, ASE. We detail the case of 'mcstas'.

To diagnose this issue, open a Terminal, and test if e.g. 'mcstas' is properly installed (the example below if for MacOSX/Linux):
% mcstas -v
mcstas-2.3-rc2 version 2.3-rc2 (Nov. 16, 2015)
Copyright (C) DTU Physics and Risoe National Laboratory, 1997-2015
Additions (C) Institut Laue Langevin, 2003-2015
All rights reserved
% which mcstas
/usr/bin/mcstas
Then you need to add the path to 'mcstas' executables inside the PATH variable seen from Matlab.
Type, from Matlab/iFit prompt:
>> setenv('PATH', [getenv('PATH') ':/usr/local/bin' ':/usr/bin' ':/usr/share/bin' ]);	% under MacOSX and Linux
>> setenv('PATH', [getenv('PATH') 'C:\mcstas\bin' ]); % under Windows
Once done, e.g. McStas and other programs will be immediately reachable from Matlab/iFit.
This procedure may have to be repeated whenever Matlab/iFit is (re)started.

iFit standalone can not be launched (libmwmclmcrrt.so)

When starting iFit standalone, you get a message such as:

./run_ifit: error while loading shared libraries: libmwmclmcrrt.so: cannot open shared object file: No such file or directory

This message indicates that the Matlab Runtime Library has not been found. Instal the MCR as indicated in the Install page. You may have to edit the 'ifit' command and set the location of the MCR. Alternatively, you can set the MCRROOT environment variable to point to it, e.g. under bash (Linux/Mac OSX):

iFit crashes when typing special characters (accents, ...)

The iFit standalone (compiled version) can be used from the prompt/command line, within a terminal. However, the Matlab readline library can not handle properly localised characters (e.g. with accents, for specific languages) [bug 624817].

You thus have to be cautious when typing, to avoid e.g. , , , and so on, or an immediate crash will occur, without saving your work, and save your work regularly. US keyboard characters are all fully supported.

iFit fails with a message such as 'version `GFORTRAN_1.4' not found' or 'version `GCC_4.3.0' not found'

Matlab comes with its own C and Fortran libraries (e.g. in MATLABROOT/sys/os/<arch>/). Some of these may not match those from the running system (seen on Linux systems).

The following issue may show-up for any external program launched from Matlab/iFit, e.g. McStas, PHON, Quantum Espress, ASE, looktxt, cif2hkl.
In this case, as e.g. McStas runs from a Matlab environment that overloads libraries on top of the normal libraries from the system - used by external programs - you may get a message such as (here libgfortran.so is faulty) :
Can't load '/usr/local/lib/perl/5.12.4/auto/PGPLOT/PGPLOT.so' for module PGPLOT: 
/usr/local/MATLAB/R2012a/sys/os/glnxa64/libgfortran.so.3: version
`GFORTRAN_1.4' not found
(required by /usr/lib/libpgplot.so.5) at
/usr/lib/perl/5.12/DynaLoader.pm line 192.
at /usr/local/lib/mcstas/tools/perl/mcstas_config.perl line 123
A similar message has also been reported for the libgcc_s.so library with error e.g. 'version `GCC_4.3.0' not found'.

On an Apple Mac OS X system, the faulty library is e.g.
/Applications/MATLAB_R2010a.app/sys/os/maci64/libgfortran.3.dylib
In order to solve this, you need to either remove or update the faulty Matlab libraries with the one from the system. The following procedure is valid for Linux systems (where it was identified), assuming Matlab has been installed in e.g. MATLABROOT = /usr/local/MATLAB/R2012a - but it may also be in e.g. /opt/MATLAB/R2012a.

The first attempt is to simply rename the faulty library shipped with Matlab, e.g. (you may also remove it):
# sudo mv /usr/local/MATLAB/R2012a/sys/os/glnxa64/libgfortran.so.3 /usr/local/MATLAB/R2012a/sys/os/glnxa64/libgfortran.so.3.org
or
# sudo mv /usr/local/MATLAB/R2012a/sys/os/glnxa64/libgcc_s.so.1 /usr/local/MATLAB/R2012a/sys/os/glnxa64/libgcc_s.so.1.org
Then restart Matlab/iFit to check if the issue is solved.

If this is still not solved, we then look for locations of the faulty library in the system (requires package locate or mlocate to be installed - alternatively you can use ldconfig -v and look where libgfortran appears in the long list...)
# locate libgfortran.so
/usr/lib/x86_64-linux-gnu/libgfortran.so.3 <- this is the library from the system, to put in the Matlab location
Then we first make a copy of the initial Matlab library to update
# sudo mv /usr/local/MATLAB/R2012a/sys/os/glnxa64/libgfortran.so.3 /usr/local/MATLAB/R2012a/sys/os/glnxa64/libgfortran.so.3.org
Then we copy the library from the system into the Matlab location
# sudo ln -s /usr/lib/x86_64-linux-gnu/libgfortran.so.3 /usr/local/MATLAB/R2012a/sys/os/glnxa64/
Then, you need to restart Matlab/iFit to notice the issue has been fixed.

Import of a text file fails

You can try the automatic fix procedure:
>> iLoad('force')	% checks and possibly re-compiles text and CBF importers
>> iLoad('compile') % fully re-compiles text and CBF importers
If this fails, then first check that the looktxt command is working (this will appear in the error message). If not, remove the invalid one (in iFit/Libraries/Loaders/private) and restart the importation. A new external command will be compiled from the source (requires a valid compiler, see above).

If the executable looktxt is valid, but you can not import a reluctant text file, try the most tolerant text reader configurations:
>> iData('filename','text format with fast import method')
>> iData('filename','Data (text format)')
will import the raw content, without post formatting of the object in memory. You will probably need to assign manually some of the Signal and Axes (see iData object help).

Text files containing NaN's inside matrices are not imported properly in iFit version <= 1.6 (NaN is read as a text inside a matrix, and thus breaks the matrix into bits). One way is to replace all NaN's by 0 values. This also stands for Inf's and other text embedded inside numerical blocks.

Model sqw_phonon fails with Dacapo/Jacapo and MPI

You should check the executable 'dacapo_mpi.run' from the command line. If an error message indicates missing libraries 'libmpi_f90.so.0' and 'libmpi_f77.so.0', then first check that openmpi is installed and identify the actual library with e.g.:
% locate libmpi_f77.so
/usr/lib/libmpi_f90.so.1
then create a soft link from the existing library to the missing one:
% sudo ln -s /usr/lib/libmpi_f90.so.1 /usr/lib/libmpi_f77.so.0


E. Farhi - iFit/Changes - Mar. 22, 2017 1.9 - back to Main iFit Page ILL,
            Grenoble, France <www.ill.eu>