1 #----------------------------------*-sh-*--------------------------------------
3 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
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/bashrc
32 #------------------------------------------------------------------------------
38 [ -d $1 ] || mkdir
-p $1
48 [ -d $1 ] || mkdir
-p $1
49 export LD_LIBRARY_PATH
=$1:$LD_LIBRARY_PATH
55 #- Add the system-specific executables path to the path
56 export PATH
=$WM_PROJECT_DIR/bin
:$FOAM_INST_DIR/$WM_ARCH/bin
:$PATH
58 #- Location of the jobControl directory
59 export FOAM_JOB_DIR
=$FOAM_INST_DIR/jobControl
61 export WM_DIR
=$WM_PROJECT_DIR/wmake
62 export WM_LINK_LANGUAGE
=c
++
63 export WM_OPTIONS
=$WM_ARCH${WM_COMPILER}$WM_PRECISION_OPTION$WM_COMPILE_OPTION
64 export PATH
=$WM_DIR:$PATH
66 export FOAM_SRC
=$WM_PROJECT_DIR/src
67 export FOAM_LIB
=$WM_PROJECT_DIR/lib
68 export FOAM_LIBBIN
=$FOAM_LIB/$WM_OPTIONS
69 _foamAddLib
$FOAM_LIBBIN
71 export FOAM_APP
=$WM_PROJECT_DIR/applications
72 export FOAM_APPBIN
=$WM_PROJECT_DIR/applications
/bin
/$WM_OPTIONS
73 _foamAddPath
$FOAM_APPBIN
75 export FOAM_TUTORIALS
=$WM_PROJECT_DIR/tutorials
76 export FOAM_UTILITIES
=$FOAM_APP/utilities
77 export FOAM_SOLVERS
=$FOAM_APP/solvers
79 export FOAM_USER_LIBBIN
=$WM_PROJECT_USER_DIR/lib
/$WM_OPTIONS
80 _foamAddLib
$FOAM_USER_LIBBIN
82 export FOAM_USER_APPBIN
=$WM_PROJECT_USER_DIR/applications
/bin
/$WM_OPTIONS
83 _foamAddPath
$FOAM_USER_APPBIN
85 export FOAM_RUN
=$WM_PROJECT_USER_DIR/run
93 # Select compiler installation
94 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
95 # WM_COMPILER_INST = OpenFOAM | System
96 WM_COMPILER_INST
=OpenFOAM
98 case "$WM_COMPILER_INST" in
100 case "$WM_COMPILER" in
102 export WM_COMPILER_DIR
=$WM_THIRD_PARTY_DIR/gcc-4.3
.1/platforms
/$WM_ARCH$WM_COMPILER_ARCH
105 export WM_COMPILER_DIR
=$WM_THIRD_PARTY_DIR/gcc-4.2
.4/platforms
/$WM_ARCH$WM_COMPILER_ARCH
109 # Check that the compiler directory can be found
110 if [ ! -d "$WM_COMPILER_DIR" ]
113 echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
114 echo " Cannot find $WM_COMPILER_DIR installation."
115 echo " Please install this compiler version or if you wish to use the system compiler,"
116 echo " change the WM_COMPILER_INST setting to 'System' in this file"
120 WM_COMPILER_BIN
=$WM_COMPILER_DIR/bin
121 WM_COMPILER_LIB
=$WM_COMPILER_DIR/lib
$WM_COMPILER_LIB_ARCH:$WM_COMPILER_DIR/lib
125 if [ -d "$WM_COMPILER_BIN" ]; then
126 export PATH
=$WM_COMPILER_BIN:$PATH
127 export LD_LIBRARY_PATH
=$WM_COMPILER_LIB:$LD_LIBRARY_PATH
130 unset WM_COMPILER_BIN WM_COMPILER_LIB
132 # Communications library
133 # ~~~~~~~~~~~~~~~~~~~~~~
139 mpi_version
=openmpi-1.2
.6
140 export MPI_HOME
=$WM_THIRD_PARTY_DIR/$mpi_version
141 export MPI_ARCH_PATH
=$MPI_HOME/platforms
/$WM_OPTIONS
143 # Tell OpenMPI where to find its install directory
144 export OPAL_PREFIX
=$MPI_ARCH_PATH
146 _foamAddLib
$MPI_ARCH_PATH/lib
147 _foamAddPath
$MPI_ARCH_PATH/bin
149 export FOAM_MPI_LIBBIN
=$FOAM_LIBBIN/$mpi_version
154 mpi_version
=lam-7.1
.4
155 export MPI_HOME
=$WM_THIRD_PARTY_DIR/$mpi_version
156 export MPI_ARCH_PATH
=$MPI_HOME/platforms
/$WM_OPTIONS
157 export LAMHOME
=$WM_THIRD_PARTY_DIR/$mpi_version
158 # note: LAMHOME is deprecated, should probably point to MPI_ARCH_PATH too
160 _foamAddLib
$MPI_ARCH_PATH/lib
161 _foamAddPath
$MPI_ARCH_PATH/bin
163 export FOAM_MPI_LIBBIN
=$FOAM_LIBBIN/$mpi_version
168 mpi_version
=mpich-1.2
.4
169 export MPI_HOME
=$WM_THIRD_PARTY_DIR/$mpi_version
170 export MPI_ARCH_PATH
=$MPI_HOME/platforms
/$WM_OPTIONS
171 export MPICH_ROOT
=$MPI_ARCH_PATH
173 _foamAddLib
$MPI_ARCH_PATH/lib
174 _foamAddPath
$MPI_ARCH_PATH/bin
176 export FOAM_MPI_LIBBIN
=$FOAM_LIBBIN/$mpi_version
181 export MPI_ARCH_PATH
=/opt
/mpi
182 export MPICH_PATH
=$MPI_ARCH_PATH
183 export MPICH_ROOT
=$MPI_ARCH_PATH
184 export GM_LIB_PATH
=/opt
/gm
/lib64
186 _foamAddLib
$MPI_ARCH_PATH/lib
187 _foamAddLib
$GM_LIB_PATH
188 _foamAddPath
$MPI_ARCH_PATH/bin
190 export FOAM_MPI_LIBBIN
=$FOAM_LIBBIN/mpich-gm
194 export MPI_ARCH_PATH
=/usr
195 export FOAM_MPI_LIBBIN
=$FOAM_LIBBIN/gamma
199 export MPI_ARCH_PATH
=/opt
/mpi
200 export FOAM_MPI_LIBBIN
=$FOAM_LIBBIN/mpi
204 export FOAM_MPI_LIBBIN
=$FOAM_LIBBIN/dummy
208 _foamAddLib
$FOAM_MPI_LIBBIN
211 # Set the MPI buffer size (used by all platforms except SGI MPI)
212 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
213 export MPI_BUFFER_SIZE
=20000000
216 # CGAL library if available
217 # ~~~~~~~~~~~~~~~~~~~~~~~~~
218 [ -d "$CGAL_LIB_DIR" ] && _foamAddLib
$CGAL_LIB_DIR
221 # Switch on the hoard memory allocator if available
222 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
223 #if [ -f $FOAM_LIBBIN/libhoard.so ]; then
224 # export LD_PRELOAD=$FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
228 # cleanup environment:
229 # ~~~~~~~~~~~~~~~~~~~~
230 unset _foamAddLib _foamAddPath
232 # -----------------------------------------------------------------------------