forked from Aalto-CFD/DLBFoam
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAllwmake
executable file
·131 lines (106 loc) · 2.94 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
#!/bin/bash
cd ${0%/*} || exit 1 # run from this directory
set -e # Any subsequent(*) commands which fail will cause the shell script to exit immediately
# The supported OpenFOAM version
OF_VER=8
check_openfoam()
{
if [ -z ${WM_PROJECT} ]; then
echo "OpenFOAM environment not set."
exit 1
fi
if [[ ! "$WM_PROJECT_VERSION" == "$OF_VER" ]]; then
echo "Error: OpenFOAM-$WM_PROJECT_VERSION not supported."
echo " See other git branches for potential support."
exit 1
fi
}
check_mkl()
{
if [ -d "$MKLROOT" ]; then
echo "Utilising Intel MKL version from path: ${MKLROOT}"
else
echo "Error: MKL_ROOT=${MKLROOT} not found."
exit 1
fi
}
check_openblas()
{
if [ -d "$OPENBLAS_INSTALL_ROOT" ]; then
echo "Utilising OpenBLAS from path: ${OPENBLAS_INSTALL_ROOT}"
else
echo "Error: OPENBLAS_INSTALL_ROOT=${OPENBLAS_INSTALL_ROOT} not found."
exit 1
fi
}
check_cmake()
{
if ! command -v cmake &> /dev/null
then
echo "Error: cmake could not be found. Required for compiling the pyJac C-library."
exit 1
fi
}
how_to()
{
echo "Error: Correct platform syntax ./Allwmake --platform MKL/OPENBLAS/STANDALONE"
}
PLATFORM=NOT_DEFINED
CLEAN_ALL=false
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
--clean)
CLEAN_ALL=true
shift # past argument
;;
--platform)
PLATFORM="$2"
shift # past argument
shift # past value
;;
*)
how_to
exit 1
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
check_openfoam
check_cmake
if [ $PLATFORM == MKL ]; then
check_mkl
cp src/ODE_DLB/Make/options.mkl src/ODE_DLB/Make/options
elif [ $PLATFORM == OPENBLAS ]; then
check_openblas
cp src/ODE_DLB/Make/options.openblas src/ODE_DLB/Make/options
elif [ $PLATFORM == STANDALONE ]; then
cp src/ODE_DLB/Make/options.standalone src/ODE_DLB/Make/options
else
how_to
exit 1
fi
if [ $CLEAN_ALL == true ]; then
./Allwclean
fi
wmake libso src/thermophysicalModels/chemistryModel
wmake libso src/ODE_DLB
pushd tests/validation/pyjacTests/pyjacTestMechanism/lib > /dev/null
./runCmake.sh
popd > /dev/null
wmake tests/unittests
wmake tests/validation/pyjacTests/PSRTest
pushd tests/unittests > /dev/null
./test.sh
popd > /dev/null
pushd tests/validation/pyjacTests/PSRTest > /dev/null
./runTests.sh
popd > /dev/null
cp -r utilities/mechanisms/yao tutorials/reactingFoam/shearlayer_DLB_pyJac/pyJac
cp utilities/CMakeLists.txt tutorials/reactingFoam/shearlayer_DLB_pyJac/pyJac/lib/
cp utilities/runCmake.sh tutorials/reactingFoam/shearlayer_DLB_pyJac/pyJac/lib/
cp -r utilities/mechanisms/gri30 tutorials/chemFoam/gri_pyJac/pyJac
cp utilities/CMakeLists.txt tutorials/chemFoam/gri_pyJac/pyJac/lib/
cp utilities/runCmake.sh tutorials/chemFoam/gri_pyJac/pyJac/lib/