local_development.md 1.78 KB
Newer Older
1
2
3
# Setting up a local FSL development environment


4
*This document is written under the assumption that you have FSL 6.0.6 or
Paul McCarthy's avatar
Paul McCarthy committed
5
newer, installed via the fslinstaller script. These instructions will not work
Paul McCarthy's avatar
Paul McCarthy committed
6
for older versions of FSL, nor for manually managed FSL installations.*
7
8


Paul McCarthy's avatar
Paul McCarthy committed
9
10
11
12
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).
13
14


Paul McCarthy's avatar
Paul McCarthy committed
15
16
17
18
19
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.
20
21


Paul McCarthy's avatar
Paul McCarthy committed
22
23
24
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:
25
26


Paul McCarthy's avatar
Paul McCarthy committed
27
```bash
28
29
# Set up your environment for FSL development.
export PATH=$FSLDIR/bin:$PATH
30
31
source $FSLDIR/etc/fslconf/fsl-devel.sh

32
33
# Install the conda-forge C/C++ compiler toolchain and GNU Make
conda install -c conda-forge c-compiler cxx-compiler make
34
35
36
37
```

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

Paul McCarthy's avatar
Paul McCarthy committed
38

Paul McCarthy's avatar
Paul McCarthy committed
39
```bash
40
41
42
# Configure your environment for FSL development
source $FSLDIR/etc/fslconf/fsl-devel.sh

Paul McCarthy's avatar
Paul McCarthy committed
43
# Get a copy of the source
44
git clone https://git.fmrib.ox.ac.uk/fsl/randomise.git
Paul McCarthy's avatar
Paul McCarthy committed
45
cd randomise
46
47

# Or work with the version you have installed
Paul McCarthy's avatar
Paul McCarthy committed
48
cd $FSLDIR/src/fsl-randomise/
49
50
51
52
53
54
55
56
57
58
59

# compile
make

# Re-install into your existing $FSLDIR
make install

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