local_development.md 1.81 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# Setting up a local FSL development environment


*This document is written under the assumption that you have FSL 6.1.0 or newer, installed via the fslinstaller script. These instructions will not work for manually managed FSL installations.*


This document describes how to set up a local development environment for compiling FSL C/C++ projects. It  does **not** describe how to build conda packages for FSL projects - this is described in [building_fsl_conda_packages.md](building_fsl_conda_packages.md).


A standard FSL installation comes with the `Makefile` machinery required to compile FSL C/C++ projects. All that you need to add is a C/C++ compiler. You can use your operating system compiler if you wish, but be warned that doing so will potentially compile your code in a different way to how the official FSL conda packages have been compiled.


A better option is to use the [conda-forge](https://conda-forge.org/) compiler toolchain. You can install the conda-forge compilers directly into `$FSLDIR` like so:


```
# Set up your environment for FSL development. The
# fsl-devel.sh script activates the $FSLDIR conda
# environment, effectively adding $FSLDIR/bin to
# your $PATH.
source $FSLDIR/etc/fslconf/fsl-devel.sh

# Install the conda-forge C/C++ compiler toolchain
conda install -c conda-forge c-compiler cxx-compiler 
```

Now, when you want to work on a FSL project, you can follow these steps:

```
# Configure your environment for FSL development
source $FSLDIR/etc/fslconf/fsl-devel.sh

# Get a copy of the source 
git clone https://git.fmrib.ox.ac.uk/fsl/randomise.git
cd randomise 

# Or work with the version you have installed
cd $FSLDIR/src/randomise/

# compile
make

# Re-install into your existing $FSLDIR
make install

# Or install into a different prefix
export FSLDEVDIR=/my/local/dev/prefix
make install
```