MATLAB#

TIGRE for MATLAB is compiled on your machine with Compile.m.

Requirements#

Note

Your Windows user name must not contain spaces.

Install#

  1. Get TIGRE, with git clone https://github.com/CERN/TIGRE.git or by downloading the zip file.

  2. Linux only: make sure MATLAB can find CUDA. Add these lines to ~/.bashrc, open a new terminal, and start MATLAB from it:

    export PATH=$PATH:/usr/local/cuda/bin
    export LD_LIBRARY_PATH=/usr/local/cuda/lib64
    
  3. Windows only: check that MATLAB sees Visual Studio’s C++ compiler. Run mex -setup -v in MATLAB. Near the end, the lines that look for Visual C++ should end in Yes, and Visual Studio should be selected as the C/C++ compiler. If not, open the Visual Studio Installer, choose Modify, and add the C++ workload.

  4. In MATLAB, go to the TIGRE/MATLAB folder and run:

    Compile
    

    On Windows, Compile picks the configuration file matching your Visual Studio version (mex_CUDA_win64_MVS20XX.xml). To force a specific one, run Compile -mex_xml mex_CUDA_win64_MVS2019.xml.

  5. Add TIGRE to the MATLAB path. From the TIGRE/MATLAB folder, run:

    InitTIGRE
    

    InitTIGRE adds folders relative to the current folder, so run it from TIGRE/MATLAB at the start of every MATLAB session that uses TIGRE.

  6. Check the installation by running Demos/d03_generateData.m. If it runs without errors, TIGRE is installed.

Advanced: disable pinned memory#

TIGRE uses pinned (page-locked) host memory to overlap memory transfers with computation. If you reconstruct datasets larger than your RAM and rely on swap, compile without pinned memory. The operators will be slower.

Compile -no_pinned_mem

Getting help#

If installation fails, search the GitHub issues and Discussions, then ask there, including your OS, GPU, CUDA version, compiler version and MATLAB release. You can also email tigre.toolbox@gmail.com.