XiFoam: Added relaxation statements to Su and Xi equations
[OpenFOAM-1.6.x.git] / etc / settings.csh
blob17a2ba08e04ee09c71016fea05ffab5aec65c2cc
1 #----------------------------------*-sh-*--------------------------------------
2 # =========                 |
3 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4 #  \\    /   O peration     |
5 #   \\  /    A nd           | Copyright (C) 1991-2009 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.csh
28 # Description
29 #     Startup file for OpenFOAM
30 #     Sourced from OpenFOAM-??/etc/cshrc
32 #------------------------------------------------------------------------------
34 # prefix to PATH
35 alias _foamAddPath 'set path=(\!* $path)'
36 # prefix to LD_LIBRARY_PATH
37 alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
39 # location of the jobControl directory
40 setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
42 # wmake configuration
43 setenv WM_DIR $WM_PROJECT_DIR/wmake
44 setenv WM_LINK_LANGUAGE c++
45 setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
47 # base configuration
48 setenv FOAM_APP $WM_PROJECT_DIR/applications
49 setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
50 setenv FOAM_LIB $WM_PROJECT_DIR/lib
51 setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
52 setenv FOAM_SRC $WM_PROJECT_DIR/src
54 # shared site configuration - similar naming convention as ~OpenFOAM expansion
55 setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
56 setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
58 # user configuration
59 setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
60 setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
62 # convenience
63 setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
64 setenv FOAM_UTILITIES $FOAM_APP/utilities
65 setenv FOAM_SOLVERS $FOAM_APP/solvers
66 setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
68 # add OpenFOAM scripts and wmake to the path
69 set path=($WM_DIR $WM_PROJECT_DIR/bin $path)
71 _foamAddPath $FOAM_APPBIN
72 _foamAddPath $FOAM_SITE_APPBIN
73 _foamAddPath $FOAM_USER_APPBIN
74  # Make sure to pick up dummy versions of external libraries last
75 _foamAddLib  $FOAM_LIBBIN/dummy
76 _foamAddLib  $FOAM_LIBBIN
77 _foamAddLib  $FOAM_SITE_LIBBIN
78 _foamAddLib  $FOAM_USER_LIBBIN
81 # Select compiler installation
82 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
83 # compilerInstall = OpenFOAM | System
84 set compilerInstall=OpenFOAM
86 switch ("$compilerInstall")
87 case OpenFOAM:
88     switch ("$WM_COMPILER")
89     case Gcc:
90         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
91         _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
92         _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
93     breaksw
94     case Gcc43:
95         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
96         _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
97         _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
98     breaksw
99     case Gcc42:
100         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
101     breaksw
102     endsw
104     # Check that the compiler directory can be found
105     if ( ! -d "$WM_COMPILER_DIR" ) then
106         echo
107         echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
108         echo "    Cannot find $WM_COMPILER_DIR installation."
109         echo "    Please install this compiler version or if you wish to use the system compiler,"
110         echo "    change the 'compilerInstall' setting to 'System' in this file"
111         echo
112     endif
114     _foamAddPath ${WM_COMPILER_DIR}/bin
115     _foamAddLib  ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}
116     _foamAddLib  ${WM_COMPILER_DIR}/lib
118     breaksw
119 endsw
122 # Communications library
123 # ~~~~~~~~~~~~~~~~~~~~~~
125 unset MPI_ARCH_PATH
127 switch ("$WM_MPLIB")
128 case OPENMPI:
129     set mpi_version=openmpi-1.3.3
130     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
131     setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
133     # Tell OpenMPI where to find its install directory
134     setenv OPAL_PREFIX $MPI_ARCH_PATH
136     _foamAddPath $MPI_ARCH_PATH/bin
137     _foamAddLib  $MPI_ARCH_PATH/lib
139     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
140     unset mpi_version
141     breaksw
143 case SYSTEMOPENMPI:
145     # This uses the installed openmpi. It needs mpicc installed!
147     set mpi_version=openmpi-system
149     # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
150     setenv PINC `mpicc --showme:compile` 
151     setenv PLIBS `mpicc --showme:link`
152     set libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
154     if ($?FOAM_VERBOSE && $?prompt) then
155         echo "Using system installed MPI:"
156         echo "    compile flags : $PINC"
157         echo "    link flags    : $PLIBS"
158         echo "    libmpi dir    : $libDir"
159     endif
161     _foamAddLib $libDir
163     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
164     unset mpi_version libDir
165     breaksw
167 case MPICH:
168     set mpi_version=mpich-1.2.4
169     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
170     setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
171     setenv MPICH_ROOT $MPI_ARCH_PATH
173     _foamAddPath $MPI_ARCH_PATH/bin
174     _foamAddLib  $MPI_ARCH_PATH/lib
176     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
177     unset mpi_version
178     breaksw
180 case MPICH-GM:
181     setenv MPI_ARCH_PATH /opt/mpi
182     setenv MPICH_PATH $MPI_ARCH_PATH
183     setenv MPICH_ROOT $MPI_ARCH_PATH
184     setenv GM_LIB_PATH /opt/gm/lib64
186     _foamAddPath $MPI_ARCH_PATH/bin
187     _foamAddLib  $MPI_ARCH_PATH/lib
188     _foamAddLib  $GM_LIB_PATH
190     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
191     breaksw
193 case HPMPI:
194     setenv MPI_HOME /opt/hpmpi
195     setenv MPI_ARCH_PATH $MPI_HOME
196     setenv MPICH_ROOT=$MPI_ARCH_PATH
198     _foamAddPath $MPI_ARCH_PATH/bin
200     switch (`uname -m`)
201     case i686:
202         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
203         breaksw
204     case x86_64:
205         _foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
206         breaksw
207     case ia64:
208         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
209         breaksw
210     default:
211         echo Unknown processor type `uname -m` for Linux
212         breaksw
213     endsw
215     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/hpmpi
216     breaksw
218 case GAMMA:
219     setenv MPI_ARCH_PATH /usr
220     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/gamma
221     breaksw
223 case MPI:
224     setenv MPI_ARCH_PATH /opt/mpi
225     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
226     breaksw
228 case FJMPI:
229     setenv MPI_ARCH_PATH /opt/FJSVmpi2
230     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
231     _foamAddPath $MPI_ARCH_PATH/bin
232     _foamAddLib  $MPI_ARCH_PATH/lib/sparcv9
233     _foamAddLib  /opt/FSUNf90/lib/sparcv9
234     _foamAddLib  /opt/FJSVpnidt/lib
235     breaksw
237 case QSMPI:
238     setenv MPI_ARCH_PATH /usr/lib/mpi
239     setenv FOAM_MPI_LIBBIN FOAM_LIBBIN/qsmpi
241     _foamAddPath $MPI_ARCH_PATH/bin
242     _foamAddLib $MPI_ARCH_PATH/lib
244     breaksw
246 default:
247     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
248     breaksw
249 endsw
251 _foamAddLib $FOAM_MPI_LIBBIN
254 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
255 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
256 set minBufferSize=20000000
258 if ( $?MPI_BUFFER_SIZE ) then
259     if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
260         setenv MPI_BUFFER_SIZE $minBufferSize
261     endif
262 else
263     setenv MPI_BUFFER_SIZE $minBufferSize
264 endif
267 # CGAL library if available
268 # ~~~~~~~~~~~~~~~~~~~~~~~~~
269 if ( $?CGAL_LIB_DIR ) then
270     _foamAddLib $CGAL_LIB_DIR
271 endif
274 # Switch on the hoard memory allocator if available
275 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
276 #if ( -f $FOAM_LIBBIN/libhoard.so ) then
277 #    setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
278 #endif
281 # cleanup environment:
282 # ~~~~~~~~~~~~~~~~~~~~
283 unalias _foamAddPath
284 unalias _foamAddLib
285 unset minBufferSize
287 # -----------------------------------------------------------------------------