Configuring your shell

If you have used the FSL installer your shell will have already been setup for running the FSL tools. However, there are situations where you may need to carry out this configuration by hand, for example when installing FSL on a multi-user computer. How you do this will depend on what shell you are using (see what shell am I using?).

BASH/sh/ksh

User shell setup is stored in a file called .bash_profile (BASH) or .profile (SH, KSH and sometimes BASH) in your home folder (eg ~/.bash_profile), you need to edit (or create) this file to add the following lines:

FSLDIR=/usr/local/fsl
. ${FSLDIR}/etc/fslconf/fsl.sh
PATH=${FSLDIR}/bin:${PATH}
export FSLDIR PATH

changing /usr/local/fsl to the directory path you installed FSL to.

csh/tcsh

User shell setup is stored in a file called .cshrc (csh and tcsh) or .tcsh (tcsh only) in your home folder (eg ~/.cshrc), you need to edit (or create) this file to add the following lines:

setenv FSLDIR /usr/local/fsl
source ${FSLDIR}/etc/fslconf/fsl.csh
setenv PATH ${FSLDIR}/bin:${PATH}

changing /usr/local/fsl to the directory path you installed FSL to.

fslpython

Once the shell has been setup correctly, fslpython ( a miniconda-based python distribution ) needs to be installed for FSL 5.0.10 onwards. To do this simply run the following command:

${FSLDIR}/etc/fslconf/fslpython_install.sh

Mac OS X 10.4 and X11 setup

By default Mac OS X 10.4's Terminal application cannot run X11 applications. To fix this, add the following to your .bash_profile or .cshrc files:

System-wide setup

You have several options for automatically setting up FSL for all users on the computer, all beyond the scope of this document, but here are some suggestions on how you might go about this.

  1. Change the template used for new user accounts (look in /etc/skel on Linux or /System/Library/User Template/English.lproj/ on Mac OS X). New users will then get a suitably modified settings file.

  2. Store the settings in an NFS shared folder. You could ensure that the default settings file looks for and sources a settings file on an NFS server. This is useful for a compute cluster as you only have to edit one file to have it change everywhere.
  3. Modify the system-wide .profile or .cscrc file. On Mac OS X the files /etc/profile and /etc/csh.cshrc control this for all users, on Linux you can create files fsl.sh and fsl.csh in /etc/profile.d containing the settings. If you are using the fsl_installer.sh script then you can carry out this configuration by running the script with the -E option (Linux only).

Take Care

Be careful what you put in these files as you could stop people logging in!

Localisation problems

FSL programs generally require a period to be used as the decimal separator ( e.g. 10.4 0.235 etc ). If your environment is configured to use a different character such as a comma then this may cause problems. Two potential fixes are to change the LC_NUMERIC variable value by: (i) typing the following lines into a terminal locally each time you want to run FSL, or (ii) globally modifying all terminals by adding the following lines to the .bash_profile ( or equivalent ):

LC_NUMERIC=en_GB.UTF-8
export LC_NUMERIC

Take Care

Modifying your locale globally (e.g. in .bash_profile) may result in issues with other scripts on your system - change with care!

 

FslInstallation/ShellSetup (last edited 15:41:33 25-04-2017 by MatthewWebster)