BUG: directMappedPatchBase : split off nearInfo class
[OpenFOAM-1.7.x.git] / etc / settings.csh
blob2c182ab4fb30332f55edda996df88d8b5743cc9c
1 #----------------------------------*-sh-*--------------------------------------
2 # =========                 |
3 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4 #  \\    /   O peration     |
5 #   \\  /    A nd           | Copyright (C) 1991-2010 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
13 #     the Free Software Foundation, either version 3 of the License, or
14 #     (at your 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, see <http://www.gnu.org/licenses/>.
24 # File
25 #     etc/settings.csh
27 # Description
28 #     Startup file for OpenFOAM
29 #     Sourced from OpenFOAM-??/etc/cshrc
31 #------------------------------------------------------------------------------
33 # prefix to PATH
34 alias _foamAddPath 'setenv PATH \!*\:${PATH}'
35 # prefix to LD_LIBRARY_PATH
36 alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
37 # prefix to MANPATH
38 alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}'
40 # location of the jobControl directory
41 setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
43 # wmake configuration
44 setenv WM_DIR $WM_PROJECT_DIR/wmake
45 setenv WM_LINK_LANGUAGE c++
46 setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
48 # base configuration
49 setenv FOAM_APP $WM_PROJECT_DIR/applications
50 setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
51 setenv FOAM_LIB $WM_PROJECT_DIR/lib
52 setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
53 setenv FOAM_SRC $WM_PROJECT_DIR/src
55 # shared site configuration - similar naming convention as ~OpenFOAM expansion
56 setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
57 setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
59 # user configuration
60 setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
61 setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
63 # convenience
64 setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
65 setenv FOAM_UTILITIES $FOAM_APP/utilities
66 setenv FOAM_SOLVERS $FOAM_APP/solvers
67 setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
69 # add OpenFOAM scripts and wmake to the path
70 setenv PATH ${WM_DIR}:${WM_PROJECT_DIR}/bin:${PATH}
72 _foamAddPath ${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN}
73  # Make sure to pick up dummy versions of external libraries last
74 _foamAddLib  ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_LIBBIN}/dummy
76 # Compiler settings
77 # ~~~~~~~~~~~~~~~~~
78 unset gcc_version gmp_version mpfr_version mpc_version
79 unsetenv MPFR_ARCH_PATH
82 # Select compiler installation
83 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84 # compilerInstall = OpenFOAM | system
85 if ( ! $?compilerInstall ) set compilerInstall=system
87 switch ("$compilerInstall")
88 case OpenFOAM:
89     switch ("$WM_COMPILER")
90     case Gcc:
91         set gcc_version=gcc-4.4.3
92         set gmp_version=gmp-5.0.1
93         set mpfr_version=mpfr-2.4.2
94         breaksw
95     case Gcc45:
96         set gcc_version=gcc-4.5.0
97         set gmp_version=gmp-5.0.1
98         set mpfr_version=mpfr-2.4.2
99         set mpc_version=mpc-0.8.1
100         breaksw
101     case Gcc44:
102         set gcc_version=gcc-4.4.3
103         set gmp_version=gmp-5.0.1
104         set mpfr_version=mpfr-2.4.2
105         breaksw
106     case Gcc43:
107         set gcc_version=gcc-4.3.3
108         set gmp_version=gmp-4.2.4
109         set mpfr_version=mpfr-2.4.1
110         breaksw
111     default:
112         echo
113         echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
114         echo "    Unknown OpenFOAM compiler type '$WM_COMPILER'"
115         echo "    Please check your settings"
116         echo
117         breaksw
118     endsw
120     if ( $?gcc_version ) then
121         set gccDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gcc_version
122         set gmpDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$gmp_version
123         set mpfrDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpfr_version
124         if ( $?mpc_version ) then
125             set mpcDir=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER_ARCH/$mpc_version
126         endif
128         # Check that the compiler directory can be found
129         if ( ! -d "$gccDir" ) then
130             echo
131             echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
132             echo "    Cannot find $gccDir installation."
133             echo "    Please install this compiler version or if you wish to use the system compiler,"
134             echo "    change the 'compilerInstall' setting to 'system' in this file"
135             echo
136         endif
138         _foamAddMan     $gccDir/man
139         _foamAddPath    $gccDir/bin
141         # 64-bit needs lib64, but 32-bit needs lib (not lib32)
142         if ($WM_ARCH_OPTION == 64) then
143             _foamAddLib     $gccDir/lib$WM_COMPILER_LIB_ARCH
144         else
145             _foamAddLib     $gccDir/lib
146         endif
148         # add in gmp/mpfr libraries
149         _foamAddLib     $gmpDir/lib
150         _foamAddLib     $mpfrDir/lib
152         # add in mpc libraries (not need for older gcc)
153         if ( $?mpc_version ) then
154             _foamAddLib     $mpcDir/lib
155         endif
157         # used by boost/CGAL:
158         setenv MPFR_ARCH_PATH $mpfrDir
159     endif
160     unset gcc_version gccDir
161     unset gmp_version gmpDir  mpfr_version mpfrDir  mpc_version mpcDir
162     breaksw
163 endsw
166 # boost and CGAL
167 # ~~~~~~~~~~~~~~
169 set boost_version=boost_1_42_0
170 set cgal_version=CGAL-3.5.1
172 setenv BOOST_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$boost_version
173 setenv CGAL_ARCH_PATH  $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cgal_version
175 # enabled if CGAL is available
176 if ( -d "$CGAL_ARCH_PATH" ) then
177     if ( -d "$BOOST_ARCH_PATH" ) then
178         _foamAddLib $BOOST_ARCH_PATH/lib
179     else
180         unsetenv BOOST_ARCH_PATH
181     endif
182     _foamAddLib $CGAL_ARCH_PATH/lib
183 else
184     unsetenv BOOST_ARCH_PATH CGAL_ARCH_PATH MPFR_ARCH_PATH
185 endif
187 unset boost_version cgal_version
190 # Communications library
191 # ~~~~~~~~~~~~~~~~~~~~~~
193 unsetenv MPI_ARCH_PATH MPI_HOME
195 switch ("$WM_MPLIB")
196 case OPENMPI:
197     set mpi_version=openmpi-1.4.1
198     setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version
200     # Tell OpenMPI where to find its install directory
201     setenv OPAL_PREFIX $MPI_ARCH_PATH
203     _foamAddPath    $MPI_ARCH_PATH/bin
204     _foamAddLib     $MPI_ARCH_PATH/lib
205     _foamAddMan     $MPI_ARCH_PATH/man
207     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
208     unset mpi_version
209     breaksw
211 case SYSTEMOPENMPI:
213     # This uses the installed openmpi. It needs mpicc installed!
215     set mpi_version=openmpi-system
217     # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
218     setenv PINC "`mpicc --showme:compile`"
219     setenv PLIBS "`mpicc --showme:link`"
220     set libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
222     if ($?FOAM_VERBOSE && $?prompt) then
223         echo "Using system installed MPI:"
224         echo "    compile flags : $PINC"
225         echo "    link flags    : $PLIBS"
226         echo "    libmpi dir    : $libDir"
227     endif
229     _foamAddLib     $libDir
231     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
232     unset mpi_version libDir
233     breaksw
235 case MPICH:
236     set mpi_version=mpich2-1.1.1p1
237     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
238     setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version
240     _foamAddPath    $MPI_ARCH_PATH/bin
241     _foamAddLib     $MPI_ARCH_PATH/lib
242     _foamAddMan     $MPI_ARCH_PATH/share/man
244     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
245     unset mpi_version
246     breaksw
248 case MPICH-GM:
249     setenv MPI_ARCH_PATH /opt/mpi
250     setenv MPICH_PATH $MPI_ARCH_PATH
251     setenv GM_LIB_PATH /opt/gm/lib64
253     _foamAddPath    $MPI_ARCH_PATH/bin
254     _foamAddLib     $MPI_ARCH_PATH/lib
255     _foamAddLib     $GM_LIB_PATH
257     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
258     breaksw
260 case HPMPI:
261     setenv MPI_HOME /opt/hpmpi
262     setenv MPI_ARCH_PATH $MPI_HOME
264     _foamAddPath $MPI_ARCH_PATH/bin
266     switch (`uname -m`)
267     case i686:
268         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
269         breaksw
270     case x86_64:
271         _foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
272         breaksw
273     case ia64:
274         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
275         breaksw
276     default:
277         echo Unknown processor type `uname -m` for Linux
278         breaksw
279     endsw
281     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/hpmpi
282     breaksw
284 case MPI:
285     setenv MPI_ARCH_PATH /opt/mpi
286     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
287     breaksw
289 case FJMPI:
290     setenv MPI_ARCH_PATH /opt/FJSVmpi2
291     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
292     _foamAddPath    $MPI_ARCH_PATH/bin
293     _foamAddLib     $MPI_ARCH_PATH/lib/sparcv9
294     _foamAddLib     /opt/FSUNf90/lib/sparcv9
295     _foamAddLib     /opt/FJSVpnidt/lib
296     breaksw
298 case QSMPI:
299     setenv MPI_ARCH_PATH /usr/lib/mpi
300     setenv FOAM_MPI_LIBBIN FOAM_LIBBIN/qsmpi
302     _foamAddPath    $MPI_ARCH_PATH/bin
303     _foamAddLib     $MPI_ARCH_PATH/lib
305     breaksw
307 default:
308     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
309     breaksw
310 endsw
312 _foamAddLib $FOAM_MPI_LIBBIN
315 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
316 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
317 if ( ! $?minBufferSize ) set minBufferSize=20000000
319 if ( $?MPI_BUFFER_SIZE ) then
320     if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
321         setenv MPI_BUFFER_SIZE $minBufferSize
322     endif
323 else
324     setenv MPI_BUFFER_SIZE $minBufferSize
325 endif
328 # Enable the hoard memory allocator if available
329 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
330 #if ( -f $FOAM_LIBBIN/libhoard.so ) then
331 #    setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
332 #endif
335 # cleanup environment:
336 # ~~~~~~~~~~~~~~~~~~~~
337 unalias _foamAddPath _foamAddLib _foamAddMan
338 unset compilerInstall minBufferSize
340 # ----------------------------------------------------------------- end-of-file