Getting the source code

To obtain the source code for the latest FSL release, simply install FSL by using the script, as outlined on the main installation page. The source code for the release will be installed into $FSLDIR/src/.

The source code for each FSL sub-project is also publicly available on the FMRIB GitLab server, at

Compiling FSL projects

A FSL installation contains software written in a variety of programming languages - these instructions describe how to compile a FSL sub-project that is written in C/C++.

FSL release are compiled in a modular fashion - each FSL sub-project is compiled separately, using the conda package manager. The C/C++ portions of a FSL release are compiled using the C++ compiler toolchain from conda-forge, which is installed as part of a standard FSL release. FSL projects can, however, be compiled locally without using conda, and with a compiler of your choice.

FSL projects use a simple Makefile-based build system which is implemented in the fsl-base project. The common make rules used by all FSL projects can be found within the $FSLDIR/config/ directory.

The steps below describe how to compile the avwutils project (which provides fslmaths, fslstats, and a range of other utilities). You can follow a similar process to compile other projects.

1. Set up your shell environment for compilation by running these commands in your shell:

2. Obtain the avwutils source code - you have the choice of compiling the source code that came with your FSL installation (inside $FSLDIR/src/fsl-avwutils/), or cloning the latest version from the avwutils gitlab repository, for example:

3. Change into the source directory, and run make. This will compile the avwutils source code, and create fslmaths, fslstats, etc binaries within the source directory:

Compiling CUDA projects

To compile CUDA-capable projects such as eddy or probtrackx2_gpu, some additional steps are required. Note that you do not need a GPU in order to compile CUDA programs (but you do need a GPU to run them).

1. You must first install a copy of the CUDA Toolkit - this can be downloaded from By default, the CUDA Tooklit will be installed into /usr/local/cuda-X.Y/ (where X.Y is the CUDA version), but the installation locataion can be customised.

2. You then need to ensure that the <cuda-toolkit-location>/bin/ directory is available on your $PATH, so that the nvcc compiler driver can be found.

3. Now follow the steps outlined above for compiling a FSL project. Certain CUDA projects have additional options that need to be specified when calling make - refer to the project Makefile for more details.

For example, to compile eddy:

More information

More information on compiling FSL projects, and on the development and release workflows used for FSL, can be found at


FslInstallation/SourceCode (last edited 11:20:16 22-03-2023 by PaulMcCarthy)