File: setup.sh

package info (click to toggle)
mpich 4.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 101,184 kB
  • sloc: ansic: 1,040,629; cpp: 82,270; javascript: 40,763; perl: 27,933; python: 16,041; sh: 14,676; xml: 14,418; f90: 12,916; makefile: 9,270; fortran: 8,046; java: 4,635; asm: 324; ruby: 103; awk: 27; lisp: 19; php: 8; sed: 4
file content (43 lines) | stat: -rwxr-xr-x 1,152 bytes parent folder | download | duplicates (9)
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
#!/bin/bash

set -e

SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
  DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )"
  SOURCE="$(readlink "$SOURCE")"
  [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null && pwd )"

source $DIR/common.sh

if [[ -z "$(which pip)" ]] ; then
    echo failed to find pip
    false
fi

if [[ -z "$(which python)" ]] ; then
    echo failed to find python
    false
fi

function cleanup {
    echo failed to setup environment
}

trap cleanup ERR

if [[ -z "$(which virtualenv)" ]] ; then
    pip --isolated install --root $PREREQ_INSTALL_PATH virtualenv
    export PYTHONPATH=$PREREQ_INSTALL_PATH/usr/lib/python2.7/site-packages:$PYTHONPATH
    export PATH=$PREREQ_INSTALL_PATH/bin:$PATH
fi

if [[ ! -f $VIRTUALENV_INSTALL_PATH/bin/activate ]] ; then
    virtualenv $VIRTUALENV_INSTALL_PATH
fi

source $VIRTUALENV_INSTALL_PATH/bin/activate
pip install -r $DIR/../share/requirements.txt