forked from DEShawResearch/viparr
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgarden-install-helper
executable file
·87 lines (74 loc) · 1.93 KB
/
garden-install-helper
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
#!/bin/sh
eval "$(/usr/bin/garden-exec)"
set -e
NAME=viparr
DESCRIPTION="Builds forcefields"
SCONS=scons/3.1.2-01c7
GCC=gcc/6.3.0-01c7
SCONSUTILS=sconsutils/1.51c7
PYBIND11=pybind11/2.3.0-01c7
loadmodules() {
garden load `cat $(dirname $0)/modules.txt`
MSYS=msys/$(echo $(basename $MSYS_PREFIX) | awk -F_ '{print $1}')
garden load \
$SCONS/bin \
$MSYS/lib \
$GCC/bin \
$MSYS/lib-python37 \
$SCONSUTILS/lib-python37 \
$PYBIND11/lib
export PYTHONVER=37
}
genmodules() {
cat << EOF > $GARDENDIR/lib-python37
prepend-path PYTHONPATH ${PREFIX}/lib/python
EOF
cat << EOF > $GARDENDIR/bin
prepend-path PATH $PREFIX/bin
EOF
# library
cat << EOF > $GARDENDIR/lib
prereq $MSYS/lib
prepend-path DESRES_MODULE_CPPFLAGS -I$PREFIX/include
prepend-path DESRES_MODULE_LDFLAGS -L$PREFIX/lib
prepend-path DESRES_MODULE_LDFLAGS -Wl,-rpath,$PREFIX/lib
EOF
}
runtests() {
loadmodules
#PYTHONPATH=${PREFIX:-build}/lib/python:$PYTHONPATH python3 test/python_tests.py "$@"
./test/run.sh -v
}
genhelp() {
cat doc/source/release_notes.txt
}
case $1 in
--name)
echo $NAME
;;
--version)
echo `src/version.py`c7
;;
--exec)
shift
loadmodules
"$@"
;;
--install)
loadmodules
nprocs=`nproc`
$0 --exec scons -j$nprocs install PREFIX=${PREFIX} OBJDIR=$TMPDIR
runtests
$PREFIX/bin/viparr -h > /dev/null
$PREFIX/bin/viparr_neutralize -h > /dev/null
$PREFIX/bin/viparr_solvate -h > /dev/null
$PREFIX/bin/viparr-make-rigid -h > /dev/null
(cd doc && PATH=$PREFIX/bin:$PATH PYTHONPATH=$PREFIX/lib/python:$PYTHONPATH make clean html)
mkdir -p $PREFIX/doc
cp -r doc/build/* $PREFIX/doc
genmodules
genhelp > $METADIR/help.txt
;;
# It's not an error if nothing matches. desres-install may invent
# other arguments in the future.
esac