option to restart averaging on output
[OpenFOAM-1.5.x.git] / etc / settings.csh
blobf2cd2e8150211220cb78c86f69951d8c6490b7f3
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.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}'
38 # make directory if it doesn't already exist
39 alias _foamMkDir 'if ( ! -d \!* ) mkdir -p \!*'
41 # location of the jobControl directory
42 setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
44 # wmake configuration
45 setenv WM_DIR $WM_PROJECT_DIR/wmake
46 setenv WM_LINK_LANGUAGE c++
47 setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
49 # base configuration
50 setenv FOAM_SRC $WM_PROJECT_DIR/src
51 setenv FOAM_LIB $WM_PROJECT_DIR/lib
52 setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
53 setenv FOAM_APP $WM_PROJECT_DIR/applications
54 setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
56 # user configuration
57 setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
58 setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
60 # convenience
61 setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
62 setenv FOAM_UTILITIES $FOAM_APP/utilities
63 setenv FOAM_SOLVERS $FOAM_APP/solvers
64 setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
66 # add OpenFOAM scripts and wmake to the path
67 set path=($WM_DIR $WM_PROJECT_DIR/bin $path)
69 _foamAddPath $FOAM_APPBIN
70 _foamAddPath $FOAM_USER_APPBIN
71 _foamAddLib  $FOAM_LIBBIN
72 _foamAddLib  $FOAM_USER_LIBBIN
74 # create these directories if necessary:
75 _foamMkDir $FOAM_LIBBIN
76 _foamMkDir $FOAM_APPBIN
77 _foamMkDir $FOAM_USER_LIBBIN
78 _foamMkDir $FOAM_USER_APPBIN
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.1/platforms/$WM_ARCH$WM_COMPILER_ARCH
91     breaksw
92     case Gcc42:
93         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
94     breaksw
95     endsw
97     # Check that the compiler directory can be found
98     if ( ! -d "$WM_COMPILER_DIR" ) then
99         echo
100         echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
101         echo "    Cannot find $WM_COMPILER_DIR installation."
102         echo "    Please install this compiler version or if you wish to use the system compiler,"
103         echo "    change the 'compilerInstall' setting to 'System' in this file"
104         echo
105     endif
107     _foamAddPath ${WM_COMPILER_DIR}/bin
108     _foamAddLib  ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}
109     _foamAddLib  ${WM_COMPILER_DIR}/lib
111     breaksw
112 endsw
115 # Communications library
116 # ~~~~~~~~~~~~~~~~~~~~~~
118 unset MPI_ARCH_PATH
120 switch ("$WM_MPLIB")
121 case OPENMPI:
122     set mpi_version=openmpi-1.2.6
123     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
124     setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
126     # Tell OpenMPI where to find its install directory
127     setenv OPAL_PREFIX $MPI_ARCH_PATH
129     _foamAddPath $MPI_ARCH_PATH/bin
130     _foamAddLib  $MPI_ARCH_PATH/lib
132     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
133     unset mpi_version
134     breaksw
136 case LAM:
137     set mpi_version=lam-7.1.4
138     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
139     setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
140     setenv LAMHOME $WM_THIRD_PARTY_DIR/$mpi_version
141     # note: LAMHOME is deprecated, should probably point to MPI_ARCH_PATH too
143     _foamAddPath $MPI_ARCH_PATH/bin
144     _foamAddLib  $MPI_ARCH_PATH/lib
146     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
147     unset mpi_version
148     breaksw
150 case MPICH:
151     set mpi_version=mpich-1.2.4
152     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
153     setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
154     setenv MPICH_ROOT $MPI_ARCH_PATH
156     _foamAddPath $MPI_ARCH_PATH/bin
157     _foamAddLib  $MPI_ARCH_PATH/lib
159     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
160     unset mpi_version
161     breaksw
163 case MPICH-GM:
164     setenv MPI_ARCH_PATH /opt/mpi
165     setenv MPICH_PATH $MPI_ARCH_PATH
166     setenv MPICH_ROOT $MPI_ARCH_PATH
167     setenv GM_LIB_PATH /opt/gm/lib64
169     _foamAddPath $MPI_ARCH_PATH/bin
170     _foamAddLib  $MPI_ARCH_PATH/lib
171     _foamAddLib  $GM_LIB_PATH
173     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
174     breaksw
176 case HPMPI:
177     setenv MPI_HOME /opt/hpmpi
178     setenv MPI_ARCH_PATH $MPI_HOME
179     setenv MPICH_ROOT=$MPI_ARCH_PATH
181     _foamAddPath $MPI_ARCH_PATH/bin
183     switch (`uname -m`)
184     case i686:
185         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
186         breaksw
187     case x86_64:
188         _foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
189         breaksw
190     case ia64:
191         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
192         breaksw
193     default:
194         echo Unknown processor type `uname -m` for Linux
195         breaksw
196     endsw
198     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/hpmpi
199     breaksw
201 case GAMMA:
202     setenv MPI_ARCH_PATH /usr
203     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/gamma
204     breaksw
206 case MPI:
207     setenv MPI_ARCH_PATH /opt/mpi
208     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
209     breaksw
211 case FJMPI:
212     setenv MPI_ARCH_PATH /opt/FJSVmpi2
213     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
214     _foamAddPath $MPI_ARCH_PATH/bin
215     _foamAddLib  $MPI_ARCH_PATH/lib/sparcv9
216     _foamAddLib  /opt/FSUNf90/lib/sparcv9
217     _foamAddLib  /opt/FJSVpnidt/lib
218     breaksw
220 default:
221     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
222     breaksw
223 endsw
225 _foamAddLib $FOAM_MPI_LIBBIN
228 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
229 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
230 set minBufferSize=20000000
232 if ( $?MPI_BUFFER_SIZE ) then
233     if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
234         setenv MPI_BUFFER_SIZE $minBufferSize
235     endif
236 else
237     setenv MPI_BUFFER_SIZE $minBufferSize
238 endif
241 # CGAL library if available
242 # ~~~~~~~~~~~~~~~~~~~~~~~~~
243 if ( $?CGAL_LIB_DIR ) then
244     _foamAddLib $CGAL_LIB_DIR
245 endif
248 # Switch on the hoard memory allocator if available
249 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
250 #if ( -f $FOAM_LIBBIN/libhoard.so ) then
251 #    setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
252 #endif
255 # cleanup environment:
256 # ~~~~~~~~~~~~~~~~~~~~
257 unalias _foamAddPath
258 unalias _foamAddLib
259 unalias _foamMkDir
260 unset minBufferSize
262 # -----------------------------------------------------------------------------