2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright held by original author
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 the
14 # Free Software Foundation; either version 2 of the License, or (at your
15 # 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, write to the Free Software Foundation,
24 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
30 # Checks the machine system and the user's
31 # personal configuration for running OpenFOAM.
33 #------------------------------------------------------------------------------
39 HLINE
="-----------------------------------------------------------------------"
52 echo $1 |
tr -d " " |
wc -m |
tr -d " "
57 NOCHAR
=$
(expr $NOCHAR - 1)
68 LDIFF
=$
(expr $ONELEN - $2)
71 while [ $LDIFF -lt 0 ]
74 LDIFF
=$
(expr $LDIFF + 1)
78 LDIFF
=$
(expr $LDIFF + 4)
79 WORD
=$
(echo "$WORD" | cut
-c${LDIFF}-)
86 heading
"Checking basic system..."
89 echo "$(fixlen "Shell
:" $WIDTH) $SHELL"
92 USER_CONFIG_TYPE
=cshrc
95 USER_CONFIG_TYPE
=bashrc
99 echo "FATALERROR: Cannot identify the current shell."
100 echo " OpenFOAM ${FOAM_VERSION} is compatible"
101 echo " with csh, tcsh, ksh and bash."
109 echo "$(fixlen "Host
:" $WIDTH) $HOST"
110 if [ $
(length
$HOST) -eq 0 ]
112 echo "FATALERROR: Cannot stat hostname."
113 echo " OpenFOAM ${FOAM_VERSION} needs a valid hostname to function."
114 echo " Contact your system administrator. "
122 Linux | LinuxAMD64 | SunOS
)
123 echo "$(fixlen "OS
:" $WIDTH) ${OS} version $(uname -r)"
126 echo "FATALERROR: Incompatible operating system \"$OS\"."
127 echo " OpenFOAM ${FOAM_VERSION} is currently available for "
128 echo " Linux, LinuxAMD64 and SunOS only."
137 if [ $
(length
$USER_NAME) -eq 0 ]
142 echo "$(fixlen "User
:" $WIDTH) ${USER_NAME}"
143 if [ $
(length
$USER_NAME) -eq 0 ]
145 echo "FATALERROR: Cannot stat user name ${USER_NAME}."
146 echo " OpenFOAM ${FOAM_VERSION} needs a valid user name."
147 echo " Contact your system administrator. "
155 if [ -n "$FATALERROR" ]
157 echo "System check: FAIL"
158 echo "=================="
159 echo "Your system is not currently compatible with OpenFOAM installation "
160 echo "requirements. Review the error messages and consult the documentation"
161 echo "for further instructions."
164 echo "System check: PASS"
165 echo "=================="
166 echo "Continue OpenFOAM installation."
170 #------------------------------------------------------------------------------