File: Allwmake

package info (click to toggle)
openfoam 1912.200626-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 238,940 kB
  • sloc: cpp: 1,159,638; sh: 15,902; ansic: 5,195; lex: 660; xml: 387; python: 282; awk: 212; makefile: 103; sed: 88; csh: 3
file content (96 lines) | stat: -rwxr-xr-x 2,996 bytes parent folder | download | duplicates (2)
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
#!/bin/sh
# Run from OPENFOAM top-level directory only
cd "${0%/*}" || exit
wmakeCheckPwd "$WM_PROJECT_DIR" 2>/dev/null || {
    echo "Error (${0##*/}) : not located in \$WM_PROJECT_DIR"
    echo "    Check your OpenFOAM environment and installation"
    exit 1
}
[ -d "$WM_PROJECT_DIR" -a -f "$WM_PROJECT_DIR/etc/bashrc" ] || {
    echo "Error (${0##*/}) : WM_PROJECT_DIR appears to be incorrect"
    echo "    Check your OpenFOAM environment and installation"
    exit 1
}

. "$WM_PROJECT_DIR"/wmake/scripts/AllwmakeParseArguments

#------------------------------------------------------------------------------
# Preamble. Report tools or at least the mpirun location
if [ -f "$WM_PROJECT_DIR"/wmake/scripts/list_tools ]
then  . "$WM_PROJECT_DIR"/wmake/scripts/list_tools
else
    echo "mpirun=$(command -v mpirun || true)"
fi
echo
# Report compiler information
compiler="$(wmake -show-path-cxx 2>/dev/null || true)"
if [ -x "$compiler" ]
then
    echo "compiler=$compiler"
    "$compiler" --version 2>/dev/null | sed -ne '1p'
else
    echo "compiler=unknown"
fi

echo
echo "========================================"
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
echo "Starting compile ${WM_PROJECT_DIR##*/} ${0##*/}"
echo "  $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
echo "  ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo "========================================"
echo

# Compile tools for wmake
"${WM_DIR:-wmake}"/src/Allmake

# Compile ThirdParty libraries and applications
if [ -d "$WM_THIRD_PARTY_DIR" ]
then
    "$WM_THIRD_PARTY_DIR/Allwmake"
else
    echo "No ThirdParty directory found - skipping"
fi

echo "========================================"
echo "Compile OpenFOAM libraries"
echo
src/Allwmake $targetType $*

echo "========================================"
echo "Compile OpenFOAM applications"
echo
applications/Allwmake $targetType $*

# Additional components/modules
if [ -d "$WM_PROJECT_DIR/modules" ]
then
    echo "========================================"
    echo "Compile OpenFOAM modules"
    echo
    (cd "$WM_PROJECT_DIR/modules" 2>/dev/null && wmake -all)
fi

# Count files in given directory. Ignore "Test-*" binaries.
_foamCountDirEntries()
{
    (cd "$1" 2>/dev/null && find -mindepth 1 -maxdepth 1 -type f 2>/dev/null) |\
        sed -e '\@/Test-@d' | wc -l
}

# Some summary information
echo
date "+%Y-%m-%d %H:%M:%S %z" 2>/dev/null || echo "date is unknown"
echo "========================================"
echo "  ${WM_PROJECT_DIR##*/}"
echo "  $WM_COMPILER ${WM_COMPILER_TYPE:-system} compiler"
echo "  ${WM_OPTIONS}, with ${WM_MPLIB} ${FOAM_MPI}"
echo
echo "  api   = $(etc/openfoam -show-api 2>/dev/null)"
echo "  patch = $(etc/openfoam -show-patch 2>/dev/null)"
echo "  bin   = $(_foamCountDirEntries $FOAM_APPBIN) entries"
echo "  lib   = $(_foamCountDirEntries $FOAM_LIBBIN) entries"
echo
echo "========================================"

#------------------------------------------------------------------------------