-
Notifications
You must be signed in to change notification settings - Fork 10
/
Allwmake
executable file
·224 lines (200 loc) · 6.27 KB
/
Allwmake
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
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
#!/bin/bash
## Making sure that prepareCase.sh is executable
if [ ! -x "bin/prepareCase.sh" ]
then
chmod a+x bin/prepareCase.sh
fi
## Make sure that bashrc is executable
if [ ! -f "./bin/bashrc" ]
then
cp ./bin/bashrc.org ./bin/bashrc
chmod a+x ./bin/bashrc
fi
## Set environmental variables
. ./bin/bashrc
## Check if WAVES_DIR exists
if [ ! -d "$WAVES_DIR" ]
then
echo ""
echo "FATAL ERROR."
echo " The directory path "$WAVES_DIR "does not exist."
echo " Correct the path in bin/bashrc"
echo ""
echo " This means that you should correct the environmental variable \$WAVES_DIR"
echo " such that it is pointed (in absolute sense) to the path, where waves2Foam"
echo " is located."
echo ""
echo " Please note that once bin/bashrc is created, bin/bashrc.org is only an"
echo " inactive file. The latter is also the only of the two files, which is"
echo " updated through the SVN-repository."
echo ""
echo "EXITING"
echo ""
exit
fi
# Hard-coded creation of the target for the compiled libraries, solvers and utilities
# This is needed, because the Third-party installation does not use wmake, i.e. if
# the directory does not exist, it means that all subsequent OpenFoam/waves2Foam
# parts of the installation will fail!
if [ ! -d "$WAVES_APPBIN" ]
then
mkdir -p $WAVES_APPBIN
fi
if [ ! -d "$WAVES_LIBBIN" ]
then
mkdir -p $WAVES_LIBBIN
fi
## COMPILE THIRD PARTY DEPENDENCIES
(cd ThirdParty; ./Allwmake)
if [[ $? -ne 0 ]]
then
echo ""
echo "Problems with the compilation of the third party dependencies"
echo "Exiting"
echo ""
exit
fi
## LIBRARY
echo "====================================="
echo " COMPILE LIBRARY"
echo "====================================="
( cd src; ./Allwmake )
## SOLVERS
# Find all solver names in $WAVES_SOL
echo ""
echo "====================================="
echo " COMPILE SOLVERS"
echo "====================================="
solvers=`ls -d $WAVES_SOL/*`
# Loop over the solver names
for s in $solvers
do
solverName=`basename $s`
# Correct options file if extend branch or not
if [ "$EXTBRANCH" -eq "1" ]
then
if [ "$FOAMEXTENDPROJECT" -eq "0" ]
then
rm -f $WAVES_SOL/$solverName/Make/options
ln -s -f $WAVES_SOL/$solverName/Make/options.ext $WAVES_SOL/$apps/$solverName/Make/options
fi
else
if [ -f $WAVES_SOL/$solverName/Make/options.reg ]
then
rm -f $WAVES_SOL/$solverName/Make/options
ln -s -f $WAVES_SOL/$solverName/Make/options.reg $WAVES_SOL/$apps/$solverName/Make/options
fi
fi
# Compile the solver
( cd $WAVES_SOL/$solverName; wmake )
done
## UTILITIES
# Pre-processing utilities
echo ""
echo "====================================="
echo " COMPILE PRE-PROCESSING"
echo "====================================="
foamOpenFOAM="$WAVES_PRE/faceSetToSTL $WAVES_PRE/waveGaugesNProbes $WAVES_POST/postProcessWaves2Foam"
for i in $foamOpenFOAM
do
rm -f $i/Make/options
if [ "$FOAMEXTENDPROJECT" -eq "0" ]
then
if [ "$OFPLUSBRANCH" -eq "1" ]
then
if [ "$WM_PROJECT_VERSION_NUMBER" -lt 1706 ]
then
ln -s -f $i/Make/options.OpenFOAM $i/Make/options
else
ln -s -f $i/Make/options.OpenFOAMPlus1706 $i/Make/options
fi
else
ln -s -f $i/Make/options.OpenFOAM $i/Make/options
fi
else
if [ "$WM_PROJECT_VERSION_NUMBER" -lt 320 ]
then
ln -s -f $i/Make/options.foam $i/Make/options
else
ln -s -f $i/Make/options.foam.320 $i/Make/options
fi
fi
done
# Compile the setWaveField and account for the inclusion of lwaveModels (IHFoam) as of 2012-ESI
if [ "$OFPLUSBRANCH" -eq "1" ]
then
if [ "$WM_PROJECT_VERSION_NUMBER" -lt 1812 ]
then
ln -s -f $WAVES_PRE/setWaveField/Make/optionsNonGABC $WAVES_PRE/setWaveField/Make/options
elif [ "$WM_PROJECT_VERSION_NUMBER" -lt 2012 ]
then
ln -s -f $WAVES_PRE/setWaveField/Make/optionsPre2012 $WAVES_PRE/setWaveField/Make/options
else
ln -s -f $WAVES_PRE/setWaveField/Make/options2012 $WAVES_PRE/setWaveField/Make/options
fi
else
ln -s -f $WAVES_PRE/setWaveField/Make/optionsNonGABC $WAVES_PRE/setWaveField/Make/options
fi
( cd $WAVES_PRE && wmake all )
# Post-processing utilities - Post processing removed from compilation Jan. 2021
# echo ""
# echo "====================================="
# echo " COMPILE POST-PROCESSING"
# echo "====================================="
# rm -f $WAVES_POST/surfaceElevation/Make/options
#
# if [ "$EXTBRANCH" -eq "1" ]
# then
# ln -s -f $WAVES_POST/surfaceElevation/Make/options.210 $WAVES_POST/surfaceElevation/Make/options
# elif [ "$OFPLUSBRANCH" -eq "1" ]
# then
# ln -s -f $WAVES_POST/surfaceElevation/Make/options.220 $WAVES_POST/surfaceElevation/Make/options
# elif [ "$WM_PROJECT_VERSION_NUMBER" -lt "220" ]
# then
# ln -s -f $WAVES_POST/surfaceElevation/Make/options.210 $WAVES_POST/surfaceElevation/Make/options
# else
# ln -s -f $WAVES_POST/surfaceElevation/Make/options.220 $WAVES_POST/surfaceElevation/Make/options
# fi
#
# Currently, only compile waves2FoamSampling for all Openfoam versions except
# for OpenFOAM-4.0
# if [ $FOAMEXTENDPROJECT -eq "0" ]
# then
# if [ "$OFPLUSBRANCH" -eq "1" ]
# then
# if [ "$WM_PROJECT_VERSION_NUMBER" -lt "1612" ]
# then
# ( cd $WAVES_POST && wmake all)
# else
# ( cd $WAVES_POST/postProcessWaves2Foam; wmake)
# fi
# else
# if [ "$WM_PROJECT_VERSION_NUMBER" -lt "400" ]
# then
# ( cd $WAVES_POST && wmake all )
# else
# ( cd $WAVES_POST/postProcessWaves2Foam; wmake)
# fi
# fi
# else
# ( cd $WAVES_POST && wmake all )
# fi
#
echo ""
echo "====================================="
echo " COMPILE BREEDER"
echo "====================================="
if [ "$WM_PROJECT_VERSION_NUMBER" -eq "1606" ]
then
( cd $WAVES_POST/../breeder && wmake all )
else
echo ""
echo "Nothing available for compilation in the breeder"
echo "directory."
echo ""
fi
echo ""
echo "====================================="
echo " COMPILATION DONE"
echo "====================================="
echo ""