-
Notifications
You must be signed in to change notification settings - Fork 4
/
install
executable file
·121 lines (107 loc) · 2.89 KB
/
install
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#! /bin/bash
# Change this to match your root directory of the flag_gpu repo
if [ $# -eq 0 ] # No arguments provided
then
FLAG_DIR=$PWD
else
FLAG_DIR=$1
fi
# Change this to match your destination directory
prefix=/home/groups/flag/hash/
# Add prefix to PATH
if [[ "$PATH" == ?(*:)"$prefix/bin"?(:*) ]]
then
echo "PATH includes $prefix/bin"
else
echo "PATH does not include $prefix/bin... Adding now"
export PATH=$prefix/bin:$PATH
fi
# Add prefix to LD_LIBRARY_PATH
if [[ "$LD_LIBRARY_PATH" == ?(*:)"$prefix/lib"?(:*) ]]
then
echo "LD_LIBRARY_PATH includes $prefix/lib"
else
echo "LD_LIBRARY_PATH does not include $prefix/lib... Adding now"
export LD_LIBRARY_PATH=$prefix/lib:$LD_LIBRARY_PATH
fi
# Check for CUDA
if [ -z "$CUDA" ]
then
echo "CUDA is not set-- using $prefix/cuda"
CUDA=$prefix/cuda
else
echo "CUDA is set to $CUDA"
fi
# Set library source directories
HASHPIPE_SRC=$FLAG_DIR/lib/hashpipe/src
XGPU_SRC=$FLAG_DIR/lib/xGPU/src
BEAM_SRC=$FLAG_DIR/lib/beamformer/src
PFB_SRC=$FLAG_DIR/lib/pfb/src
POWER_SRC=$FLAG_DIR/lib/flagPower/src
# Compile the hashpipe library
echo "Installing HASHPIPE"
echo "========================================"
echo "Navigating to $HASHPIPE_SRC"
cd $HASHPIPE_SRC
autoreconf -is
./configure --prefix=$prefix --silent
make clean
make
make install
echo "========================================"
echo
# Compile the xGPU library
echo "Installing xGPU"
echo "========================================"
echo "Navigating to $XGPU_SRC"
cd $XGPU_SRC
make clean
make
make install prefix=$prefix
echo "========================================"
echo
# Compile the beamformer library
echo "Installing flagbeamformer"
echo "========================================"
echo "Navigating to $BEAM_SRC"
cd $BEAM_SRC
make clean
make
make install prefix=$prefix
echo "========================================"
echo
# Compile the flagPower library
echo "Installing flagPower"
echo "========================================"
echo "Navigating to $POWER_SRC"
cd $POWER_SRC
make clean
make
make install prefix=$prefix
echo "========================================"
echo
# Compile the pfb library
echo "Installing flagpfb"
echo "========================================"
echo "Navigating to $PFB_SRC"
cd $PFB_SRC
make clean
make CUDA_DIR=$CUDA
make install prefix=$prefix CUDA_DIR=$CUDA
echo "========================================"
echo
# Compile the flag HASHPIPE plugins
echo "Installing the FLAG plugins"
echo "========================================"
echo "Navigating to $FLAG_DIR/src"
cd $FLAG_DIR/src
autoreconf -is
./configure --prefix=$prefix --with-hashpipe=$prefix --with-xgpu=$prefix --with-xgpufrb=$prefix --with-xgpupfb=$prefix --with-flagpfb=$prefix --with-flagbeamformer=$prefix --with-flagpower=$prefix
make clean
make
make install
echo "========================================"
echo
cd $FLAG_DIR
echo "DONE!"
echo "The FLAG plugins have been installed to $prefix"