Getting the source code

To obtain the source code for the latest FSL release, download the script via the main installation page, and run it with the --source option. Note that the installer script must be executed with a Python 2 interpreter. Run -h for a list of all available options.

Compiling Source Distribution

If you have not taken a precompiled version, you will require:

We provide source code for TCL/TK 8.4.19, but you may wish to provide your own version (perhaps as shipped with your OS), in which case delete the words tcl and tk from the build script in the extras directory of the FSL sources to save build time. Then do the following (this if for the bash shell; if you are using tcsh amend appropriately):

  1. Make a folder to build the source code in, for example ~/fslbuild

  2. Put the tar file into your build location, and unpack the sources :
    cd ~/fslbuild
    tar zxf fsl-5.0.0-sources.tar.gz
  3. Set the main FSL environment variables (for version 5.0.6 and above you first need to uncomment the lines related to FSLCONFDIR and FSLMACHTYPE in $FSLDIR/etc/fslconf/
    export FSLDIR=`pwd`/fsl
    . ${FSLDIR}/etc/fslconf/
  4. Then check if your machine/compiler is supported by default:
    ls $FSLDIR/config/$FSLMACHTYPE

If the above directory does not exist (the ls returns an error):

Once this test is done then the sources can be built with:


After building the packages from version 5.0.10 onwards it is necessary to download and build a python environment with the FSL folder in it's final location (it cannot be moved after this). Do this using the provided script:

$FSLDIR/etc/fslconf/ -f $FSLDIR

If you want to re-make a particular package in $FSLDIR/src (e.g. flirt) then first set the FSLDEVDIR environment variable to the same as FSLDIR and then just type:

make install

inside the relevant directory.

Using the compiled binaries

Whilst you can use the binaries from the build location, you will most likely want to move them to a centralised location so all users on the machine can use them. FSLDIR is self contained, so you can move/copy the entire contents to another location, eg /usr/local and then configure your environment to point your shell and the FSL tools to this location. Do this as per these instructions.

Compiling FSLView

For instructions on compiling FSLView, see here.


FslInstallation/SourceCode (last edited 14:43:37 22-09-2020 by PaulMcCarthy)