-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.sh
executable file
·110 lines (79 loc) · 2.18 KB
/
install.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
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
#!/bin/bash
#perform installation steps
#set -x
for shell_argv in "$@"
do
if [ "$shell_argv" == "--omit_dir_diff" ]; then
omit_dir_diff="YES"
fi
done
if [ "$STOCHKIT_HOME" == "" ]; then
pushd "$(dirname "$0")" > /dev/null
export STOCHKIT_HOME="`pwd -P`"
popd > /dev/null
elif [ "$STOCHKIT_HOME" != "`pwd -P`" ]; then
if [ "$omit_dir_diff" != "YES" ]; then
echo "\$STOCHKIT_HOME=$STOCHKIT_HOME is not current directory, do you wish to continue? Y/N:"
while read user_choice
do
case $user_choice in
[yY]* ) break;;
[nN]* ) exit;;
* ) echo "Please enter Y or N:";;
esac
done
fi
fi
case $STOCHKIT_HOME in
*\ * )
stochkittmpdir=$(mktemp -d /tmp/tmp.stochkit.XXXXX)
trap 'rm -rf "$stochkittmpdir"' EXIT INT TERM HUP
ln -s "$STOCHKIT_HOME" $stochkittmpdir/stochkit_home
export STOCHKIT_ORGININAL_HOME="$STOCHKIT_HOME"
export STOCHKIT_HOME=$stochkittmpdir/stochkit_home;;
esac
cd "$STOCHKIT_HOME/libs/boost_1_53_0/"
./bootstrap.sh
if [ "$?" -ne 0 ]; then
echo "bootstrap.sh failed to run"
exit 1
fi
./b2 link=static --with-thread
if [ "$?" -ne 0 ]; then
echo "b2 failed to run"
exit 1
fi
./b2 link=static --with-program_options
if [ "$?" -ne 0 ]; then
echo "b2 failed to run"
exit 1
fi
./b2 link=static --with-filesystem
if [ "$?" -ne 0 ]; then
echo "b2 failed to run"
exit 1
fi
if [[ "$OSTYPE" == "darwin"* ]]; then
# Fix libboost linker paths on OSX
cd stage/lib
for f in *.dylib
do
install_name_tool -id "@executable_path/../libs/boost_1_53_0/stage/lib/$f" $f
done
fi
cd "$STOCHKIT_HOME"
make -j 4
if [ "$?" -eq 2 ]; then
echo "make failed"
exit 1
fi
cd "$STOCHKIT_HOME/custom_drivers/single_trajectory"
make -j 4
if [ "$?" -eq 2 ]; then
echo "make failed"
exit 1
fi
#echo "**********************************************"
#echo "Please remember to add $STOCHKIT_HOME/libs/boost_1_53_0/stage/lib/ to the LD_LIBRARY_PATH environment variable on Linux machines."
echo "You may add the home directory of StochKit to the PATH environment variable to run ssa or tau_leaping from any directories."
#echo "**********************************************"