Installing Int3D

Int3D is an open-source software that can be installed either from binaries or from the source code. While installing from binaries is straightforward, building Int3D from the source code requires experience with code compilation.

Installation from binaries

Binaries can be downloaded from the Int3D website.

Windows

Download and unzip the file int3d08_win64.zip. After unzipping, the folder int3d08/ will be created, containing the executable int3d08 and the subfolder _internal/. Run the executable by double-clicking on it. The user interface may take a while to appear, about half a minute. Please be patient.

Linux

Download the file int3d08_lin64.tgz and extract its contents from a terminal window:

tar -zxvf int3d08_linux64.tgz

The folder int3d08/ will be created, containing the executable int3d08 and the subfolder _internal/. Run the executable int3d08.

MacOS

Download the file Int3D.dmg. Double click on it and move it to folder Applications/.

Installation from sources

Download the source code using git.

git clone https://code.ill.fr/scientific-software/int3d08.git

Int3D is written in Python and Fortran. To make it run, you need to set up the Python environment and to compile de Fortran code.

Setting the Python environment

Install the Python packages required by Int3D: screeninfo, PySide6, silx and vtk.

pip install screeninfo
pip install PySide6
pip install silx
pip install vtk

We recommend to create a Python virtual environment before installing the dependencies.

Fortran compilation

The Fortran code of the Int3D package is located in int3d08/src/fortran/. It consists of several Fortran programs for single crystal and powder data reduction, and two Python extension modules written in Fortran. They are located respectively in single_crystal/, powder/ and cryslib/ directories. They depend on two external libraries, CrysFML08 and HDF5. On Windows and macOS, the Python extension modules need to be linked against the Python library. HDF5 library binaries can be downloaded from the HDF5 website. However, CrysFML08 needs to be compiled manually. Instructions can be found in the file CMake_help.inf of the CrysFML08 repository.

The simplest way to compile the Fortran code is by using cmake, since the Int3D distribution provides a series of CMakeLists.txt files.

# Create a build directory. We assume here it is at the same level as int3d08/

mkdir build
cd build

# Windows, ifort compiler, release mode
# Python library is usually at:
# %USERPROFILE%\AppData\Local\Programs\Python\PythonXY\libs\pythonXY.lib

cmake -G"NMake Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_Fortran_COMPILER="ifort"
-DCRYSFML08="path/to/crysfml08/installation" -DHDF5="/path/to/hdf5/installation"
-DPYTHON_LIB="/path/to/the/python/library" ../int3d08/src/fortran
nmake install

# Linux, ifort compiler, release mode

cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_Fortran_COMPILER="ifort"
-DCRYSFML08="path/to/crysfml08/installation"
-DHDF5="/path/to/hdf5/installation" ../int3d08/src/fortran
make install

# macOS, gfortran compiler, release mode
# Python library is usually at:
# /opt/homebrew/opt/python@XY/Frameworks/Python.framework/Versions/XY/lib/libpythonXY.dylib

cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_Fortran_COMPILER="gfortran"
-DCRYSFML08="path/to/crysfml08/installation" -DHDF5="/path/to/hdf5/installation"
-DPYTHON_LIB="/path/to/the/python/library" ../int3d08/src/fortran
make install

If the compilation is successful, the programs peakfind, int3d_int, refine, gamma_scan, and intpow, as well as the two Python extension modules crysfml_sxtal_geom and crysfml_vtk, should appear in the int3d08/src directory. To start Int3D, simply run:

python int3d08.py