ThirdParty packages: changing metis-5.0pre2 download URL
[OpenFOAM-1.6-ext.git] / etc / settings.csh
blobbdb4de2b61b3ef21ba61a3c48044e7f10c45c7c9
1 #----------------------------------*-sh-*--------------------------------------
2 # =========                 |
3 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4 #  \\    /   O peration     |
5 #   \\  /    A nd           | Copyright held by original author
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
46 set path=($WM_DIR $path)
48 #setenv WM_DECOMP_INC -DCELL_DECOMP
49 #setenv WM_DECOMP_LIBS "-lcellDecompFiniteElement -lcellDecompositionMotionSolver"
50 setenv WM_DECOMP_INC -DFACE_DECOMP
51 setenv WM_DECOMP_LIBS "-lfaceDecompFiniteElement -lfaceDecompositionMotionSolver"
53 # base configuration
54 setenv FOAM_APP $WM_PROJECT_DIR/applications
55 setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
56 setenv FOAM_LIB $WM_PROJECT_DIR/lib
57 setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
58 setenv FOAM_SRC $WM_PROJECT_DIR/src
60 # shared site configuration - similar naming convention as ~OpenFOAM expansion
61 setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
62 setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
64 # user configuration
65 setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
66 setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
68 # convenience
69 setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
70 setenv FOAM_UTILITIES $FOAM_APP/utilities
71 setenv FOAM_SOLVERS $FOAM_APP/solvers
72 setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
74 # add OpenFOAM scripts and wmake to the path
75 set path=($WM_DIR $WM_PROJECT_DIR/bin $path)
77 _foamAddPath $FOAM_APPBIN
78 _foamAddPath $FOAM_SITE_APPBIN
79 _foamAddPath $FOAM_USER_APPBIN
80  # Make sure to pick up dummy versions of external libraries last
81 _foamAddLib  $FOAM_LIBBIN/dummy
82 _foamAddLib  $FOAM_LIBBIN
83 _foamAddLib  $FOAM_SITE_LIBBIN
84 _foamAddLib  $FOAM_USER_LIBBIN
87 # Select compiler installation
88 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89 # compilerInstall = OpenFOAM | System
90 #set compilerInstall=OpenFOAM
91 #set compilerInstall=System
92 if ( ! $?compilerInstall ) then
93     setenv compilerInstall System
94 endif
96 switch ("$compilerInstall")
97 case OpenFOAM:
98     switch ("$WM_COMPILER")
99     case Gcc:
100         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
101         _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
102         _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
103     breaksw
104     case Gcc44:
105         _foamSource  $WM_THIRD_PARTY_DIR/packages/mpfr-3.0.1/platforms/$WM_OPTIONS/etc/mpfr-3.0.1.csh
106         _foamSource  $WM_THIRD_PARTY_DIR/packages/gmp-5.0.1/platforms/$WM_OPTIONS/etc/gmp-5.0.1.csh
107         _foamSource  $WM_THIRD_PARTY_DIR/packages/gcc-4.4.5/platforms/$WM_OPTIONS/etc/gcc-4.4.5.csh
108     breaksw
109     case Gcc43:
110         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
111         _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
112         _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
113     breaksw
114     case Gcc42:
115         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
116     breaksw
117     endsw
119     # Check that the compiler directory can be found
120     if ( ! -d "$WM_COMPILER_DIR" ) then
121         echo
122         echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
123         echo "    Cannot find $WM_COMPILER_DIR installation."
124         echo "    Please install this compiler version or if you wish to use the system compiler,"
125         echo "    change the 'compilerInstall' setting to 'System' in this file"
126         echo
127     endif
129     _foamAddPath ${WM_COMPILER_DIR}/bin
130     _foamAddLib  ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}
131     _foamAddLib  ${WM_COMPILER_DIR}/lib
133     breaksw
134 endsw
137 switch ("$WM_COMPILER")
138 case Gcc*:
139     setenv WM_CC 'gcc'
140     setenv WM_CXX 'g++'
141     breaksw
142 case Icc:
143     setenv WM_CC 'icc'
144     setenv WM_CXX 'icpc'
145     breaksw
146 endsw
148 # Communications library
149 # ~~~~~~~~~~~~~~~~~~~~~~
151 unset MPI_ARCH_PATH
153 set mpi_version=unknown
155 switch ("$WM_MPLIB")
156 case OPENMPI:
157     if (-d $WM_THIRD_PARTY_DIR/packages/openmpi-1.4.3 ) then
158         set mpi_version=openmpi-1.4.3
160         if ($?FOAM_VERBOSE && $?prompt) then
161             echo "Using openmpi-1.4.3 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
162         endif
163         _foamSource  $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh
165     else if (-d $WM_THIRD_PARTY_DIR/packages/openmpi-1.5 ) then
166         set mpi_version=openmpi-1.5
168         if ($?FOAM_VERBOSE && $?prompt) then
169             echo "Using openmpi-1.5 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
170         endif
171         _foamSource  $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh
172     endif
174     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
175     unset mpi_version
176     breaksw
178 case SYSTEMOPENMPI:
179     set mpi_version=openmpi-system
181     # make sure not the "old" mpi is used 
182     # Not sure if this is necessary anymore.
183     # export OPAL_PREFIX=
185     # Make sure OPENMPI_BIN_DIR is set and valid
186     if ($?OPENMPI_BIN_DIR != 0 ) then 
187         if (-d "${OPENMPI_BIN_DIR}" ) then
188             # User defined value specified for OPENMPI_BIN_DIR
189             #
190             # WARNING:
191             #          We assume this path specified by $OPENMPI_BIN_DIR is valid
192             #          We assume the command mpicc is located somewhere under this path
193             #          We assume the file mpi.h is located somewhere under this path
194             #
195             #          Otherwise, please double check your openmpi installation, you are
196             #          probably missing the openmpi runtime and/or development packages
197             #          available for your system.
198             #
199             _foamAddPath $OPENMPI_BIN_DIR
200          endif
201     else
202         # Here, we assume your environment is already set for running
203         # and developping with openmpi.
204         #
205         # Initialize OPENMPI_BIN_DIR using the path to mpicc
206         set mpicc_cmd=`which mpicc`
207         setenv OPENMPI_BIN_DIR `dirname $mpicc_cmd`
208         unset mpicc_cmd
209     endif
211     # Make sure OPENMPI_LIB_DIR is set
212     if ( $?OPENMPI_LIB_DIR == 0 ) then
213         # Initialize OPENMPI_LIB_DIR using the path to mpicc 
214         setenv OPENMPI_LIB_DIR "`mpicc --showme:libdirs`"
215     endif
217     # Make sure the dynamic libraries are accessible
218     if( $?OPENMPI_LIB_DIR != 0 ) then
219         _foamAddLib $OPENMPI_LIB_DIR
220     endif
222     setenv MPI_HOME `dirname $OPENMPI_BIN_DIR`
223     setenv MPI_ARCH_PATH $MPI_HOME
224     setenv OPAL_PREFIX $MPI_ARCH_PATH
226     # We initialize the rest of the environment using mpicc --showme:
227     if ($?OPENMPI_INCLUDE_DIR == 0) then
228         setenv OPENMPI_INCLUDE_DIR "`mpicc --showme:incdirs`"
229     endif
231     if (${?OPENMPI_COMPILE_FLAGS} == 0) then
232         setenv OPENMPI_COMPILE_FLAGS "`mpicc --showme:compile`"
233     endif
235     if (${?OPENMPI_COMPILE_FLAGS} == 0) then
236         setenv OPENMPI_COMPILE_FLAGS "`mpicc --showme:compile`"
237     endif
239     if (${?OPENMPI_LINK_FLAGS} == 0) then
240         setenv OPENMPI_LINK_FLAGS "`mpicc --showme:link`"
241     endif
243     #
244     # WARNING: We assume the file mpi.h will be available under the directories identified
245     #          by the variable $OPENMPI_INCLUDE_DIR. Otherwise, please double check your
246     #          system openmpi installation.
248     # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
249     setenv PINC "$OPENMPI_COMPILE_FLAGS"
250     setenv PLIBS "$OPENMPI_LINK_FLAGS"
252     # No longer needed, but we keep this as a reference, just in case...
253     #libDir `echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
254     #_foamAddLib $libDir
256     if ($?FOAM_VERBOSE && $?prompt) then
257         echo "Using system installed OpenMPI:"
258         echo "    OPENMPI_BIN_DIR       : $OPENMPI_BIN_DIR"
259         echo "    OPENMPI_LIB_DIR       : $OPENMPI_LIB_DIR"
260         echo "    OPENMPI_INCLUDE_DIR   : $OPENMPI_INCLUDE_DIR"
261         echo "    OPENMPI_COMPILE_FLAGS : $OPENMPI_COMPILE_FLAGS"
262         echo "    OPENMPI_LINK_FLAGS    : $OPENMPI_LINK_FLAGS"
263         echo ""
264         echo "    MPI_HOME              : $MPI_HOME"
265         echo "    MPI_ARCH_PATH         : $MPI_ARCH_PATH"
266         echo "    OPAL_PREFIX           : $OPAL_PREFIX"
267         echo "    PINC                  : $PINC"
268         echo "    PLIBS                 : $PLIBS"
269     endif
271     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
272     unset mpi_version
273     breaksw
275 case MPICH:
276     set mpi_version=mpich-1.2.4
277     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
278     setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
279     setenv MPICH_ROOT $MPI_ARCH_PATH
281     _foamAddPath $MPI_ARCH_PATH/bin
282     _foamAddLib  $MPI_ARCH_PATH/lib
284     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
285     unset mpi_version
286     breaksw
288 case MPICH-GM:
289     setenv MPI_ARCH_PATH /opt/mpi
290     setenv MPICH_PATH $MPI_ARCH_PATH
291     setenv MPICH_ROOT $MPI_ARCH_PATH
292     setenv GM_LIB_PATH /opt/gm/lib64
294     _foamAddPath $MPI_ARCH_PATH/bin
295     _foamAddLib  $MPI_ARCH_PATH/lib
296     _foamAddLib  $GM_LIB_PATH
298     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
299     breaksw
301 case HPMPI:
302     setenv MPI_HOME /opt/hpmpi
303     setenv MPI_ARCH_PATH $MPI_HOME
304     setenv MPICH_ROOT=$MPI_ARCH_PATH
306     _foamAddPath $MPI_ARCH_PATH/bin
308     switch (`uname -m`)
309     case i686:
310         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
311         breaksw
312     case x86_64:
313         _foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
314         breaksw
315     case ia64:
316         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
317         breaksw
318     default:
319         echo Unknown processor type `uname -m` for Linux
320         breaksw
321     endsw
323     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/hpmpi
324     breaksw
326 case GAMMA:
327     setenv MPI_ARCH_PATH /usr
328     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/gamma
329     breaksw
331 case MPI:
332     setenv MPI_ARCH_PATH /opt/mpi
333     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
334     breaksw
336 case FJMPI:
337     setenv MPI_ARCH_PATH /opt/FJSVmpi2
338     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
339     _foamAddPath $MPI_ARCH_PATH/bin
340     _foamAddLib  $MPI_ARCH_PATH/lib/sparcv9
341     _foamAddLib  /opt/FSUNf90/lib/sparcv9
342     _foamAddLib  /opt/FJSVpnidt/lib
343     breaksw
345 case QSMPI:
346     setenv MPI_ARCH_PATH /usr/lib/mpi
347     setenv FOAM_MPI_LIBBIN FOAM_LIBBIN/qsmpi
349     _foamAddPath $MPI_ARCH_PATH/bin
350     _foamAddLib $MPI_ARCH_PATH/lib
352     breaksw
354 default:
355     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
356     breaksw
357 endsw
359 _foamAddLib $FOAM_MPI_LIBBIN
362 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
363 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
364 set minBufferSize=20000000
366 if ( $?MPI_BUFFER_SIZE ) then
367     if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
368         setenv MPI_BUFFER_SIZE $minBufferSize
369     endif
370 else
371     setenv MPI_BUFFER_SIZE $minBufferSize
372 endif
375 # CGAL library if available
376 # ~~~~~~~~~~~~~~~~~~~~~~~~~
377 if ( $?CGAL_LIB_DIR ) then
378     _foamAddLib $CGAL_LIB_DIR
379 endif
381 # Mesquite library if available
382 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
383 if ( $?MESQUITE_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2 ) then
384     _foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS/etc/mesquite-2.1.2.csh
385 endif
387 # Metis library if available
388 # ~~~~~~~~~~~~~~~~~~~~~~~~~~
389 if ( $?METIS_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/metis-5.0pre2 ) then
390     _foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.0pre2/platforms/$WM_OPTIONS/etc/metis-5.0pre2.csh
391 endif
393 # ParMetis library if available
394 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
395 if ( $?PARMETIS_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/ParMetis-3.1.1 ) then
396     _foamSource $WM_THIRD_PARTY_DIR/packages/ParMetis-3.1.1/platforms/$WM_OPTIONS/etc/ParMetis-3.1.1.csh
397 endif
399 # ParMGridGen library if available
400 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
401 if ( $?PARMGRIDGEN_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/ParMGridGen-1.0 ) then
402     _foamSource $WM_THIRD_PARTY_DIR/packages/ParMGridGen-1.0/platforms/$WM_OPTIONS/etc/ParMGridGen-1.0.csh
403 endif
405 # Load Libccmio library 
406 # ~~~~~~~~~~~~~~~~~~~~~
407 if ( $?LIBCCMIO_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/libccmio-2.6.1 ) then
408     _foamSource $WM_THIRD_PARTY_DIR/packages/libccmio-2.6.1/platforms/$WM_OPTIONS/etc/libccmio-2.6.1.csh
409 endif
412 # Scotch library if available
413 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~
414 if ( $?SCOTCH_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/scotch-5.1.10b ) then
415     _foamSource $WM_THIRD_PARTY_DIR/packages/scotch-5.1.10b/platforms/$WM_OPTIONS/etc/scotch-5.1.10b.csh
416 endif
418 # Switch on the hoard memory allocator if available
419 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
420 #if ( -f $FOAM_LIBBIN/libhoard.so ) then
421 #    setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
422 #endif
424 # Third party packages
426 # cmake
427 # ~~~~~
428 if ( $?CMAKE_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/cmake-2.8.3 ) then
429     _foamSource $WM_THIRD_PARTY_DIR/packages/cmake-2.8.3/platforms/$WM_OPTIONS/etc/cmake-2.8.3.csh
430 endif
432 # Python
433 # ~~~~~
434 if ( $?PYTHON_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/Python-2.7 ) then
435     _foamSource $WM_THIRD_PARTY_DIR/packages/Python-2.7/platforms/$WM_OPTIONS/etc/Python-2.7.csh
436 endif
438 # QT
439 # ~~~~~
440 if ( $?QT_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/qt-everywhere-opensource-src-4.7.0 )then
441     _foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.0/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-4.7.0.csh
442 endif
444 # PARAVIEW
445 # ~~~~~
446 if ( $?PARAVIEW_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-3.8.1 ) then
447     _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.8.1/platforms/$WM_OPTIONS/etc/ParaView-3.8.1.csh
448 endif
450 if ( $WM_ARCH == "darwinIntel" || $WM_ARCH == "darwinIntel64" ) then
451     setenv DYLD_LIBRARY_PATH ${LD_LIBRARY_PATH}
452 endif
454 # cleanup environment:
455 # ~~~~~~~~~~~~~~~~~~~~
456 unalias _foamAddPath
457 unalias _foamAddLib
458 unset minBufferSize
460 # -----------------------------------------------------------------------------