1 #----------------------------------*-sh-*--------------------------------------
3 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / A nd | Copyright held by original author
7 #------------------------------------------------------------------------------
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
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
29 # Startup file for OpenFOAM
30 # Sourced from OpenFOAM-??/etc/cshrc
32 #------------------------------------------------------------------------------
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
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"
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
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
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
96 switch ("$compilerInstall")
98 switch ("$WM_COMPILER")
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
105 setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.5.1/platforms/$WM_OPTIONS
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/mpfr-3.0.1/platforms/$WM_OPTIONS/etc/mpfr-3.0.1.csh
108 _foamSource $WM_THIRD_PARTY_DIR/packages/mpc-0.8.2/platforms/$WM_OPTIONS/etc/mpc-0.8.2.csh
109 _foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.5.1/platforms/$WM_OPTIONS/etc/gcc-4.5.1.csh
112 _foamSource $WM_THIRD_PARTY_DIR/packages/mpfr-3.0.1/platforms/$WM_OPTIONS/etc/mpfr-3.0.1.csh
113 _foamSource $WM_THIRD_PARTY_DIR/packages/gmp-5.0.1/platforms/$WM_OPTIONS/etc/gmp-5.0.1.csh
114 _foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.4.5/platforms/$WM_OPTIONS/etc/gcc-4.4.5.csh
117 setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
118 _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
119 _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
122 setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
126 # Check that the compiler directory can be found
127 if ( ! -d "$WM_COMPILER_DIR" ) then
129 echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
130 echo " Cannot find $WM_COMPILER_DIR installation."
131 echo " Please install this compiler version or if you wish to use the system compiler,"
132 echo " change the 'compilerInstall' setting to 'System' in this file"
136 _foamAddPath ${WM_COMPILER_DIR}/bin
137 _foamAddLib ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}
138 _foamAddLib ${WM_COMPILER_DIR}/lib
144 switch ("$WM_COMPILER")
155 # Communications library
156 # ~~~~~~~~~~~~~~~~~~~~~~
160 set mpi_version=unknown
164 if (-d $WM_THIRD_PARTY_DIR/packages/openmpi-1.4.3/platforms/$WM_OPTIONS ) then
165 set mpi_version=openmpi-1.4.3
167 if ($?FOAM_VERBOSE && $?prompt) then
168 echo "Using openmpi-1.4.3 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
170 _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh
172 else if (-d $WM_THIRD_PARTY_DIR/packages/openmpi-1.5/platforms/$WM_OPTIONS ) then
173 set mpi_version=openmpi-1.5
175 if ($?FOAM_VERBOSE && $?prompt) then
176 echo "Using openmpi-1.5 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
178 _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh
181 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
186 set mpi_version=openmpi-system
188 # make sure not the "old" mpi is used
189 # Not sure if this is necessary anymore.
190 # export OPAL_PREFIX=
192 # Make sure OPENMPI_BIN_DIR is set and valid
193 if ($?OPENMPI_BIN_DIR != 0 ) then
194 if (-d "${OPENMPI_BIN_DIR}" ) then
195 # User defined value specified for OPENMPI_BIN_DIR
198 # We assume this path specified by $OPENMPI_BIN_DIR is valid
199 # We assume the command mpicc is located somewhere under this path
200 # We assume the file mpi.h is located somewhere under this path
202 # Otherwise, please double check your openmpi installation, you are
203 # probably missing the openmpi runtime and/or development packages
204 # available for your system.
206 _foamAddPath $OPENMPI_BIN_DIR
209 # Here, we assume your environment is already set for running
210 # and developping with openmpi.
212 # Initialize OPENMPI_BIN_DIR using the path to mpicc
213 set mpicc_cmd=`which mpicc`
214 setenv OPENMPI_BIN_DIR `dirname $mpicc_cmd`
218 # Make sure OPENMPI_LIB_DIR is set
219 if ( $?OPENMPI_LIB_DIR == 0 ) then
220 # Initialize OPENMPI_LIB_DIR using the path to mpicc
221 setenv OPENMPI_LIB_DIR "`mpicc --showme:libdirs`"
224 # Make sure the dynamic libraries are accessible
225 if( $?OPENMPI_LIB_DIR != 0 ) then
226 _foamAddLib $OPENMPI_LIB_DIR
229 setenv MPI_HOME `dirname $OPENMPI_BIN_DIR`
230 setenv MPI_ARCH_PATH $MPI_HOME
231 setenv OPAL_PREFIX $MPI_ARCH_PATH
233 # We initialize the rest of the environment using mpicc --showme:
234 if ($?OPENMPI_INCLUDE_DIR == 0) then
235 setenv OPENMPI_INCLUDE_DIR "`mpicc --showme:incdirs`"
238 if (${?OPENMPI_COMPILE_FLAGS} == 0) then
239 setenv OPENMPI_COMPILE_FLAGS "`mpicc --showme:compile`"
242 if (${?OPENMPI_COMPILE_FLAGS} == 0) then
243 setenv OPENMPI_COMPILE_FLAGS "`mpicc --showme:compile`"
246 if (${?OPENMPI_LINK_FLAGS} == 0) then
247 setenv OPENMPI_LINK_FLAGS "`mpicc --showme:link`"
251 # WARNING: We assume the file mpi.h will be available under the directories identified
252 # by the variable $OPENMPI_INCLUDE_DIR. Otherwise, please double check your
253 # system openmpi installation.
255 # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
256 setenv PINC "$OPENMPI_COMPILE_FLAGS"
257 setenv PLIBS "$OPENMPI_LINK_FLAGS"
259 # No longer needed, but we keep this as a reference, just in case...
260 #libDir `echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
263 if ($?FOAM_VERBOSE && $?prompt) then
264 echo "Using system installed OpenMPI:"
265 echo " OPENMPI_BIN_DIR : $OPENMPI_BIN_DIR"
266 echo " OPENMPI_LIB_DIR : $OPENMPI_LIB_DIR"
267 echo " OPENMPI_INCLUDE_DIR : $OPENMPI_INCLUDE_DIR"
268 echo " OPENMPI_COMPILE_FLAGS : $OPENMPI_COMPILE_FLAGS"
269 echo " OPENMPI_LINK_FLAGS : $OPENMPI_LINK_FLAGS"
271 echo " MPI_HOME : $MPI_HOME"
272 echo " MPI_ARCH_PATH : $MPI_ARCH_PATH"
273 echo " OPAL_PREFIX : $OPAL_PREFIX"
275 echo " PLIBS : $PLIBS"
278 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
283 set mpi_version=mpich-1.2.4
284 setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
285 setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
286 setenv MPICH_ROOT $MPI_ARCH_PATH
288 _foamAddPath $MPI_ARCH_PATH/bin
289 _foamAddLib $MPI_ARCH_PATH/lib
291 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
296 setenv MPI_ARCH_PATH /opt/mpi
297 setenv MPICH_PATH $MPI_ARCH_PATH
298 setenv MPICH_ROOT $MPI_ARCH_PATH
299 setenv GM_LIB_PATH /opt/gm/lib64
301 _foamAddPath $MPI_ARCH_PATH/bin
302 _foamAddLib $MPI_ARCH_PATH/lib
303 _foamAddLib $GM_LIB_PATH
305 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
309 setenv MPI_HOME /opt/hpmpi
310 setenv MPI_ARCH_PATH $MPI_HOME
311 setenv MPICH_ROOT=$MPI_ARCH_PATH
313 _foamAddPath $MPI_ARCH_PATH/bin
317 _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
320 _foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
323 _foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
326 echo Unknown processor type `uname -m` for Linux
330 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/hpmpi
334 setenv MPI_ARCH_PATH /usr
335 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/gamma
339 setenv MPI_ARCH_PATH /opt/mpi
340 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
344 setenv MPI_ARCH_PATH /opt/FJSVmpi2
345 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
346 _foamAddPath $MPI_ARCH_PATH/bin
347 _foamAddLib $MPI_ARCH_PATH/lib/sparcv9
348 _foamAddLib /opt/FSUNf90/lib/sparcv9
349 _foamAddLib /opt/FJSVpnidt/lib
353 setenv MPI_ARCH_PATH /usr/lib/mpi
354 setenv FOAM_MPI_LIBBIN FOAM_LIBBIN/qsmpi
356 _foamAddPath $MPI_ARCH_PATH/bin
357 _foamAddLib $MPI_ARCH_PATH/lib
362 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
366 _foamAddLib $FOAM_MPI_LIBBIN
369 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
370 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
371 set minBufferSize=20000000
373 if ( $?MPI_BUFFER_SIZE ) then
374 if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
375 setenv MPI_BUFFER_SIZE $minBufferSize
378 setenv MPI_BUFFER_SIZE $minBufferSize
382 # CGAL library if available
383 # ~~~~~~~~~~~~~~~~~~~~~~~~~
384 if ( $?CGAL_LIB_DIR ) then
385 _foamAddLib $CGAL_LIB_DIR
388 # Mesquite library if available
389 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
390 if ( $?MESQUITE_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS ) then
391 _foamSource $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS/etc/mesquite-2.1.2.csh
394 # Metis library if available
395 # ~~~~~~~~~~~~~~~~~~~~~~~~~~
396 if ( $?METIS_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/metis-5.0pre2/platforms/$WM_OPTIONS ) then
397 _foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.0pre2/platforms/$WM_OPTIONS/etc/metis-5.0pre2.csh
400 # ParMetis library if available
401 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
402 if ( $?PARMETIS_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/ParMetis-3.1.1/platforms/$WM_OPTIONS ) then
403 _foamSource $WM_THIRD_PARTY_DIR/packages/ParMetis-3.1.1/platforms/$WM_OPTIONS/etc/ParMetis-3.1.1.csh
406 # ParMGridGen library if available
407 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
408 if ( $?PARMGRIDGEN_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/ParMGridGen-1.0/platforms/$WM_OPTIONS ) then
409 _foamSource $WM_THIRD_PARTY_DIR/packages/ParMGridGen-1.0/platforms/$WM_OPTIONS/etc/ParMGridGen-1.0.csh
412 # Load Libccmio library
413 # ~~~~~~~~~~~~~~~~~~~~~
414 if ( $?LIBCCMIO_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/libccmio-2.6.1/platforms/$WM_OPTIONS ) then
415 _foamSource $WM_THIRD_PARTY_DIR/packages/libccmio-2.6.1/platforms/$WM_OPTIONS/etc/libccmio-2.6.1.csh
419 # Scotch library if available
420 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~
421 if ( $?SCOTCH_SYSTEM == 0 && -e $WM_THIRD_PARTY_DIR/packages/scotch-5.1.10b/platforms/$WM_OPTIONS ) then
422 _foamSource $WM_THIRD_PARTY_DIR/packages/scotch-5.1.10b/platforms/$WM_OPTIONS/etc/scotch-5.1.10b.csh
425 # Switch on the hoard memory allocator if available
426 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
427 #if ( -f $FOAM_LIBBIN/libhoard.so ) then
428 # setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
431 # Third party packages
435 if ( $?CMAKE_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/cmake-2.8.8/platforms/$WM_OPTIONS ) then
436 _foamSource $WM_THIRD_PARTY_DIR/packages/cmake-2.8.8/platforms/$WM_OPTIONS/etc/cmake-2.8.8.csh
441 if ( $?PYTHON_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/Python-2.7/platforms/$WM_OPTIONS ) then
442 _foamSource $WM_THIRD_PARTY_DIR/packages/Python-2.7/platforms/$WM_OPTIONS/etc/Python-2.7.csh
447 if ( $?QT_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/qt-everywhere-opensource-src-4.7.4/platforms/$WM_OPTIONS )then
448 _foamSource $WM_THIRD_PARTY_DIR/packages/qt-everywhere-opensource-src-4.7.4/platforms/$WM_OPTIONS/etc/qt-everywhere-opensource-src-4.7.4.csh
453 if ( $?PARAVIEW_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-3.12.0/platforms/$WM_OPTIONS ) then
454 _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.12.0/platforms/$WM_OPTIONS/etc/ParaView-3.12.0.csh
455 #if ( $?PARAVIEW_SYSTEM == 0 && -e "$WM_THIRD_PARTY_DIR"/packages/ParaView-3.8.1/platforms/$WM_OPTIONS ) then
456 # _foamSource $WM_THIRD_PARTY_DIR/packages/ParaView-3.8.1/platforms/$WM_OPTIONS/etc/ParaView-3.8.1.csh
459 if ( $WM_ARCH == "darwinIntel" || $WM_ARCH == "darwinIntel64" ) then
460 setenv DYLD_LIBRARY_PATH ${LD_LIBRARY_PATH}
463 # cleanup environment:
464 # ~~~~~~~~~~~~~~~~~~~~
469 # -----------------------------------------------------------------------------