2 #---------------------------------*- sh -*-------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 1991-2010 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 #------------------------------------------------------------------------------
38 HLINE
="-----------------------------------------------------------------------"
51 echo $1 |
tr -d " " |
wc -m |
tr -d " "
56 NOCHAR
=$
(expr $NOCHAR - 1)
67 LDIFF
=$
(expr $ONELEN - $2)
70 while [ $LDIFF -lt 0 ]
73 LDIFF
=$
(expr $LDIFF + 1)
77 LDIFF
=$
(expr $LDIFF + 4)
78 WORD
=$
(echo "$WORD" | cut
-c${LDIFF}-)
85 heading
"Checking basic system..."
88 echo "$(fixlen "Shell
:" $WIDTH) $SHELL"
91 USER_CONFIG_TYPE
=cshrc
94 USER_CONFIG_TYPE
=bashrc
98 echo "FATALERROR: Cannot identify the current shell."
99 echo " OpenFOAM ${FOAM_VERSION} is compatible"
100 echo " with csh, tcsh, ksh and bash."
108 echo "$(fixlen "Host
:" $WIDTH) $HOST"
109 if [ $
(length
$HOST) -eq 0 ]
111 echo "FATALERROR: Cannot stat hostname."
112 echo " OpenFOAM ${FOAM_VERSION} needs a valid hostname to function."
113 echo " Contact your system administrator. "
121 Linux | LinuxAMD64 | SunOS
)
122 echo "$(fixlen "OS
:" $WIDTH) ${OS} version $(uname -r)"
125 echo "FATALERROR: Incompatible operating system \"$OS\"."
126 echo " OpenFOAM ${FOAM_VERSION} is currently available for "
127 echo " Linux, LinuxAMD64 and SunOS only."
136 if [ $
(length
$USER_NAME) -eq 0 ]
141 echo "$(fixlen "User
:" $WIDTH) ${USER_NAME}"
142 if [ $
(length
$USER_NAME) -eq 0 ]
144 echo "FATALERROR: Cannot stat user name ${USER_NAME}."
145 echo " OpenFOAM ${FOAM_VERSION} needs a valid user name."
146 echo " Contact your system administrator. "
154 if [ -n "$FATALERROR" ]
156 echo "System check: FAIL"
157 echo "=================="
158 echo "Your system is not currently compatible with OpenFOAM installation "
159 echo "requirements. Review the error messages and consult the documentation"
160 echo "for further instructions."
163 echo "System check: PASS"
164 echo "=================="
165 echo "Continue OpenFOAM installation."
169 #------------------------------------------------------------------------------