-
Notifications
You must be signed in to change notification settings - Fork 10
/
setup.sh
executable file
·89 lines (79 loc) · 2.65 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
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
#!/bin/bash
#
# Run this script to set up the qsim environment for the first time.
# You can read the following steps to see what each is doing.
#
# Author: He Xiao
# Date: 02/05/2016
# Usage: ./setup.sh
bold=$(tput bold)
normal=$(tput sgr0)
MANIFOLD_DIR=$PWD
# test qsim installation
if [ -z "$QSIM_PREFIX" ]; then
echo -e "\n${bold}qsim${normal} is not installed "
echo -e "Press any key to exit..."
read inp
exit 1
else
echo -e "\nUsing ${bold}qsim${normal} from dir ${bold}$QSIM_PREFIX${normal}"
echo -e "Press any key to continue..."
read inp
fi
# install manifold-dep packages
if hash apt-get 2>/dev/null; then
echo -e "Installing dependencies ..."
echo -e "sudo apt-get -y install build-essentail libconfig++-dev openmpi-bin openmpi-common libopenmpi-dev"
sudo apt-get -y install build-essential libconfig++-dev openmpi-bin openmpi-common libopenmpi-dev
else
echo -e "please refer to manifold manual for installation dependencies"
echo -e "Press any key to continue..."
read dump
fi
# Build manifold simulator
echo -e "Building manifold components ..."
autoreconf -siv
if [ -z "$KITFOX_PREFIX" ]; then
echo -e "\n${bold}kitfox library${normal} disabled "
echo -e "Press any key to continue..."
read inp
./configure QSIMINC=${QSIM_PREFIX}/include --without-kitfox
else
echo -e "\nUsing ${bold}kitfox${normal} from dir ${bold}$KITFOX_PREFIX${normal}"
echo -e "Press any key to continue..."
read inp
./configure QSIMINC=${QSIM_PREFIX}/include KITFOXINC=${KITFOX_PREFIX}
fi
make -j4
echo -e "Downloading the benchmark ..."
cd ${MANIFOLD_DIR}/simulator/smp
mkdir -p benchmark
cd benchmark
wget -c "https://github.com/gtcasl/qsim_prebuilt/releases/download/v0.1/graphBig_x86.tar.xz" -O graphbig_x86.tar.xz
wget -c "https://github.com/gtcasl/qsim_prebuilt/releases/download/v0.1/graphBig_a64.tar.xz" -O graphbig_a64.tar.xz
echo -e "Uncompressing the benchmark ..."
tar -xf graphbig_x86.tar.xz
tar -xf graphbig_a64.tar.xz
cd ..
if [ ! -f $QSIM_PREFIX/state.64 ]; then
echo -e "QSim state files are not found in $QSIM_PREFIX"
echo -e "Please run ${bold}mkstate.sh${normal} in $QSIM_PREFIX"
exit 1
else
echo -e "Linking QSim state files to manifold directory smp/state ..."
ln -s $QSIM_PREFIX state
fi
echo -e "Building simulator ..."
cd QsimProxy
make clean
if [ -z "$KITFOX_PREFIX" ]; then
make -j4
else
make -j4 -f Makefile.kitfox
fi
if [ $? -eq "0" ]; then
echo -e "\n${bold}Manifold built successfully!${normal}\n\n"
echo -e "Simulation Example:"
echo -e "cd simulator/smp/QsimProxy"
echo -e "./smp_llp ../config/conf2x2_spx_t6p_llp.cfg ../benchmark/graphbig_x86/bc.tar"
fi