forked from westpa/westpa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.sh
executable file
·52 lines (41 loc) · 1.36 KB
/
setup.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
function checkout_remote() {
directory="$1"; shift
repo="$1"; shift
revision="$1"; shift
pushd lib
if ! [[ -d $directory ]] ; then
git clone "$repo" || exit 1
fi
pushd $directory
git pull origin master || exit 1
git checkout "$revision" || exit 1
popd
popd
}
if [[ -z "$WEST_PYTHON" ]] ; then
WEST_PYTHON=python2.7
fi
find . -name \*.so -print0 | xargs -0 rm &> /dev/null
checkout_remote blessings git://github.com/erikrose/blessings.git d3ba51c5870d599b40b387ac6703805c3e23d292 || exit 1
checkout_remote west_tools git://github.com/westpa/west_tools.git 0047ea1b859596aca04dadc88068d9f854d0e4d2 || exit 1
checkout_remote wwmgr git://github.com/westpa/wwmgr.git eac79a7d90f481548f829ae7053efefa05092711 || exit 1
if [[ -d lib/h5py ]] ; then
echo "using custom h5py located in $PWD/lib/h5py"
if [[ -z "$HDF5" ]] ; then
export HDF5=$(ldd `which h5ls` | fgrep libhdf5 | awk '{print $3;}' | sed 's~/lib.*~~')
fi
echo "using HDF5 from $HDF5"
echo "(if this is not what you expect, set HDF5=... prior to running this script)"
pushd lib/h5py
cd h5py
$WEST_PYTHON api_gen.py
cd ..
$WEST_PYTHON setup.py build_ext --inplace --hdf5=$HDF5
popd
fi
for d in lib/west_tools; do
cd $d
$WEST_PYTHON setup.py build_ext --inplace
cd -
done