intersection with triangle plane for miss
[OpenFOAM-1.5.x.git] / etc / settings.sh
blob6dd5abaa11cea4a41d18f53a795e8228668466a0
1 #----------------------------------*-sh-*--------------------------------------
2 # ========= |
3 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 # \\ / O peration |
5 # \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
6 # \\/ M anipulation |
7 #------------------------------------------------------------------------------
8 # License
9 # This file is part of OpenFOAM.
11 # OpenFOAM is free software; you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by the
13 # Free Software Foundation; either version 2 of the License, or (at your
14 # option) any later version.
16 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19 # for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with OpenFOAM; if not, write to the Free Software Foundation,
23 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 # Script
26 # etc/settings.sh
28 # Description
29 # Startup file for OpenFOAM
30 # Sourced from OpenFOAM-??/etc/bashrc
32 #------------------------------------------------------------------------------
34 # prefix to PATH
35 _foamAddPath()
37 while [ $# -ge 1 ]
39 export PATH=$1:$PATH
40 shift
41 done
44 # prefix to LD_LIBRARY_PATH
45 _foamAddLib()
47 while [ $# -ge 1 ]
49 export LD_LIBRARY_PATH=$1:$LD_LIBRARY_PATH
50 shift
51 done
55 # make directories if they don't already exist
56 _foamMkDir()
58 while [ $# -ge 1 ]
60 [ -d $1 ] || mkdir -p $1
61 shift
62 done
66 # location of the jobControl directory
67 export FOAM_JOB_DIR=$WM_PROJECT_INST_DIR/jobControl
69 # wmake configuration
70 export WM_DIR=$WM_PROJECT_DIR/wmake
71 export WM_LINK_LANGUAGE=c++
72 export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
74 # base configuration
75 export FOAM_SRC=$WM_PROJECT_DIR/src
76 export FOAM_LIB=$WM_PROJECT_DIR/lib
77 export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS
78 export FOAM_APP=$WM_PROJECT_DIR/applications
79 export FOAM_APPBIN=$WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
81 # user configuration
82 export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
83 export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
85 # convenience
86 export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
87 export FOAM_UTILITIES=$FOAM_APP/utilities
88 export FOAM_SOLVERS=$FOAM_APP/solvers
89 export FOAM_RUN=$WM_PROJECT_USER_DIR/run
91 # add OpenFOAM scripts and wmake to the path
92 export PATH=$WM_DIR:$WM_PROJECT_DIR/bin:$PATH
94 _foamAddPath $FOAM_APPBIN $FOAM_USER_APPBIN
95 _foamAddLib $FOAM_LIBBIN $FOAM_USER_LIBBIN
97 # create these directories if necessary:
98 _foamMkDir $FOAM_LIBBIN $FOAM_USER_LIBBIN $FOAM_APPBIN $FOAM_USER_APPBIN
101 # Compiler settings
102 # ~~~~~~~~~~~~~~~~~
103 unset compilerBin compilerLib
105 # Select compiler installation
106 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107 # compilerInstall = OpenFOAM | System
108 compilerInstall=OpenFOAM
110 case "$compilerInstall" in
111 OpenFOAM)
112 case "$WM_COMPILER" in
113 Gcc)
114 export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.3.1/platforms/$WM_ARCH$WM_COMPILER_ARCH
116 Gcc42)
117 export WM_COMPILER_DIR=$WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
119 esac
121 # Check that the compiler directory can be found
122 if [ ! -d "$WM_COMPILER_DIR" ]
123 then
124 echo
125 echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
126 echo " Cannot find $WM_COMPILER_DIR installation."
127 echo " Please install this compiler version or if you wish to use the system compiler,"
128 echo " change the 'compilerInstall' setting to 'System' in this file"
129 echo
132 compilerBin=$WM_COMPILER_DIR/bin
133 compilerLib=$WM_COMPILER_DIR/lib$WM_COMPILER_LIB_ARCH:$WM_COMPILER_DIR/lib
135 esac
137 if [ -d "$compilerBin" ]
138 then
139 _foamAddPath $compilerBin
140 _foamAddLib $compilerLib
143 unset compilerBin compilerLib compilerInstall
145 # Communications library
146 # ~~~~~~~~~~~~~~~~~~~~~~
148 unset MPI_ARCH_PATH
150 case "$WM_MPLIB" in
151 OPENMPI)
152 mpi_version=openmpi-1.2.6
153 export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version
154 export MPI_ARCH_PATH=$MPI_HOME/platforms/$WM_OPTIONS
156 # Tell OpenMPI where to find its install directory
157 export OPAL_PREFIX=$MPI_ARCH_PATH
159 _foamAddPath $MPI_ARCH_PATH/bin
160 _foamAddLib $MPI_ARCH_PATH/lib
162 export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
163 unset mpi_version
166 LAM)
167 mpi_version=lam-7.1.4
168 export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version
169 export MPI_ARCH_PATH=$MPI_HOME/platforms/$WM_OPTIONS
170 export LAMHOME=$WM_THIRD_PARTY_DIR/$mpi_version
171 # note: LAMHOME is deprecated, should probably point to MPI_ARCH_PATH too
173 _foamAddPath $MPI_ARCH_PATH/bin
174 _foamAddLib $MPI_ARCH_PATH/lib
176 export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
177 unset mpi_version
180 MPICH)
181 mpi_version=mpich-1.2.4
182 export MPI_HOME=$WM_THIRD_PARTY_DIR/$mpi_version
183 export MPI_ARCH_PATH=$MPI_HOME/platforms/$WM_OPTIONS
184 export MPICH_ROOT=$MPI_ARCH_PATH
186 _foamAddPath $MPI_ARCH_PATH/bin
187 _foamAddLib $MPI_ARCH_PATH/lib
189 export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
190 unset mpi_version
193 MPICH-GM)
194 export MPI_ARCH_PATH=/opt/mpi
195 export MPICH_PATH=$MPI_ARCH_PATH
196 export MPICH_ROOT=$MPI_ARCH_PATH
197 export GM_LIB_PATH=/opt/gm/lib64
199 _foamAddPath $MPI_ARCH_PATH/bin
200 _foamAddLib $MPI_ARCH_PATH/lib
201 _foamAddLib $GM_LIB_PATH
203 export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpich-gm
206 HPMPI)
207 export MPI_HOME=/opt/hpmpi
208 export MPI_ARCH_PATH=$MPI_HOME
209 export MPICH_ROOT=$MPI_ARCH_PATH
211 _foamAddPath $MPI_ARCH_PATH/bin
213 case `uname -m` in
214 i686)
215 _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
218 x86_64)
219 _foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
221 ia64)
222 _foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
225 echo Unknown processor type `uname -m` for Linux
227 esac
229 export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/hpmpi
232 GAMMA)
233 export MPI_ARCH_PATH=/usr
234 export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/gamma
237 MPI)
238 export MPI_ARCH_PATH=/opt/mpi
239 export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpi
242 FJMPI)
243 export MPI_ARCH_PATH=/opt/FJSVmpi2
244 export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpi
246 _foamAddPath $MPI_ARCH_PATH/bin
247 _foamAddLib $MPI_ARCH_PATH/lib/sparcv9
248 _foamAddLib /opt/FSUNf90/lib/sparcv9
249 _foamAddLib /opt/FJSVpnidt/lib
252 QSMPI)
253 export MPI_ARCH_PATH=/usr/lib/mpi
254 export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/qsmpi
256 _foamAddPath $MPI_ARCH_PATH/bin
257 _foamAddLib $MPI_ARCH_PATH/lib
262 export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/dummy
264 esac
266 _foamAddLib $FOAM_MPI_LIBBIN
269 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
270 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
271 minBufferSize=20000000
273 if [ "${MPI_BUFFER_SIZE:=$minBufferSize}" -lt $minBufferSize ]
274 then
275 MPI_BUFFER_SIZE=$minBufferSize
277 export MPI_BUFFER_SIZE
280 # CGAL library if available
281 # ~~~~~~~~~~~~~~~~~~~~~~~~~
282 [ -d "$CGAL_LIB_DIR" ] && _foamAddLib $CGAL_LIB_DIR
285 # Switch on the hoard memory allocator if available
286 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
287 #if [ -f $FOAM_LIBBIN/libhoard.so ]; then
288 # export LD_PRELOAD=$FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
292 # cleanup environment:
293 # ~~~~~~~~~~~~~~~~~~~~
294 unset _foamAddPath _foamAddLib _foamMkDir minBufferSize
296 # -----------------------------------------------------------------------------