-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathconfigure_dependencies.sh
executable file
·206 lines (188 loc) · 7.19 KB
/
configure_dependencies.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
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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
pararser() {
CurrDir=$(realpath dependencies)
# Define default values
cmsgen=${cmsgen:-"$CurrDir/cmsgen"}
abc=${abc:-"$CurrDir/abc"}
preprocess=${preprocess:-"$CurrDir/manthan-preprocess"}
openwbo=${openwbo:-"$CurrDir/open-wbo"}
picosat=${picosat:-"$CurrDir/picosat"}
all=${all:-"no"}
# Assign the values given by the user
while [ $# -gt 0 ]; do
if [[ $1 == *"--"* ]]; then
param="${1/--/}"
if [ "$param" = "all" ]; then
declare -g $param="yes"
if [ -z "$2" ]; then
echo "c setting building all dependencies on"
else
if [[ $2 != *"--"* ]]; then
echo "WARNING! \"all\" does not take any parameter. Considering it on."
echo "c setting building all dependencies on"
fi
fi
else
declare -g $param="$2"
fi
fi
shift
done
}
pararser $@
export LOG_FILE="manthan_dependencies.cfg"
CFG_FILE=$(realpath $LOG_FILE)
echo "-n" > $CFG_FILE
Diritp=$(realpath itp.so)
unique="$CurrDir/unique"
cd $unique
if test -d "build"; then
echo "c unique/build dir exists."
echo "c clearing it"
rm -r build
fi
mkdir build
cd build
export PATH=$HOME/.local/bin:$PATH
cmake .. && echo "c cmake to unique succeeded" || exit
make -j8 && echo "c make to unique succeeded" || exit
if test -f "interpolatingsolver/src/itp."*; then
echo "c found itp module"
Diritp=$(realpath interpolatingsolver/src/)
export PYTHONPATH="${PYTHONPATH}:${Diritp}"
echo "[ITP-Path]" >> $CFG_FILE
echo "itp_path = "${Diritp} >> $CFG_FILE
else
echo "c could not found itp module"
echo "c check if pyblind[global] is installed properly"
echo "c check cmake log to see if pyblind is found or not"
echo "c you might need to export pyblind[global] path and re run ./configure_dependencies.sh"
exit
fi
if [ "$all" = "yes" ]; then
echo "Going to install all dependencies from the source code"
echo "[Dependencies-Path]" >> $CFG_FILE
source $CFG_FILE
echo "c installing ABC"
cd $abc
make -j8 libabc.a && echo "c make to ABC succeeded" || exit
gcc -Wall -g -c file_generation_cex.c -o file_generation_cex.o && echo "c file_generation_cex complied" || exit
g++ -g -o file_generation_cex file_generation_cex.o libabc.a -lm -ldl -lreadline -lpthread && echo "c file_generation_cex linked" || exit
file_generation_cex=file_generation_cex
if test -f "$file_generation_cex"; then
echo "c $file_generation_cex exists."
file_generation_cex_path=$(realpath $file_generation_cex)
echo "file_generation_cex_path = "$file_generation_cex_path >> $CFG_FILE
else
echo "ERROR! could not found $file_generation_cex"
echo "ERROR! check ABC install and follow readme in build_dependencies/abc"
exit
fi
echo "c ABC and its dependencies are sucessfully installed"
echo "c installing CMSGen"
cd $cmsgen
if test -d "build"; then
echo "c CMSGen/build dir exists."
echo "c clearing it"
rm -r build
fi
mkdir build
cd build
cmake .. && echo "c cmake to cmsgen succeeded" || exit
make -j8 && echo "c make to cmsgen succeeded" || exit
cmsgen_exe=cmsgen
if test -f "$cmsgen_exe"; then
echo "c $cmsgen_exe exists."
cmsgen_path=$(realpath $cmsgen_exe)
echo "cmsgen_path = " $cmsgen_path >> $CFG_FILE
else
echo "Error! could not found $cmsgen_exe"
echo "Error! check cmsgen install and follow readme in build_dependencies/cmsgen"
exit
fi
echo "c cmsgen and its dependencies are sucessfully installed"
echo "c installing Open-WBO"
cd $openwbo
make rs && echo "c make to open wbo succeeded" || exit
wbo=open-wbo
if test -f "$wbo"; then
echo "c $wbo exists."
openwbo_path=$(realpath $wbo)
echo "openwbo_path = " $openwbo_path >> $CFG_FILE
else
if test -f "$wbo"*; then
echo "c $wbo exists."
echo "c coping it to dependencies folder"
openwbo_path=$(realpath $wbo*)
echo "openwbo_path = " $openwbo_path >> $CFG_FILE
else
echo "Error! could not found $wbo"
echo "Error! check open-wbo install and follow INSTALL in build_dependencies/open-wbo"
exit
fi
fi
echo "c open-wbo is sucessfully installed"
echo "c installing picosat"
cd $picosat
./configure.sh && echo "c configuration to picosat succeeded" || exit
make -j4 && echo "c make to picosat succeeded" || exit
picosat_exe=picosat
if test -f "$picosat_exe"; then
echo "c $picosat_exe exists."
picosat_path=$(realpath $picosat_exe)
echo "picosat_path = " $picosat_path >> $CFG_FILE
else
echo "Error! could not found $picosat_exe"
echo "Error! check picosat install and follow readme in build_dependencies/picosat"
exit
fi
echo "c picosat is sucessfully installed"
echo "c install preprocess"
cd $preprocess
cd louvain-community
if test -d "build"; then
echo "c manthan-preproces/louvain-community/build dir exists."
echo "c clearing it"
rm -r build
fi
mkdir build
cd build
cmake .. && echo "c cmake to louvain-community succeeded" || exit
make -j8 && echo "c make to louvain-community succeeded" || exit
echo "c louvain-community path set done"
echo "c install cryptominisat"
cd ../..
cd cryptominisat
if test -d "build"; then
echo "c manthan-preproces/cryptominisat/build dir exists."
echo "c clearing it"
rm -r build
fi
mkdir build
cd build
cmake -DENABLE_PYTHON_INTERFACE=OFF .. && echo "c cmake to cryptominisat succeeded" || exit
make -j8 && echo "c make to cryptominisat succeeded" || exit
cd ../..
echo "c installing preprocess"
if test -d "build"; then
echo "c manthan-preproces/build dir exists."
echo "c clearing it"
rm -r build
fi
mkdir build
cd build
cmake .. && echo "c cmake to preprocess succeeded" || exit
make -j8 && echo "c make to preprocess succeeded" || exit
preprocess_exe=preprocess
if test -f "$preprocess_exe"; then
echo "c $preprocess_exe exists."
preprocess_path=$(realpath $preprocess_exe)
echo "preprocess_path = " $preprocess_path >> $CFG_FILE
else
echo "Error! could not found $preprocess_exe"
echo "Error! check preprocess install and follow readme in build_dependencies/preprocess"
exit
fi
else
echo "Going to use precomplied static binaries from the dependencies/static_bin folder"
fi
exit