The installation instructions provided in the preceding pages produce a working install for the current user only. There are many advantages to this:
- no need for admin privileges, either for the initial install (beyond installation of dependencies), or any subsequent updates;
- users are in control of the precise version of MRtrix3 they are using for their specific projects - no system updates will interfere with their study.
However, system administrators and software distributors will want to install MRtrix3 in a system-wide location to make it accessible to all users; and/or to deploy it to other systems without requiring a full rebuild. While MRtrix3 does not provide an explicit command to do this, it is a trivial process:
- build the code
- copy the
share/folders together to the desired target location
- set the
PATHto point to the
This can be done any number of ways. The only requirement is that these 3 folders are co-located alongside each other, so that the executables can find the MRtrix3 shared library, and the scripts can find the requisite python modules.
Note also that this structure is broadly compatible with the Linux Filesystem
It should be perfectly possible to merge the MRtrix3
share/ folders with the system’s existing equivalent locations in
/usr/local/ if desired, in which case there would be no need to
explicitly set the
already in the
PATH). However, there is no requirement that it be
installed anywhere in particular, and we expect most sysadmins will prefer to
place them in a separate location to minimise any chance of conflict.
Below we provide step-by-step instructions for creating a single tar file that can then be copied to other systems and extracted in the desired folder:
Obtain, configure and build the desired version of MRtrix3:
$ git checkout http://github.com/MRtrix3/mrtrix3.git $ cd mrtrix3 $ ./configure $ ./build
Collate the relevant folders and their contents into a single archive file:
$ tar cvfz mrtrix3.tgz bin/ lib/ share/
Copy the resulting
mrtrix3.tgzfile over to the target system, into a suitable location., for example (as root):
# mkdir /usr/local/mrtrix3 # cp mrtrix3.tgz /usr/local/mrtrix3/
Extract the archive in this location (as root):
# cd /usr/local/mrtrix3/ # tar xvfz mrtrix3.tgz
Assuming no errors were generated, you can safely remove the
mrtrix3.tgzfile at this point.
Add the newly-extracted
bin/folder to the
$ export PATH=/usr/local/mrtrix3/bin:"$PATH"
At which point MRtrix3 command should be available to the corresponding user.
Note that the above command will only add MRtrix3 to the
PATHfor the current shell session. You would need to add the equivalent line to your users’ startup scripts, using whichever mechanism is appropriate for your system.