2 #------------------------------------------------------------------------------
4 # \\ / F ield | foam-extend: Open Source CFD
6 # \\ / A nd | For copyright notice see file Copyright
8 #------------------------------------------------------------------------------
10 # This file is part of foam-extend.
12 # foam-extend 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 3 of the License, or (at your
15 # option) any later version.
17 # foam-extend is distributed in the hope that it will be useful, but
18 # WITHOUT ANY WARRANTY; without even the implied warranty of
19 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20 # General Public License for more details.
22 # You should have received a copy of the GNU General Public License
23 # along with foam-extend. 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 #------------------------------------------------------------------------------