generated from AICONSlab/HippMapp3r
-
Notifications
You must be signed in to change notification settings - Fork 1
/
install_depends.sh
30 lines (25 loc) · 1.31 KB
/
install_depends.sh
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
#!/bin/bash
SCRIPTPATH="$( cd "$(dirname "$0")" ; pwd -P )"
echo "Adding external dependencies to ${SCRIPTPATH}"
# create depends dir
mkdir -p "${SCRIPTPATH}/depends/"
# find out if the user has ANTS
antspath=$( command -v antsRegistration )
if [[ -z "${antspath}" ]]; then
echo "Environment variable ANTSPATH does not exist. Downloading and installing software to ${SCRIPTPATH}/depends/ANTs"
export ANTSPATH="$ANTSPATH:${SCRIPTPATH}/depends/ANTs"
export PATH="$PATH:$ANTSPATH"
mkdir -p "${SCRIPTPATH}/depends/ANTs" && \
curl -sSL "https://dl.dropbox.com/s/2f4sui1z6lcgyek/ANTs-Linux-centos5_x86_64-v2.2.0-0740f91.tar.gz" \
| tar -xzC "${SCRIPTPATH}/depends/ANTs" --strip-components 1
fi
# find out if user has c3d installed
c3dpath=$( command -v c3d )
if [[ -z "${c3dpath}" ]]; then
echo "Command c3d was not found. Downloading and installing software to ${SCRIPTPATH}/depends/c3d. Path will be added to PATH environment variable."
mkdir -p "${SCRIPTPATH}/depends/c3d/"
wget https://downloads.sourceforge.net/project/c3d/c3d/Nightly/c3d-nightly-Linux-x86_64.tar.gz && \
tar -xzvf c3d-nightly-Linux-x86_64.tar.gz && mv c3d-1.1.0-Linux-x86_64/* "${SCRIPTPATH}/depends/c3d/" && \
rm c3d-nightly-Linux-x86_64.tar.gz
export PATH="${SCRIPTPATH}/depends/c3d/c3d-1.1.0-Linux-x86_64/bin/:$PATH"
fi