-
Notifications
You must be signed in to change notification settings - Fork 17
/
INSTALL
94 lines (71 loc) · 3.62 KB
/
INSTALL
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
INSTALLATION
=============
Currently there is no support for RMINC on Windows, but it is likely possible to install its MINC dependencies via WSL (Windows Subsystem for Linux) following the Linux instructions below. Please let us know if you've done this and how you did it.
Every effort has been made to make RMINC as easy to install as possible.
For most systems, devtools::install_github("Mouse-Imaging-Centre/RMINC") should
be all you need to begin experimenting with MINC files in R. For a richer
experience, the highly recommended approach is to acquire the minc-toolkit (v2).
This package will allow you to use command line tools in addition
to RMINC to manipulate minc files.
Binary installers for the toolkit can be acquired from http://bic-mni.github.io/
in the section V2. Alternatively, the toolkit can be build from source
with code from https://github.com/BIC-MNI/minc-toolkit-v2.
If the toolkit is found on your system, the installation will be a bit faster.
If the toolkit is not found on your system RMINC will attempt to install
libminc (https://github.com/BIC-MNI/libminc) for you. This provides the
core functionality needed to use RMINC. In order to install libminc
you need a few dependencies. You need a version of CMake greater than 2.6,
you will need git installed to fetch the code, and you will need the
development headers for HDF5, the file format underlying MINC.
The HDF5 header can be acquired on Debian/Ubuntu type linux systems
with `sudo apt-get install libhdf5-dev`, or with on Mac OSX with
the brew package manager `brew install [email protected]`.
If you find yourself in a position where you need to install these
dependencies it is probably best to just install the toolkit as
discussed above. The toolkit provides HDF5 for you.
My build can't find libminc!!
-----------------------------
RMINC tries very hard to find libminc for you. If it struggles,
there are a couple ways to help it out. First you can specify
a MINC_PATH, this is an environment variable that points to the
top directory of your minc-toolkit install.
Alternatively, if you're using devtools you can specify a
configure flag to the install
```
devtools::install_github("Mouse-Imaging-Centre/RMINC"
, args = "--configure-args='--with-build-path=<your-path-here>'"
, upgrade_dependencies = FALSE)
```
OSX and MacOS
--------------
To install on Apple operating systems you will likely need an additional
dependency. RMINC requires a fortran compiler in order to install.
Since Apple uses clang by default, most users will not have a fortran
compiler installed. In this case you will need to either install
gfortran https://gcc.gnu.org/wiki/GFortranBinaries. Alternatively
you can use homebrew to install the Gnu Compiler Collection which
comes with gfortran
```
brew install gcc libssh2 libgit2 libomp zlib
```
Regardless of how you install gfortran you will need to tell
R where to find it. If you installed via brew you can run the
following in terminal
```
mkdir $HOME/.R/ ## Ignore the error if this directory already exists
touch $HOME/.R/Makevars
echo 'FLIBS=-L/usr/local/Cellar/gcc/5.3.0/lib/gcc/5' >> $HOME/.R/Makevars
```
This will change with the version of gcc you have installed. If
you installed gfortran directly you will need to find the correct
library path. My best guess is
```
echo 'FLIBS=-L/usr/local/gfortran/lib" >> $HOME/.R/Makevars'
```
Additionally, recent mac versions have struggled to link libz in
to RMINC. You will probably need to run the following in the terminal
before opening R
```
export LDFLAGS="$LDFLAGS -L$(brew --prefix zlib)/lib"
```
If that works or doesn't let me know in the issues!