-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathCODES-compile-instructions.sh
More file actions
136 lines (116 loc) · 3.87 KB
/
CODES-compile-instructions.sh
File metadata and controls
136 lines (116 loc) · 3.87 KB
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
#!/usr/bin bash -x
# Switches
swm_enable=1
union_enable=1
torch_enable=0
# Uncomment below for MPICH
#export PATH=/usr/local/mpich-4.1.2/bin/:"$PATH"
# Note: remember to compile MPICH with nemesis not with UCX support
################## Actual scripts starts from here ##################
# SWM has to be enabled for UNION to work
if [ $union_enable = 1 ]; then
swm_enable=1
fi
# What to compile
CUR_DIR="$PWD"
##### Downloading everything #####
git clone https://github.com/codes-org/codes --depth=100 --branch=v1.5.0
git clone https://github.com/ross-org/ross --depth=100 --branch=v8.1.0
if [ $swm_enable = 1 ]; then
git clone https://github.com/pmodels/argobots --depth=1
git clone https://github.com/codes-org/swm-workloads --branch=v1.2
fi
if [ $union_enable = 1 ]; then
# Downloading conceptual
curl -L https://sourceforge.net/projects/conceptual/files/conceptual/1.5.1b/conceptual-1.5.1b.tar.gz -o conceptual-1.5.1b.tar.gz
tar xvf conceptual-1.5.1b.tar.gz
# Downloading union
git clone https://github.com/SPEAR-UIC/Union
pushd Union && git checkout 99b3df3 && popd
fi
##### COMPILING #####
mkdir ross/build
pushd ross/build
cmake .. -DROSS_BUILD_MODELS=ON -DCMAKE_INSTALL_PREFIX="$(realpath ./bin)" \
-DCMAKE_C_COMPILER=mpicc -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS="-g -Wall"
#make VERBOSE=1
make install -j4
err=$?
[[ $err -ne 0 ]] && exit $err
popd
if [ $swm_enable = 1 ]; then
pushd swm-workloads/swm
./prepare.sh
mkdir build
pushd build
../configure --disable-shared --prefix="$(realpath ./bin)" CC=mpicc CXX=mpicxx CFLAGS=-g CXXFLAGS=-g
#make V=1 && make install
make -j4 && make install
err=$?
[[ $err -ne 0 ]] && exit $err
popd && popd
pushd argobots
./autogen.sh
mkdir build
pushd build
#../configure --enable-debug=all --disable-fast --disable-shared --prefix="$(realpath ./bin)" CC=mpicc CXX=mpicxx CFLAGS=-g CXXFLAGS=-g
../configure --disable-shared --prefix="$(realpath ./bin)" CC=mpicc CXX=mpicxx CFLAGS=-g CXXFLAGS=-g
#make V=1 && make install
make -j4 && make install
err=$?
[[ $err -ne 0 ]] && exit $err
popd && popd
fi
if [ $union_enable = 1 ]; then
pushd conceptual-1.5.1b
PYTHON=python2 ./configure --prefix="$(realpath ./install)" LIBS=-lm
make -j4 && make install
err=$?
[[ $err -ne 0 ]] && exit $err
popd
pushd Union
# Python 2 override. Union expects Python 2 ONLY
mkdir -p python-override
ln -s /usr/bin/python2 python-override/python
# compiling
./prepare.sh
PYTHON=python2 ./configure --disable-shared --with-conceptual="$(realpath ../conceptual-1.5.1b/install)" --with-conceptual-src="$(realpath ../conceptual-1.5.1b)" --prefix="$(realpath ./install)" CC=mpicc CXX=mpicxx
PATH="$PWD/python-override:$PATH" make -j4 && make install
err=$?
[[ $err -ne 0 ]] && exit $err
popd
fi
mkdir codes/build
pushd codes/build
make_args_codes=(
-DCMAKE_PREFIX_PATH="$(realpath "$CUR_DIR/ross/build/bin")"
-DCMAKE_CXX_COMPILER=mpicxx -DCMAKE_C_COMPILER=mpicc
-DCMAKE_C_FLAGS="-g -Wall"
-DCMAKE_CXX_FLAGS="-g -Wall"
-DCMAKE_BUILD_TYPE=Debug -DBUILD_TESTING=ON
-DCMAKE_INSTALL_PREFIX="$(realpath bin)"
)
if [ $swm_enable = 1 ]; then
make_args_codes=(
"${make_args_codes[@]}"
-DSWM_PKG_CONFIG_PATH="$(realpath "$CUR_DIR/swm-workloads/swm/build/maint")"
-DARGOBOTS_PKG_CONFIG_PATH="$(realpath "$CUR_DIR/argobots/build/maint")"
)
fi
if [ $union_enable = 1 ]; then
make_args_codes=(
"${make_args_codes[@]}"
-DUNION_PKG_CONFIG_PATH="$(realpath "$CUR_DIR/Union/install/lib/pkgconfig")"
)
fi
if [ $torch_enable = 1 ]; then
make_args_codes=("${make_args_codes[@]}" -DUSE_TORCH=true)
else
make_args_codes=("${make_args_codes[@]}" -DUSE_TORCH=false)
fi
cmake .. "${make_args_codes[@]}"
#make VERBOSE=1
make -j4
err=$?
[[ $err -ne 0 ]] && exit $err
popd