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} ; if ( ! -d \!* ) mkdir -p \!*'
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 set path=($WM_COMPILER_BIN $path)
110 if ($?LD_LIBRARY_PATH) then
111 setenv LD_LIBRARY_PATH ${WM_COMPILER_LIB}:${LD_LIBRARY_PATH}
113 setenv LD_LIBRARY_PATH ${WM_COMPILER_LIB}
117 unset WM_COMPILER_BIN
118 unset WM_COMPILER_LIB
121 # Communications library
122 # ~~~~~~~~~~~~~~~~~~~~~~
128 set mpi_version=openmpi-1.2.6
129 setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
130 setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
132 # Tell OpenMPI where to find its install directory
133 setenv OPAL_PREFIX $MPI_ARCH_PATH
135 _foamAddLib $MPI_ARCH_PATH/lib
136 _foamAddPath $MPI_ARCH_PATH/bin
138 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
143 set mpi_version=lam-7.1.4
144 setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
145 setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
146 setenv LAMHOME $WM_THIRD_PARTY_DIR/$mpi_version
147 # note: LAMHOME is deprecated, should probably point to MPI_ARCH_PATH too
149 _foamAddLib $MPI_ARCH_PATH/lib
150 _foamAddPath $MPI_ARCH_PATH/bin
152 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
157 set mpi_version=mpich-1.2.4
158 setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
159 setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
160 setenv MPICH_ROOT $MPI_ARCH_PATH
162 _foamAddLib $MPI_ARCH_PATH/lib
163 _foamAddPath $MPI_ARCH_PATH/bin
165 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
170 setenv MPI_ARCH_PATH /opt/mpi
171 setenv MPICH_PATH $MPI_ARCH_PATH
172 setenv MPICH_ROOT $MPI_ARCH_PATH
173 setenv GM_LIB_PATH /opt/gm/lib64
175 _foamAddLib $MPI_ARCH_PATH/lib
176 _foamAddLib $GM_LIB_PATH
177 _foamAddPath $MPI_ARCH_PATH/bin
179 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
183 setenv MPI_ARCH_PATH /usr
184 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/gamma
188 setenv MPI_ARCH_PATH /opt/mpi
189 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
193 setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
197 _foamAddLib $FOAM_MPI_LIBBIN
200 # Set the MPI buffer size (used by all platforms except SGI MPI)
201 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
202 setenv MPI_BUFFER_SIZE 20000000
205 # CGAL library if available
206 # ~~~~~~~~~~~~~~~~~~~~~~~~~
207 if ( $?CGAL_LIB_DIR ) then
208 _foamAddLib $CGAL_LIB_DIR
212 # Switch on the hoard memory allocator if available
213 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
214 #if ( -f $FOAM_LIBBIN/libhoard.so ) then
215 # setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
219 # cleanup environment:
220 # ~~~~~~~~~~~~~~~~~~~~
225 # -----------------------------------------------------------------------------