forked from ITHACA-FV/ITHACA-FV
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Allwmake
executable file
·134 lines (122 loc) · 2.73 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
#!/bin/bash
cd ${0%/*} || exit 1 # Run from this directory
help_flag=''
tutorial_flag=''
torch_flag=''
muq_flag=''
applications_flag=''
unit_tests_flag=''
while getopts 'htmqj:au' flag; do
case "${flag}" in
h) help_flag='true' ;;
t) tutorial_flag='true' ;;
m) torch_flag="true" ;;
q) muq_flag="true" ;;
a) applications_flag="true" ;;
u) unit_tests_flag="true" ;;
j) parallel_flag="-j ${OPTARG}" ;;
*) print_usage
exit 1 ;;
esac
done
if [[ $help_flag == 'true' ]]; then
echo "Help of the ITHACA-FV ./Allwmake utility"
echo
echo "options:"
echo "-h, show brief help"
echo "-t, enable disable tutorials compilation, False by default"
echo "-m, enable TORCH extension, False by default"
echo "-q, enable MUQ2 extension, False by default"
echo "-j, enable parallel compilation with specified number of cores"
echo "-a, enable application compilation, False by default"
echo "-u, enable unitTests compilation, False by default"
echo
echo "Help for the standard wmake OpenFOAM utility"
wmake -h
exit
fi
cd src
for d in ./*/ ; do
cd $d
if [ -f "Make/files" ]; then
if [[ $d == './ITHACA_TORCH/' ]]; then
if [[ $torch_flag == 'true' ]]; then
echo $d
wmake $parallel_flag
else
cd ..
continue 2
fi
elif [[ $d == './ITHACA_MUQ/' ]]; then
if [[ $muq_flag == 'true' ]]; then
echo $d
wmake $parallel_flag
else
cd ..
continue 2
fi
else
echo $d
wmake $parallel_flag
fi
if [ $? -ne 0 ]
then
echo $d "did not compile"
exit 1
fi
fi
cd ../
done
cd ..
cd applications
if [[ $applications_flag == 'true' ]]; then
for d in ./*/ ; do
echo $d
cd $d
if [ -f "Make/files" ]; then
wmake $parallel_flag
if [ $? -ne 0 ]
then
echo $d "did not compile"
exit 1
fi
fi
cd ../
done
fi
cd ..
cd tutorials
if [[ $tutorial_flag == 'true' ]]; then
for d in ./*/ ; do
echo $d
cd $d
if [ -f "Make/files" ]; then
wmake $parallel_flag
if [ $? -ne 0 ]
then
echo $d "did not compile"
exit 1
fi
fi
cd ../
done
fi
cd ..
cd unitTests
if [[ $unit_tests_flag == 'true' ]]; then
for d in ./*/ ; do
echo $d
cd $d
if [ -f "Make/files" ]; then
wmake $parallel_flag
if [ $? -ne 0 ]
then
echo $d "did not compile"
exit 1
fi
fi
cd ../
done
fi
cd ..
#------------------------------------------------------------------------------