2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
8 #-------------------------------------------------------------------------------
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by
14 # the Free Software Foundation, either version 3 of the License, or
15 # (at your option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
29 # Checks the machine system and the user's
30 # personal configuration for running OpenFOAM.
32 #------------------------------------------------------------------------------
36 HLINE
="-----------------------------------------------------------------------"
51 echo $1 |
tr -d " " |
wc -m |
tr -d " "
57 NOCHAR
=$
(expr $NOCHAR - 1)
58 [ $NOCHAR -ge 0 ] || NOCHAR
=0
66 LDIFF
=$
(expr $ONELEN - $2)
69 while [ $LDIFF -lt 0 ]
72 LDIFF
=$
(expr $LDIFF + 1)
76 LDIFF
=$
(expr $LDIFF + 4)
77 WORD
=$
(echo "$WORD" | cut
-c${LDIFF}-)
84 heading
"Checking basic system..."
87 echo "$(fixlen Shell: $WIDTH) $SHELL"
89 */csh |
*/tcsh |
*/bash |
*/ksh
)
92 echo "ERROR: Cannot identify the current shell."
93 echo " OpenFOAM $WM_PROJECT_VERSION is compatible"
94 echo " with csh, tcsh, ksh and bash."
102 echo "$(fixlen Host: $WIDTH) $HOST"
103 if [ $
(length
$HOST) -eq 0 ]
105 echo "ERROR: Cannot stat hostname."
106 echo " OpenFOAM $WM_PROJECT_VERSION needs a valid hostname to"
107 echo " function. Contact your system administrator."
115 Linux | LinuxAMD64 | SunOS
)
116 echo "$(fixlen OS: $WIDTH) $OSTYPE version $(uname -r)"
119 echo "ERROR: Incompatible operating system \"$OSTYPE\"."
120 echo " OpenFOAM $WM_PROJECT_VERSION is currently available for "
121 echo " Linux, LinuxAMD64 and SunOS only."
130 if [ $
(length
$USER_NAME) -eq 0 ]
135 echo "$(fixlen User: $WIDTH) ${USER_NAME}"
136 if [ $
(length
$USER_NAME) -eq 0 ]
138 echo "ERROR: Cannot stat user name $USER_NAME."
139 echo " OpenFOAM $WM_PROJECT_VERSION needs a valid user name."
140 echo " Contact your system administrator. "
148 if [ "$fatalError" = true
]
150 echo "System check: FAIL"
151 echo "=================="
152 echo "Your system is not currently compatible with OpenFOAM installation "
153 echo "requirements. Review the error messages and consult the documentation"
154 echo "for further instructions."
157 echo "System check: PASS"
158 echo "=================="
159 echo "Continue OpenFOAM installation."
163 #------------------------------------------------------------------------------