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/cshrc
32 #------------------------------------------------------------------------------
34 alias _foamAddPath 'set path=(\!* $path) ; if ( ! -d \!* ) mkdir -p \!*'
35 alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH} ; set xx=`echo $LD_LIBRARY_PATH | sed -e "s/:.*//"`; if ( ! -d $xx ) mkdir -p $xx'
38 #- Add the system-specific executables path to the path
39 set path=($WM_PROJECT_DIR/bin $FOAM_INST_DIR/$WM_ARCH/bin $path)
41 #- Location of the jobControl directory
42 setenv FOAM_JOB_DIR $FOAM_INST_DIR/jobControl
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
47 set path=($WM_DIR $path)
49 setenv FOAM_SRC $WM_PROJECT_DIR/src
50 setenv FOAM_LIB $WM_PROJECT_DIR/lib
51 setenv FOAM_LIBBIN $FOAM_LIB/$WM_OPTIONS
52 _foamAddLib $FOAM_LIBBIN
54 setenv FOAM_APP $WM_PROJECT_DIR/applications
55 setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
56 _foamAddPath $FOAM_APPBIN
58 setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
59 setenv FOAM_UTILITIES $FOAM_APP/utilities
60 setenv FOAM_SOLVERS $FOAM_APP/solvers
62 setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
63 _foamAddLib $FOAM_USER_LIBBIN
65 setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
66 _foamAddPath $FOAM_USER_APPBIN
68 setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
76 # Select compiler installation
77 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78 # WM_COMPILER_INST = OpenFOAM | System
79 set WM_COMPILER_INST=OpenFOAM
81 switch ("$WM_COMPILER_INST")
83 switch ("$WM_COMPILER")
85 setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.1/platforms/$WM_ARCH$WM_COMPILER_ARCH
88 setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
92 # Check that the compiler directory can be found
93 if ( ! -d "$WM_COMPILER_DIR" ) then
95 echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
96 echo " Cannot find $WM_COMPILER_DIR installation."
97 echo " Please install this compiler version or if you wish to use the system compiler,"
98 echo " change the WM_COMPILER_INST setting to 'System' in this file"
102 set WM_COMPILER_BIN="$WM_COMPILER_DIR/bin"
103 set WM_COMPILER_LIB=$WM_COMPILER_DIR/lib${WM_COMPILER_LIB_ARCH}:$WM_COMPILER_DIR/lib
107 if ($?WM_COMPILER_BIN) then
108 _foamAddPath $WM_COMPILER_BIN
109 _foamAddLib $WM_COMPILER_LIB
112 unset WM_COMPILER_BIN
113 unset WM_COMPILER_LIB
116 # Communications library
117 # ~~~~~~~~~~~~~~~~~~~~~~
123 set mpi_version=openmpi-1.2.6
124 setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
125 setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
127 # Tell OpenMPI where to find its install directory
128 setenv OPAL_PREFIX $MPI_ARCH_PATH
130 _foamAddLib $MPI_ARCH_PATH/lib
131 _foamAddPath $MPI_ARCH_PATH/bin
133 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
138 set mpi_version=lam-7.1.4
139 setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
140 setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
141 setenv LAMHOME $WM_THIRD_PARTY_DIR/$mpi_version
142 # note: LAMHOME is deprecated, should probably point to MPI_ARCH_PATH too
144 _foamAddLib $MPI_ARCH_PATH/lib
145 _foamAddPath $MPI_ARCH_PATH/bin
147 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
152 set mpi_version=mpich-1.2.4
153 setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
154 setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
155 setenv MPICH_ROOT $MPI_ARCH_PATH
157 _foamAddLib $MPI_ARCH_PATH/lib
158 _foamAddPath $MPI_ARCH_PATH/bin
160 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
165 setenv MPI_ARCH_PATH /opt/mpi
166 setenv MPICH_PATH $MPI_ARCH_PATH
167 setenv MPICH_ROOT $MPI_ARCH_PATH
168 setenv GM_LIB_PATH /opt/gm/lib64
170 _foamAddLib $MPI_ARCH_PATH/lib
171 _foamAddLib $GM_LIB_PATH
172 _foamAddPath $MPI_ARCH_PATH/bin
174 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
178 setenv MPI_ARCH_PATH /usr
179 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/gamma
183 setenv MPI_ARCH_PATH /opt/mpi
184 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
188 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
192 _foamAddLib $FOAM_MPI_LIBBIN
195 # Set the MPI buffer size (used by all platforms except SGI MPI)
196 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
197 setenv MPI_BUFFER_SIZE 20000000
200 # CGAL library if available
201 # ~~~~~~~~~~~~~~~~~~~~~~~~~
202 if ( $?CGAL_LIB_DIR ) then
203 _foamAddLib $CGAL_LIB_DIR
207 # Switch on the hoard memory allocator if available
208 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
209 #if ( -f $FOAM_LIBBIN/libhoard.so ) then
210 # setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
214 # cleanup environment:
215 # ~~~~~~~~~~~~~~~~~~~~
220 # -----------------------------------------------------------------------------