Commit ca69c77f authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

DOC: Shell setup, small tweaks

parent 5f51d701
# Official / full FSL installations
An official FSL installation is a self-contained directory installed on an end user's system, containing the full collection of FSL commands. An official FSL installation is typically located at `/usr/local/fsl/` - the FSL installation directory is identified by the `$FSLDIR` environment variable. A [**miniconda**](https://docs.conda.io/en/latest/miniconda.html#) environment is used to create `$FSLDIR`, and install all FSL projects and their dependencies into `$FSLDIR`, which is itself a conda environment<sup>*</sup>.
> <sup>*</sup> The [conda documentation](https://docs.conda.io/projects/conda/en/latest/user-guide/getting-started.html#managing-envs) recommends against installing packages into a base conda environment, therefore `$FSLDIR` is created as a child environment.
By default, the base miniconda environment is installed into `$FSLDIR/../.fslconda/` (i.e. `/usr/local/.fslconda`, if the default setting of `FSLDIR=/usr/local/fsl/` is used)<sup>*</sup>.
By default, the base miniconda environment is installed into `$FSLDIR/../.fslconda/` (i.e. `/usr/local/.fslconda/`, if the default setting of `FSLDIR=/usr/local/fsl/` is used)<sup>*</sup>.
> <sup>*</sup> The only possible options for the base/child environment locations are either to have them in separate directories, or to have the child environment directory located within the base environment directory. The former option was chosen, as the latter option would require a system of links to be created from `$FSLDIR/*` into `$FSLDIR/<child-environment>/*`.
......@@ -14,8 +15,20 @@ By default, the base miniconda environment is installed into `$FSLDIR/../.fslcon
Because `$FSLDIR` is a conda environment into which all FSL projects and their dependencies are installed, `$FSLDIR/bin/` will contain executable files provided by both FSL, and by its dependencies. This can give rise to a problem whereby executables in `$FSLDIR/bin/` can mask other executables of the same name which are also installed in the user's environment, but come after `$FSLDIR/bin/` on the user's `$PATH` (e.g. `python`, `conda`, etc).
To work around this problem, and to isolate all of the FSL executables from the other executables installed into the same environment, the conda packages for all FSL projects use [`post-link.sh` and `pre-unlink.sh`](https://docs.conda.io/projects/conda-build/en/latest/resources/link-scripts.html) scripts to create _wrapper scripts_ within `$FSLDIR/share/fsl/bin/`<sup>*</sup>. These wrapper scripts are created by the [`$FSLDIR/share/fsl/sbin/createFSLWrapper`](https://git.fmrib.ox.ac.uk/fsl/base/-/blob/master/share/fsl/sbin/createFSLWrapper) script, which is installed as part of the [`fsl-base`](https://git.fmrib.ox.ac.uk/fsl/base/) package.
> <sup>*</sup> More details on FSL project conda recipes are outlined in [`fsl_conda_recipes.md`](fsl_conda_recipes.md).
Users can then add the `$FSLDIR/share/fsl/bin/` directory to their `$PATH`, to the effect that only FSL executables will be made available in their environment. This mechanism also has the advantage that all existing FSL and third-party scripts which refer to `$FSLDIR/bin/<command>` will continue to work without modification.
Users can then add the `$FSLDIR/share/fsl/bin/` directory to their `$PATH`, with the effect that only FSL executables will be made available in their environment. This mechanism also has the advantage that all existing FSL and third-party scripts which refer to `$FSLDIR/bin/<command>` will continue to work without modification.
Once an official FSL release has installed onto a user's system, they can configure their environment to use FSL as follows (for a `bash`-compatible shell):
```
export FSLDIR=/usr/local/fsl/
export PATH=$FSLDIR/share/fsl/bin/:$PATH
source $FSLDIR/etc/fslconf/fsl.sh
```
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment