Fix tutorials: incompressible/simpleSRFFoam: add Allrun file which compiles simpleSRF...
[OpenFOAM-1.6-ext.git] / etc / settings.csh
blobcc5573676587e84381c1e06aeb93246d6df8142c
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
93 switch ("$compilerInstall")
94 case OpenFOAM:
95     switch ("$WM_COMPILER")
96     case Gcc:
97         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
98         _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
99         _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
100     breaksw
101     case Gcc43:
102         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.3.3/platforms/$WM_ARCH$WM_COMPILER_ARCH
103         _foamAddLib $WM_THIRD_PARTY_DIR/mpfr-2.4.1/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
104         _foamAddLib $WM_THIRD_PARTY_DIR/gmp-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH/lib
105     breaksw
106     case Gcc42:
107         setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/gcc-4.2.4/platforms/$WM_ARCH$WM_COMPILER_ARCH
108     breaksw
109     endsw
111     # Check that the compiler directory can be found
112     if ( ! -d "$WM_COMPILER_DIR" ) then
113         echo
114         echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
115         echo "    Cannot find $WM_COMPILER_DIR installation."
116         echo "    Please install this compiler version or if you wish to use the system compiler,"
117         echo "    change the 'compilerInstall' setting to 'System' in this file"
118         echo
119     endif
121     _foamAddPath ${WM_COMPILER_DIR}/bin
122     _foamAddLib  ${WM_COMPILER_DIR}/lib${WM_COMPILER_LIB_ARCH}
123     _foamAddLib  ${WM_COMPILER_DIR}/lib
125     breaksw
126 endsw
129 switch ("$WM_COMPILER")
130 case Gcc:
131     setenv WM_CC 'gcc'
132     setenv WM_CXX 'g++'
133     breaksw
134 case Icc:
135     setenv WM_CC 'icc'
136     setenv WM_CXX 'icpc'
137     breaksw
138 endsw
140 # Communications library
141 # ~~~~~~~~~~~~~~~~~~~~~~
143 unset MPI_ARCH_PATH
145 switch ("$WM_MPLIB")
146 case OPENMPI:
147     set mpi_version=openmpi-1.4.1
148     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
149     setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
151     # Tell OpenMPI where to find its install directory
152     setenv OPAL_PREFIX $MPI_ARCH_PATH
154     _foamAddPath $MPI_ARCH_PATH/bin
155     _foamAddLib  $MPI_ARCH_PATH/lib
157     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
158     unset mpi_version
159     breaksw
161 case SYSTEMOPENMPI:
163     # This uses the installed openmpi. It needs mpicc installed!
165     set mpi_version=openmpi-system
167     # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
168     setenv PINC `mpicc --showme:compile` 
169     setenv PLIBS `mpicc --showme:link`
170     set libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
172     if ($?FOAM_VERBOSE && $?prompt) then
173         echo "Using system installed MPI:"
174         echo "    compile flags : $PINC"
175         echo "    link flags    : $PLIBS"
176         echo "    libmpi dir    : $libDir"
177     endif
179     _foamAddLib $libDir
181     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
182     unset mpi_version libDir
183     breaksw
185 case MPICH:
186     set mpi_version=mpich-1.2.4
187     setenv MPI_HOME $WM_THIRD_PARTY_DIR/$mpi_version
188     setenv MPI_ARCH_PATH $MPI_HOME/platforms/$WM_OPTIONS
189     setenv MPICH_ROOT $MPI_ARCH_PATH
191     _foamAddPath $MPI_ARCH_PATH/bin
192     _foamAddLib  $MPI_ARCH_PATH/lib
194     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
195     unset mpi_version
196     breaksw
198 case MPICH-GM:
199     setenv MPI_ARCH_PATH /opt/mpi
200     setenv MPICH_PATH $MPI_ARCH_PATH
201     setenv MPICH_ROOT $MPI_ARCH_PATH
202     setenv GM_LIB_PATH /opt/gm/lib64
204     _foamAddPath $MPI_ARCH_PATH/bin
205     _foamAddLib  $MPI_ARCH_PATH/lib
206     _foamAddLib  $GM_LIB_PATH
208     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
209     breaksw
211 case HPMPI:
212     setenv MPI_HOME /opt/hpmpi
213     setenv MPI_ARCH_PATH $MPI_HOME
214     setenv MPICH_ROOT=$MPI_ARCH_PATH
216     _foamAddPath $MPI_ARCH_PATH/bin
218     switch (`uname -m`)
219     case i686:
220         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia32
221         breaksw
222     case x86_64:
223         _foamAddLib $MPI_ARCH_PATH/lib/linux_amd64
224         breaksw
225     case ia64:
226         _foamAddLib $MPI_ARCH_PATH/lib/linux_ia64
227         breaksw
228     default:
229         echo Unknown processor type `uname -m` for Linux
230         breaksw
231     endsw
233     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/hpmpi
234     breaksw
236 case GAMMA:
237     setenv MPI_ARCH_PATH /usr
238     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/gamma
239     breaksw
241 case MPI:
242     setenv MPI_ARCH_PATH /opt/mpi
243     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
244     breaksw
246 case FJMPI:
247     setenv MPI_ARCH_PATH /opt/FJSVmpi2
248     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
249     _foamAddPath $MPI_ARCH_PATH/bin
250     _foamAddLib  $MPI_ARCH_PATH/lib/sparcv9
251     _foamAddLib  /opt/FSUNf90/lib/sparcv9
252     _foamAddLib  /opt/FJSVpnidt/lib
253     breaksw
255 case QSMPI:
256     setenv MPI_ARCH_PATH /usr/lib/mpi
257     setenv FOAM_MPI_LIBBIN FOAM_LIBBIN/qsmpi
259     _foamAddPath $MPI_ARCH_PATH/bin
260     _foamAddLib $MPI_ARCH_PATH/lib
262     breaksw
264 default:
265     setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/dummy
266     breaksw
267 endsw
269 _foamAddLib $FOAM_MPI_LIBBIN
272 # Set the minimum MPI buffer size (used by all platforms except SGI MPI)
273 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
274 set minBufferSize=20000000
276 if ( $?MPI_BUFFER_SIZE ) then
277     if ( $MPI_BUFFER_SIZE < $minBufferSize ) then
278         setenv MPI_BUFFER_SIZE $minBufferSize
279     endif
280 else
281     setenv MPI_BUFFER_SIZE $minBufferSize
282 endif
285 # CGAL library if available
286 # ~~~~~~~~~~~~~~~~~~~~~~~~~
287 if ( $?CGAL_LIB_DIR ) then
288     _foamAddLib $CGAL_LIB_DIR
289 endif
292 # Switch on the hoard memory allocator if available
293 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
294 #if ( -f $FOAM_LIBBIN/libhoard.so ) then
295 #    setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:${LD_PRELOAD}
296 #endif
299 # cleanup environment:
300 # ~~~~~~~~~~~~~~~~~~~~
301 unalias _foamAddPath
302 unalias _foamAddLib
303 unset minBufferSize
305 # -----------------------------------------------------------------------------