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 # hardcode installation directory
31 #------------------------------------------------------------------------------
33 while [ "$#" -ge 1 ]; do echo "$1"; shift; done
37 --foamInstall dir specify installation directory (e.g. /opt)
38 --projectName name specify project name (e.g. openfoam170)
39 --projectVersion ver specify project version (e.g. 1.7.x)
40 --archOption arch specify architecture option (only 32 or 64 applicable)
41 --paraviewInstall dir specify ParaView_DIR (e.g. /opt/paraviewopenfoam380)
43 * hardcode paths to installation
50 # Function to do replacement on file. Checks if any replacement has been done.
51 # inlineSed <file> <sedCommand> <description>
57 cmp --quiet $1 $backup && usage
"Failed : $3"
62 [ -f etc
/bashrc
-a -f etc
/settings.sh
] || usage
"Please run from top-level directory of installation"
64 unset foamInstall projectName projectVersion archOption paraviewInstall
74 [ "$#" -ge 2 ] || usage
"'$1' option requires an argument"
78 '/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" \
79 "Replacing foamInstall setting by $foamInstall"
83 [ "$#" -ge 2 ] || usage
"'$1' option requires an argument"
87 '/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" \
88 "Replacing WM_PROJECT_DIR setting by $projectName"
92 [ "$#" -ge 2 ] || usage
"'$1' option requires an argument"
96 '/^[^#]/s@WM_PROJECT_VERSION=.*@WM_PROJECT_VERSION='"$projectVersion@" \
97 "Replacing WM_PROJECT_VERSION setting by $projectVersion"
101 [ "$#" -ge 2 ] || usage
"'$1' option requires an argument"
105 '/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" \
106 "Replacing WM_ARCH_OPTION setting by $archOption"
110 [ "$#" -ge 2 ] || usage
"'$1' option requires an argument"
113 etc
/apps
/paraview
3/bashrc \
114 '/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" \
115 "Replacing ParaView_DIR setting by $paraviewInstall"
119 usage
"unknown option/argument: '$*'"
124 [ -n "$foamInstall" -o -n "$projectName" -o -n "$projectVersion" -o -n "$archOption" -o -n "$paraviewInstall" ] || usage
"Please specify at least one configure option"
126 #echo "Replacing WM_PROJECT setting by $projectName"
127 #sed -i -e 's@WM_PROJECT=.*@WM_PROJECT='"$projectName@" etc/bashrc
129 # Replace the WM_MPLIB always
132 '/^[^#]/s@: ${WM_MPLIB:=.*}@WM_MPLIB=SYSTEMOPENMPI@' \
133 "Replacing WM_MPLIB setting by SYSTEMOPENMPI"
134 ## Replace the compilerInstall always
137 # '/^[^#]/s@: ${compilerInstall:=.*}@compilerInstall=system@' \
138 # "Replacing compilerInstall setting by system"
140 #------------------------------------------------------------------------------