Merge branch 'bugfix/partialOveralpGGI'
[foam-extend-4.0.git] / etc / settings.csh
blob7ef3dce6ed58f401310572201e0d97737e272013
1 #----------------------------------*-sh-*--------------------------------------
2 # =========                 |
3 # \\      /  F ield         | foam-extend: Open Source CFD
4 #  \\    /   O peration     | Version:     4.0
5 #   \\  /    A nd           | Web:         http://www.foam-extend.org
6 #    \\/     M anipulation  | For copyright notice see file Copyright
7 #------------------------------------------------------------------------------
8 # License
9 #     This file is part of foam-extend.
11 #     foam-extend 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 3 of the License, or (at your
14 #     option) any later version.
16 #     foam-extend is distributed in the hope that it will be useful, but
17 #     WITHOUT ANY WARRANTY; without even the implied warranty of
18 #     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
19 #     General Public License for more details.
21 #     You should have received a copy of the GNU General Public License
22 #     along with foam-extend.  If not, see <http://www.gnu.org/licenses/>.
24 # Script
25 #     etc/settings.csh
27 # Description
28 #     Startup file for FOAM
29 #     Sourced from FOAM-??/etc/cshrc
31 #------------------------------------------------------------------------------
33 # prefix to PATH
34 alias _foamAddPath 'set path=(\!* $path)'
35 # prefix to LD_LIBRARY_PATH
36 alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
38 # location of the jobControl directory
39 setenv FOAM_JOB_DIR $WM_PROJECT_INST_DIR/jobControl
41 # wmake configuration
42 setenv WM_DIR $WM_PROJECT_DIR/wmake
43 setenv WM_LINK_LANGUAGE c++
44 setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
45 set path=($WM_DIR $path)
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 ~FOAM expansion
55 setenv FOAM_SITE_DIR $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION
56 setenv FOAM_SITE_APPBIN $FOAM_SITE_DIR/bin/$WM_OPTIONS
57 setenv FOAM_SITE_LIBBIN $FOAM_SITE_DIR/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
68 setenv FOAM_TEST_HARNESS_DIR $WM_PROJECT_DIR/testHarness/foam-extend/$WM_PROJECT_VERSION
70 # add FOAM scripts and wmake to the path
71 set path=($WM_DIR $WM_PROJECT_DIR/bin $path)
73 _foamAddPath $FOAM_APPBIN
74 _foamAddPath $FOAM_SITE_APPBIN
75 _foamAddPath $FOAM_USER_APPBIN
76  # Make sure to pick up dummy versions of external libraries last
77 _foamAddLib  $FOAM_LIBBIN/dummy
78 _foamAddLib  $FOAM_LIBBIN
79 _foamAddLib  $FOAM_SITE_LIBBIN
80 _foamAddLib  $FOAM_USER_LIBBIN
83 # Select compiler installation
84 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85 # compilerInstall = FOAM | System
86 #set compilerInstall=FOAM
87 #set compilerInstall=System
88 if ( ! $?compilerInstall ) then
89     setenv compilerInstall System
90 endif
92 switch ("$compilerInstall")
93 case FOAM:
94     switch ("$WM_COMPILER")
95     case Gcc:
96         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.6.4/platforms/$WM_OPTIONS
97         _foamSource $WM_THIRD_PARTY_DIR/packages/gmp-5.1.2/platforms/$WM_OPTIONS/etc/gmp-5.1.2.csh
98         _foamSource $WM_THIRD_PARTY_DIR/packages/mpfr-3.1.2/platforms/$WM_OPTIONS/etc/mpfr-3.1.2.csh
99         _foamSource $WM_THIRD_PARTY_DIR/packages/mpc-1.0.1/platforms/$WM_OPTIONS/etc/mpc-1.0.1.csh
100         _foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.6.4/platforms/$WM_OPTIONS/etc/gcc-4.6.4.csh
101     breaksw
102     case Gcc49:
103         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.9.2/platforms/$WM_OPTIONS
104         _foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.9.2/platforms/$WM_OPTIONS/etc/gcc-4.9.2.csh
105     breaksw
106     case Gcc48:
107         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.8.4/platforms/$WM_OPTIONS
108         _foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.8.4/platforms/$WM_OPTIONS/etc/gcc-4.8.4.csh
109     breaksw
110     case Gcc47:
111         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.7.4/platforms/$WM_OPTIONS
112         _foamSource $WM_THIRD_PARTY_DIR/packages/gmp-5.1.2/platforms/$WM_OPTIONS/etc/gmp-5.1.2.csh
113         _foamSource $WM_THIRD_PARTY_DIR/packages/mpfr-3.1.2/platforms/$WM_OPTIONS/etc/mpfr-3.1.2.csh
114         _foamSource $WM_THIRD_PARTY_DIR/packages/mpc-1.0.1/platforms/$WM_OPTIONS/etc/mpc-1.0.1.csh
115         _foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.7.4/platforms/$WM_OPTIONS/etc/gcc-4.7.4.csh
116     breaksw
117     case Gcc45:
118         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.5.1/platforms/$WM_OPTIONS
119         _foamSource $WM_THIRD_PARTY_DIR/packages/gmp-5.0.1/platforms/$WM_OPTIONS/etc/gmp-5.0.1.csh
120         _foamSource $WM_THIRD_PARTY_DIR/packages/mpfr-3.0.1/platforms/$WM_OPTIONS/etc/mpfr-3.0.1.csh
121         _foamSource $WM_THIRD_PARTY_DIR/packages/mpc-0.8.2/platforms/$WM_OPTIONS/etc/mpc-0.8.2.csh
122         _foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.5.1/platforms/$WM_OPTIONS/etc/gcc-4.5.1.csh
123     breaksw
124     case Gcc44:
125         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.4.5/platforms/$WM_OPTIONS
126         _foamSource $WM_THIRD_PARTY_DIR/packages/gmp-5.0.1/platforms/$WM_OPTIONS/etc/gmp-5.0.1.csh
127         _foamSource $WM_THIRD_PARTY_DIR/packages/mpfr-3.0.1/platforms/$WM_OPTIONS/etc/mpfr-3.0.1.csh
128         _foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.4.5/platforms/$WM_OPTIONS/etc/gcc-4.4.5.csh
129     breaksw
130     endsw
132     # Check that the compiler directory can be found
133     if ( ! -d "$WM_COMPILER_DIR" ) then
134         echo
135         echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
136         echo "    Cannot find $WM_COMPILER_DIR installation."
137         echo "    Please install this compiler version or if you wish to use the system compiler,"
138         echo "    change the 'compilerInstall' setting to 'System' in this file"
139         echo
140     endif
142     _foamAddPath ${WM_COMPILER_DIR}/bin
143     _foamAddLib  ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}
144     _foamAddLib  ${WM_COMPILER_DIR}/lib
146     breaksw
147 endsw
150 switch ("$WM_COMPILER")
151 case Gcc*:
152     setenv WM_CC 'gcc'
153     setenv WM_CXX 'g++'
154     breaksw
155 case Icc:
156     setenv WM_CC 'icc'
157     setenv WM_CXX 'icpc'
158     breaksw
159 endsw
161 # Communications library
162 # ~~~~~~~~~~~~~~~~~~~~~~
164 unset MPI_ARCH_PATH
166 set mpi_version=unknown
168 switch ("$WM_MPLIB")
169 case OPENMPI:
170     if ($?WM_THIRD_PARTY_USE_OPENMPI_188 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-1.8.8/platforms/$WM_OPTIONS ) then
171         set mpi_version=openmpi-1.8.8
173         if ($?FOAM_VERBOSE && $?prompt) then
174             echo "Using openmpi-1.8.8 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
175         endif
176         _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh
178     else if ($?WM_THIRD_PARTY_USE_OPENMPI_165 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-1.6.5/platforms/$WM_OPTIONS ) then
179         set mpi_version=openmpi-1.6.5
181         if ($?FOAM_VERBOSE && $?prompt) then
182             echo "Using openmpi-1.6.5 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
183         endif
184         _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh
186     else if ($?WM_THIRD_PARTY_USE_OPENMPI_143 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-1.4.3/platforms/$WM_OPTIONS ) then
187         set mpi_version=openmpi-1.4.3
189         if ($?FOAM_VERBOSE && $?prompt) then
190             echo "Using openmpi-1.4.3 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
191         endif
192         _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh
194     else if ($?WM_THIRD_PARTY_USE_OPENMPI_143 != 0 && -d $WM_THIRD_PARTY_DIR/packages/openmpi-1.5/platforms/$WM_OPTIONS ) then
195         set mpi_version=openmpi-1.5
197         if ($?FOAM_VERBOSE && $?prompt) then
198             echo "Using openmpi-1.5 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
199         endif
200         _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh
201     endif
203     unset mpi_version
204     breaksw
206 case SYSTEMOPENMPI:
207     set mpi_version=openmpi-system
209     # make sure not the "old" mpi is used
210     # Not sure if this is necessary anymore.
211     # export OPAL_PREFIX=
213     # Make sure OPENMPI_BIN_DIR is set and valid
214     if ($?OPENMPI_BIN_DIR != 0 ) then
215         if (-d "${OPENMPI_BIN_DIR}" ) then
216         # User defined value specified for OPENMPI_BIN_DIR
217         #
218         # WARNING:
219         #          We assume this path specified by $OPENMPI_BIN_DIR is valid
220         #          We assume the command mpicc is located somewhere under this path
221         #          We assume the file mpi.h is located somewhere under this path
222         #
223             #          Otherwise, please double check your openmpi installation, you are
224         #          probably missing the openmpi runtime and/or development packages
225         #          available for your system.
226         #
227         _foamAddPath $OPENMPI_BIN_DIR
228          endif
229     else
230     # Here, we assume your environment is already set for running
231     # and developing with openmpi.
232     #
233     # Initialize OPENMPI_BIN_DIR using the path to mpicc
234         set mpicc_cmd=`which mpicc`
235         setenv OPENMPI_BIN_DIR `dirname $mpicc_cmd`
236         unset mpicc_cmd
237     endif
239     # Make sure OPENMPI_LIB_DIR is set
240     if ( $?OPENMPI_LIB_DIR == 0 ) then
241         # Initialize OPENMPI_LIB_DIR using the path to mpicc
242         setenv OPENMPI_LIB_DIR "`mpicc --showme:libdirs`"
243     endif
245     # Make sure the dynamic libraries are accessible
246     if( $?OPENMPI_LIB_DIR != 0 ) then
247         _foamAddLib $OPENMPI_LIB_DIR
248     endif
250     setenv MPI_HOME `dirname $OPENMPI_BIN_DIR`
251     setenv MPI_ARCH_PATH $MPI_HOME
252     setenv OPAL_PREFIX $MPI_ARCH_PATH
254     # We initialize the rest of the environment using mpicc --showme:
255     if ($?OPENMPI_INCLUDE_DIR == 0) then
256         setenv OPENMPI_INCLUDE_DIR "`mpicc --showme:incdirs`"
257     endif
259     if (${?OPENMPI_COMPILE_FLAGS} == 0) then
260         setenv OPENMPI_COMPILE_FLAGS "`mpicc --showme:compile`"
261     endif
263     if (${?OPENMPI_COMPILE_FLAGS} == 0) then
264         setenv OPENMPI_COMPILE_FLAGS "`mpicc --showme:compile`"
265     endif
267     if (${?OPENMPI_LINK_FLAGS} == 0) then
268         setenv OPENMPI_LINK_FLAGS "`mpicc --showme:link`"
269     endif
271     #
272     # WARNING: We assume the file mpi.h will be available under the directories identified
273     #          by the variable $OPENMPI_INCLUDE_DIR. Otherwise, please double check your
274     #          system openmpi installation.
276     # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
277     setenv PINC "$OPENMPI_COMPILE_FLAGS"
278     setenv PLIBS "$OPENMPI_LINK_FLAGS"
280     # No longer needed, but we keep this as a reference, just in case...
281     #libDir `echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
282     #_foamAddLib $libDir
284     if ($?FOAM_VERBOSE && $?prompt) then
285         echo "Using system installed OpenMPI:"
286         echo "    OPENMPI_BIN_DIR       : $OPENMPI_BIN_DIR"
287         echo "    OPENMPI_LIB_DIR       : $OPENMPI_LIB_DIR"
288         echo "    OPENMPI_INCLUDE_DIR   : $OPENMPI_INCLUDE_DIR"
289         echo "    OPENMPI_COMPILE_FLAGS : $OPENMPI_COMPILE_FLAGS"
290         echo "    OPENMPI_LINK_FLAGS    : $OPENMPI_LINK_FLAGS"
291         echo ""
292         echo "    MPI_HOME              : $MPI_HOME"
293         echo "    MPI_ARCH_PATH         : $MPI_ARCH_PATH"
294         echo "    OPAL_PREFIX           : $OPAL_PREFIX"
295         echo "    PINC                  : $PINC"
296         echo "    PLIBS                 : $PLIBS"
297     endif
299     unset mpi_version
300     breaksw
302 case MVAPICH2:
303     set mpi_version=mvapich2
305     if ($?MVAPICH2_BIN_DIR != 0) then
306         if (-d "${MVAPICH2_BIN_DIR}" ) then
307         _foamAddPath $MVAPICH2_BIN_DIR
308         endif
309     else
310         set mpicc_cmd=`which mpicc`
311         setenv MVAPICH2_BIN_DIR `dirname $mpicc_cmd`
312         unset mpicc_cmd
313     endif
315     setenv MPI_HOME `dirname $MVAPICH2_BIN_DIR`
316     setenv MPI_ARCH_PATH $MPI_HOME
318     setenv  PINC "`mpicc -show -cc= -nativelinking`"
319     setenv  PLIBS "`mpicc -show -cc= | sed "s%$PINC%%"`"
321     if ($?FOAM_VERBOSE && $?prompt) then
322         echo "  Environment variables defined for MVAPICH2:"
323         echo "    MPI_ARCH_PATH         : $MPI_ARCH_PATH"
324         echo "    PINC                  : $PINC"
325         echo "    PLIBS                 : $PLIBS"
326     endif
328     unset mpi_version
329     breaksw
331 case MPICH:
332     set mpi_version=mpich-1.2.4
333     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
334     setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
335     setenv MPICH_ROOT $MPI_ARCH_PATH
337     _foamAddPath $MPI_ARCH_PATH/bin
338     _foamAddLib  $MPI_ARCH_PATH/lib
340     unset mpi_version
341     breaksw
343 case MPICH-GM:
344     setenv MPI_ARCH_PATH /opt/mpi
345     setenv MPICH_PATH $MPI_ARCH_PATH
346     setenv MPICH_ROOT $MPI_ARCH_PATH
347     setenv GM_LIB_PATH /opt/gm/lib64
349     _foamAddPath $MPI_ARCH_PATH/bin
350     _foamAddLib  $MPI_ARCH_PATH/lib
351     _foamAddLib  $GM_LIB_PATH
352     breaksw
354 case HPMPI:
355     setenv MPI_HOME /opt/hpmpi
356     setenv MPI_ARCH_PATH $MPI_HOME
357     setenv MPICH_ROOT=$MPI_ARCH_PATH
359     _foamAddPath $MPI_ARCH_PATH/bin
361     switch (`uname -m`)
362     case i686:
363         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
364         breaksw
365     case x86_64:
366         _foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
367         breaksw
368     case ia64:
369         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
370         breaksw
371     default:
372         echo Unknown processor type `uname -m` for Linux
373         breaksw
374     endsw
375     breaksw
377 case GAMMA:
378     setenv MPI_ARCH_PATH /usr
379     breaksw
381 case MPI:
382     setenv MPI_ARCH_PATH /opt/mpi
383     breaksw
385 case FJMPI:
386     setenv MPI_ARCH_PATH /opt/FJSVmpi2
387     _foamAddPath $MPI_ARCH_PATH/bin
388     _foamAddLib  $MPI_ARCH_PATH/lib/sparcv9
389     _foamAddLib  /opt/FSUNf90/lib/sparcv9
390     _foamAddLib  /opt/FJSVpnidt/lib
391     breaksw
393 case QSMPI:
394     setenv MPI_ARCH_PATH /usr/lib/mpi
395     _foamAddPath $MPI_ARCH_PATH/bin
396     _foamAddLib $MPI_ARCH_PATH/lib
398     breaksw
400 case SGIMPI:
401     if ( ! $?MPI_ROOT) setenv MPI_ROOT /dummy
403     if ( ! -d "$MPI_ROOT" ) then
404         echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
405         echo "    MPI_ROOT not a valid mpt installation directory."
406         echo "    Please set MPI_ROOT to the mpt installation directory."
407         echo "    (usually done by loading the mpt module)"
408         echo "    MPI_ROOT currently set to '$MPI_ROOT'"
409     endif
411     if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then
412         setenv MPI_ROOT ${MPI_ROOT:h}
413     endif
415     setenv FOAM_MPI ${MPI_ROOT:t}
416     setenv MPI_ARCH_PATH $MPI_ROOT
419     if ($?FOAM_VERBOSE && $?prompt) then
420         echo "Using SGI MPT:"
421         echo "    MPI_ROOT : $MPI_ROOT"
422         echo "    FOAM_MPI : $FOAM_MPI"
423     endif
426     _foamAddPath    $MPI_ARCH_PATH/bin
427     _foamAddLib     $MPI_ARCH_PATH/lib
428     breaksw
430 case INTELMPI:
431     if ( ! $?MPI_ROOT) setenv MPI_ROOT /dummy
433     if ( ! -d "$MPI_ROOT" ) then
434         echo "Warning in $WM_PROJECT_DIR/etc/config/settings.csh:"
435         echo "    MPI_ROOT not a valid mpt installation directory."
436         echo "    Please set MPI_ROOT to the mpt installation directory."
437         echo "    (usually done by loading the mpt module)"
438         echo "    MPI_ROOT currently set to '$MPI_ROOT'"
439     endif
441     if ( "${MPI_ROOT:h}/" == $MPI_ROOT ) then
442         setenv MPI_ROOT ${MPI_ROOT:h}
443     endif
445     setenv FOAM_MPI ${MPI_ROOT:t}
446     setenv MPI_ARCH_PATH $MPI_ROOT
449     if ($?FOAM_VERBOSE && $?prompt) then
450         echo "Using INTEL MPT:"
451         echo "    MPI_ROOT : $MPI_ROOT"
452         echo "    FOAM_MPI : $FOAM_MPI"
453     endif
456     _foamAddPath    $MPI_ARCH_PATH/bin64
457     _foamAddLib     $MPI_ARCH_PATH/lib64
458     breaksw
460 default:
461     breaksw
462 endsw
464 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
465 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
466 set minBufferSize=20000000
468 if ( $?MPI_BUFFER_SIZE ) then
469     if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
470         setenv MPI_BUFFER_SIZE $minBufferSize
471     endif
472 else
473     setenv MPI_BUFFER_SIZE $minBufferSize
474 endif
476 # CUDA library
477 # ~~~~~~~~~~~~
478 if ( $?CUDA_SYSTEM == 0 && -e /usr/local/cuda-5.5/bin/nvcc ) then
479     setenv CUDA_DIR /usr/local/cuda-5.5
480     setenv CUDA_BIN_DIR $CUDA_DIR/bin
481     setenv CUDA_LIB_DIR $CUDA_DIR/lib64
482     setenv CUDA_INCLUDE_DIR $CUDA_DIR/include
483     setenv CUDA_ARCH sm_20
484 endif
486 if ( $?CUDA_BIN_DIR ) then
487     _foamAddPath $CUDA_BIN_DIR
488 endif
490 if ( $?CUDA_LIB_DIR ) then
491     _foamAddLib $CUDA_LIB_DIR
492 endif
494 # CGAL library if available
495 # ~~~~~~~~~~~~~~~~~~~~~~~~~
496 if ( $?CGAL_LIB_DIR ) then
497     _foamAddLib $CGAL_LIB_DIR
498 endif
500 # Mesquite library if available
501 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
502 if ( $?MESQUITE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_MESQUITE_212 != 0 && -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS ) then
503     _foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS/etc/mesquite-2.1.2.csh
504 endif
506 # Metis library if available
507 # ~~~~~~~~~~~~~~~~~~~~~~~~~~
508 if ( $?METIS_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_METIS_510 != 0 && -e $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS ) then
509     _foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS/etc/metis-5.1.0.csh
510 endif
512 # ParMetis library if available
513 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
514 if ( $?PARMETIS_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARMETIS_403 != 0 && -e $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS ) then
515     _foamSource $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS/etc/parmetis-4.0.3.csh
516 endif
518 # ParMGridGen library if available
519 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
520 if ( $?PARMGRIDGEN_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARMGRIDGEN_10 != 0 && -e $WM_THIRD_PARTY_DIR/packages/ParMGridGen-1.0/platforms/$WM_OPTIONS ) then
521     _foamSource $WM_THIRD_PARTY_DIR/packages/ParMGridGen-1.0/platforms/$WM_OPTIONS/etc/ParMGridGen-1.0.csh
522 endif
524 # Load Libccmio library
525 # ~~~~~~~~~~~~~~~~~~~~~
526 if ( $?LIBCCMIO_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_LIBCCMIO_261 != 0 && -e $WM_THIRD_PARTY_DIR/packages/libccmio-2.6.1/platforms/$WM_OPTIONS ) then
527     _foamSource $WM_THIRD_PARTY_DIR/packages/libccmio-2.6.1/platforms/$WM_OPTIONS/etc/libccmio-2.6.1.csh
528 endif
531 # Scotch library if available
532 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~
533 if ( $?SCOTCH_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_SCOTCH_604 != 0 && -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.4/platforms/$WM_OPTIONS ) then
534     _foamSource $WM_THIRD_PARTY_DIR/packages/scotch-6.0.4/platforms/$WM_OPTIONS/etc/scotch-6.0.4.csh
535 endif
537 if ( $?SCOTCH_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_SCOTCH_600 != 0 && -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS ) then
538     _foamSource $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS/etc/scotch-6.0.0.csh
539 endif
541 # Switch on the hoard memory allocator if available
542 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
543 #if ( -f $FOAM_LIBBIN/libhoard.so ) then
544 #    setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
545 #endif
547 # Third party packages
549 # cmake
550 # ~~~~~
551 if ( $?CMAKE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_CMAKE_322 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/cmake-3.2.2/platforms/$WM_OPTIONS ) then
552     _foamSource $WM_THIRD_PARTY_DIR/packages/cmake-3.2.2/platforms/$WM_OPTIONS/etc/cmake-3.2.2.csh
553 endif
555 if ( $?CMAKE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_CMAKE_2812 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/cmake-2.8.12/platforms/$WM_OPTIONS ) then
556     _foamSource $WM_THIRD_PARTY_DIR/packages/cmake-2.8.12/platforms/$WM_OPTIONS/etc/cmake-2.8.12.csh
557 endif
559 # m4
560 # ~~~~~
561 if ( $?M4_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_M4_1416 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/m4-1.4.16/platforms/$WM_OPTIONS ) then
562     _foamSource $WM_THIRD_PARTY_DIR/packages/m4-1.4.16/platforms/$WM_OPTIONS/etc/m4-1.4.16.csh
563 endif
565 # bison
566 # ~~~~~
567 if ( $?BISON_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_BISON_27 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/bison-2.7/platforms/$WM_OPTIONS ) then
568     _foamSource $WM_THIRD_PARTY_DIR/packages/bison-2.7/platforms/$WM_OPTIONS/etc/bison-2.7.csh
569 endif
571 # flex
572 # ~~~~~
573 if ( $?FLEX_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_FLEX_2535 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/flex-2.5.35/platforms/$WM_OPTIONS ) then
574     _foamSource $WM_THIRD_PARTY_DIR/packages/flex-2.5.35/platforms/$WM_OPTIONS/etc/flex-2.5.35.csh
575 endif
577 # zoltan
578 # ~~~~~
579 if ( $?ZOLTAN_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_ZOLTAN_35 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/zoltan-3.5/platforms/$WM_OPTIONS ) then
580     _foamSource $WM_THIRD_PARTY_DIR/packages/zoltan-3.5/platforms/$WM_OPTIONS/etc/zoltan-3.5.csh
581 endif
583 # Python
584 # ~~~~~
585 if ( $?PYTHON_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PYTHON_27 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/Python-2.7/platforms/$WM_OPTIONS ) then
586     _foamSource $WM_THIRD_PARTY_DIR/packages/Python-2.7/platforms/$WM_OPTIONS/etc/Python-2.7.csh
587 endif
589 # PyFoam
590 # ~~~~~~
591 if ( $?PYFOAM_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PYFOAM_063 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.6.3/platforms/noarch ) then
592     _foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.3/platforms/noarch/etc/PyFoam-0.6.3.csh
593 endif
594 if ( $?PYFOAM_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PYFOAM_064 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/PyFoam-0.6.4/platforms/noarch ) then
595     _foamSource $WM_THIRD_PARTY_DIR/packages/PyFoam-0.6.4/platforms/noarch/etc/PyFoam-0.6.4.csh
596 endif
598 # hwloc
599 # ~~~~~
600 if ( $?HWLOC_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_HWLOC_1101 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/hwloc-1.10.1/platforms/$WM_OPTIONS ) then
601     _foamSource $WM_THIRD_PARTY_DIR/packages/hwloc-1.10.1/platforms/$WM_OPTIONS/etc/hwloc-1.10.1.csh
602 endif
603 if ( $?HWLOC_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_HWLOC_172 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/hwloc-1.7.2/platforms/$WM_OPTIONS ) then
604     _foamSource $WM_THIRD_PARTY_DIR/packages/hwloc-1.7.2/platforms/$WM_OPTIONS/etc/hwloc-1.7.2.csh
605 endif
607 # QT
608 # ~~~~~
609 if ( $?QT_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_QT_486 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/qt-everywhere-opensource-src-4.8.6/platforms/$WM_OPTIONS )then
610     _foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.8.6/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-4.8.6.csh
611 endif
613 # PARAVIEW
614 # ~~~~~
615 if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_440 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-4.4.0/platforms/$WM_OPTIONS ) then
616     _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-4.4.0/platforms/$WM_OPTIONS/etc/ParaView-4.4.0.csh
617 endif
618 if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_431 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-4.3.1/platforms/$WM_OPTIONS ) then
619     _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-4.3.1/platforms/$WM_OPTIONS/etc/ParaView-4.3.1.csh
620 endif
621 if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_410 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-4.1.0/platforms/$WM_OPTIONS ) then
622     _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-4.1.0/platforms/$WM_OPTIONS/etc/ParaView-4.1.0.csh
623 endif
624 if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_401 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-4.0.1/platforms/$WM_OPTIONS ) then
625     _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-4.0.1/platforms/$WM_OPTIONS/etc/ParaView-4.0.1.csh
626 endif
627 if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_381 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-3.8.1/platforms/$WM_OPTIONS ) then
628     _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.8.1/platforms/$WM_OPTIONS/etc/ParaView-3.8.1.csh
629 endif
630 if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_3141 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-3.14.1/platforms/$WM_OPTIONS ) then
631    _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.14.1/platforms/$WM_OPTIONS/etc/ParaView-3.14.1.csh
632 endif
633 if ( $?PARAVIEW_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARAVIEW_381 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-3.8.1/platforms/$WM_OPTIONS ) then
634     _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.8.1/platforms/$WM_OPTIONS/etc/ParaView-3.8.1.csh
635 endif
638 # llvm
639 # ~~~~~
640 if ( $?LLVM_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_LLVM_360 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/llvm-3.6.0/platforms/$WM_OPTIONS ) then
641     _foamSource $WM_THIRD_PARTY_DIR/packages/llvm-3.6.0/platforms/$WM_OPTIONS/etc/llvm-3.6.0.csh
642 endif
644 # mesa
645 # ~~~~~
646 if ( $?MESA_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_MESA_GIT != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/mesa-git/platforms/$WM_OPTIONS ) then
647     _foamSource $WM_THIRD_PARTY_DIR/packages/mesa-git/platforms/$WM_OPTIONS/etc/mesa-git.csh
648 endif
651 if ( $WM_ARCH == "darwinIntel" || $WM_ARCH == "darwinIntel64" ) then
652     setenv DYLD_LIBRARY_PATH ${LD_LIBRARY_PATH}
653 endif
655 # cleanup environment:
656 # ~~~~~~~~~~~~~~~~~~~~
657 unalias _foamAddPath
658 unalias _foamAddLib
659 unset minBufferSize
661 # -----------------------------------------------------------------------------