BUG: patchCloudSet: only take hits. Use local bounding box for tree
[OpenFOAM-1.7.x.git] / etc / settings.csh
blobfa78577d816a4f88061bc4110fc6d6a9e1fb45a8
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     # Bit of a hack: strip off 'lib' and hope this is the path to openmpi
223     # include files and libraries.
224     setenv MPI_ARCH_PATH "${libDir:h}"
226     if ($?FOAM_VERBOSE && $?prompt) then
227         echo "Using system installed MPI:"
228         echo "    compile flags : $PINC"
229         echo "    link flags    : $PLIBS"
230         echo "    libmpi dir    : $libDir"
231     endif
233     _foamAddLib     $libDir
235     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
236     unset mpi_version libDir
237     breaksw
239 case MPICH:
240     set mpi_version=mpich2-1.1.1p1
241     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
242     setenv MPI_ARCH_PATH $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$mpi_version
244     _foamAddPath    $MPI_ARCH_PATH/bin
245     _foamAddLib     $MPI_ARCH_PATH/lib
246     _foamAddMan     $MPI_ARCH_PATH/share/man
248     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
249     unset mpi_version
250     breaksw
252 case MPICH-GM:
253     setenv MPI_ARCH_PATH /opt/mpi
254     setenv MPICH_PATH $MPI_ARCH_PATH
255     setenv GM_LIB_PATH /opt/gm/lib64
257     _foamAddPath    $MPI_ARCH_PATH/bin
258     _foamAddLib     $MPI_ARCH_PATH/lib
259     _foamAddLib     $GM_LIB_PATH
261     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
262     breaksw
264 case HPMPI:
265     setenv MPI_HOME /opt/hpmpi
266     setenv MPI_ARCH_PATH $MPI_HOME
268     _foamAddPath $MPI_ARCH_PATH/bin
270     switch (`uname -m`)
271     case i686:
272         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
273         breaksw
274     case x86_64:
275         _foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
276         breaksw
277     case ia64:
278         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
279         breaksw
280     default:
281         echo Unknown processor type `uname -m` for Linux
282         breaksw
283     endsw
285     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/hpmpi
286     breaksw
288 case MPI:
289     setenv MPI_ARCH_PATH /opt/mpi
290     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
291     breaksw
293 case FJMPI:
294     setenv MPI_ARCH_PATH /opt/FJSVmpi2
295     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
296     _foamAddPath    $MPI_ARCH_PATH/bin
297     _foamAddLib     $MPI_ARCH_PATH/lib/sparcv9
298     _foamAddLib     /opt/FSUNf90/lib/sparcv9
299     _foamAddLib     /opt/FJSVpnidt/lib
300     breaksw
302 case QSMPI:
303     setenv MPI_ARCH_PATH /usr/lib/mpi
304     setenv FOAM_MPI_LIBBIN FOAM_LIBBIN/qsmpi
306     _foamAddPath    $MPI_ARCH_PATH/bin
307     _foamAddLib     $MPI_ARCH_PATH/lib
309     breaksw
311 default:
312     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
313     breaksw
314 endsw
316 _foamAddLib $FOAM_MPI_LIBBIN
319 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
320 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
321 if ( ! $?minBufferSize ) set minBufferSize=20000000
323 if ( $?MPI_BUFFER_SIZE ) then
324     if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
325         setenv MPI_BUFFER_SIZE $minBufferSize
326     endif
327 else
328     setenv MPI_BUFFER_SIZE $minBufferSize
329 endif
332 # Enable the hoard memory allocator if available
333 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
334 #if ( -f $FOAM_LIBBIN/libhoard.so ) then
335 #    setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
336 #endif
339 # cleanup environment:
340 # ~~~~~~~~~~~~~~~~~~~~
341 unalias _foamAddPath _foamAddLib _foamAddMan
342 unset compilerInstall minBufferSize
344 # ----------------------------------------------------------------- end-of-file