Fix tutorials: incompressible/simpleSRFFoam: add Allrun file which compiles simpleSRF...
[OpenFOAM-1.6-ext.git] / etc / cshrc
bloba9385547be927a9efd9d0170d83467a5e83eeca9
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/cshrc
28 # Description
29 #     Startup file for OpenFOAM
30 #     Sourced from ~/.login or ~/.cshrc
32 #------------------------------------------------------------------------------
34 setenv WM_PROJECT OpenFOAM
35 setenv WM_PROJECT_VERSION 1.6-ext
37 # helps to easily write #ifdefs to detect a dev-version
38 setenv FOAM_DEV 1
40 ###############################################################################
41 # USER EDITABLE PART
43 #    either setenv FOAM_INST_DIR before sourcing this file or set
44 #    foamInstall below to where OpenFOAM is installed
46 # Location of FOAM installation
47 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48 set foamInstall = $HOME/$WM_PROJECT
49 # set foamInstall = ~$WM_PROJECT
50 # set foamInstall = /usr/local/$WM_PROJECT
51 # set foamInstall = /opt/$WM_PROJECT
53 # END OF (NORMAL) USER EDITABLE PART
54 ###############################################################################
56 # note the location for later use (eg, in job scripts)
57 if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall
59 # The old dirs to be cleaned from the various environment variables
60 # - remove anything under top-level directory.
61 # NB: the WM_PROJECT_INST_DIR might not be identical between versions
62 set foamOldDirs="$FOAM_INST_DIR $HOME/$WM_PROJECT/$LOGNAME"
64 # Location of site/user files
65 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~
66 setenv WM_PROJECT_INST_DIR $FOAM_INST_DIR
67 setenv WM_PROJECT_DIR $WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
68 setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION
71 # Location of third-party software
72 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
73 setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
76 # Operating System/Platform
77 # ~~~~~~~~~~~~~~~~~~~~~~~~~
78 # WM_OSTYPE = POSIX | ????
79 if ( ! $?WM_OSTYPE ) setenv WM_OSTYPE POSIX
82 # Compiler: set to Gcc, Gcc43 or Icc (for Intel's icc)
83 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84 #if ( ! $?WM_COMPILER ) setenv WM_COMPILER Gcc
85 #setenv WM_COMPILER Gcc
86 setenv WM_COMPILER Icc
88 setenv WM_COMPILER_ARCH
89 setenv WM_COMPILER_LIB_ARCH
92 # Compilation options (architecture, precision, optimised, debug or profiling)
93 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
94 setenv WM_NCOMPPROCS 2
96 # WM_ARCH_OPTION = 32 | 64
97 if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64
99 # WM_PRECISION_OPTION = DP | SP
100 if ( ! $?WM_PRECISION_OPTION ) setenv WM_PRECISION_OPTION DP
102 # WM_COMPILE_OPTION = Opt | Debug | Prof
103 #if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt
104 setenv WM_COMPILE_OPTION Opt
105 #setenv WM_COMPILE_OPTION Debug
107 # WM_MPLIB = | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
108 if ( ! $?WM_MPLIB ) setenv WM_MPLIB OPENMPI
111 # Run options (floating-point signal handling and memory initialisation)
112 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
113 setenv FOAM_SIGFPE
114 # setenv FOAM_SETNAN
117 # Detect system type and set environment variables
118 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
119 setenv WM_ARCH `uname -s`
121 switch ($WM_ARCH)
122 case Linux:
123     setenv WM_ARCH linux
125     switch (`uname -m`)
126     case i686:
127         breaksw
129     case x86_64:
130         switch ($WM_ARCH_OPTION)
131         case 32:
132             setenv WM_ARCH linux
133             setenv WM_COMPILER_ARCH '-64'
134             setenv WM_CFLAGS '-m32 -fPIC'
135             setenv WM_CXXFLAGS '-m32 -fPIC'
136             setenv WM_LDFLAGS '-m32'
137             breaksw
139         case 64:
140             setenv WM_ARCH linux64
141             setenv WM_COMPILER_LIB_ARCH 64
142             setenv WM_CFLAGS '-m64 -fPIC'
143             setenv WM_CXXFLAGS '-m64 -fPIC'
144             setenv WM_LDFLAGS '-m64'
145             breaksw
147         default:
148             echo Unknown WM_ARCH_OPTION $WM_ARCH_OPTION, should be 32 or 64
149             breaksw
151         endsw
152         breaksw
154     case ia64:
155         setenv WM_ARCH linuxIA64
156         setenv WM_COMPILER I64
157         breaksw
159     case mips64:
160         setenv WM_ARCH SiCortex64
161         setenv WM_COMPILER_LIB_ARCH 64
162         setenv WM_CFLAGS '-mabi=64 -fPIC'
163         setenv WM_CXXFLAGS '-mabi=64 -fPIC'
164         setenv WM_LDFLAGS '-mabi=64 -G0'
165         setenv WM_MPLIB MPI
166         ;;
167     case Darwin:
168         setenv WM_ARCH darwin
169         setenv WM_COMPILER
170         breaksw
172     case ppc64:
173         setenv WM_ARCH linuxPPC64
174         setenv WM_COMPILER_LIB_ARCH 64
175         setenv WM_CFLAGS '-m64 -fPIC'
176         setenv WM_CXXFLAGS '-m64 -fPIC'
177         setenv WM_LDFLAGS '-m64'
178         breaksw
180     default:
181         echo Unknown processor type `uname -m` for Linux
182         breaksw
184     endsw
185     breaksw
187 case SunOS:
188     setenv WM_ARCH SunOS64
189     setenv WM_COMPILER_LIB_ARCH 64
190     setenv WM_CFLAGS '-mabi=64 -fPIC'
191     setenv WM_CXXFLAGS '-mabi=64 -fPIC'
192     setenv WM_LDFLAGS '-mabi=64 -G0'
193     setenv WM_MPLIB FJMPI
194     breaksw
196 default:
197     echo
198     echo "Your '$WM_ARCH' operating system is not supported by this release"
199     echo "of OpenFOAM. For further assistance, please contact www.OpenFOAM.org"
200     echo
201     breaksw
203 endsw
206 # Clean standard environment variables (path/PATH, LD_LIBRARY_PATH, MANPATH)
207 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
208 set cleanProg=$WM_PROJECT_DIR/bin/foamCleanPath
210 if (! $?LD_LIBRARY_PATH ) then
211     setenv LD_LIBRARY_PATH ''
212 endif
213 if (! $?MANPATH) then
214     setenv MANPATH ''
215 endif
217 #- Clean path/PATH
218 set colonPath=`echo "$path" | sed -e 's/ /:/g'`
219 set cleanEnv=`$cleanProg "$colonPath" "$foamOldDirs"`
220 if ( $status == 0 ) then
221     set path=`echo "$cleanEnv" | sed -e 's/:/ /g'`
222 endif
224 #- Clean LD_LIBRARY_PATH
225 setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH" "$foamOldDirs"`
227 #- Clean MANPATH
228 setenv MANPATH `$cleanProg "$MANPATH" "$foamOldDirs"`
231 # Source project setup files
232 # ~~~~~~~~~~~~~~~~~~~~~~~~~~
233 alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Executing: \!*"; source \!*'
235 _foamSource $WM_PROJECT_DIR/etc/settings.csh
236 _foamSource $WM_PROJECT_DIR/etc/aliases.csh
238 # Source user setup files for optional packages
239 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
240 # _foamSource $WM_PROJECT_DIR/etc/apps/paraview/cshrc
241 _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/cshrc
242 # _foamSource $WM_PROJECT_DIR/etc/apps/ensight/cshrc
245 # Clean environment paths again. Only remove duplicates
246 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
247 #- Clean path/PATH
248 set colonPath=`echo "$path" | sed -e 's/ /:/g'`
249 set cleanEnv=`$cleanProg "$colonPath"`
250 if ( $status == 0 ) then
251     set path=`echo "$cleanEnv" | sed -e 's/:/ /g'`
252 endif
254 #- Clean LD_LIBRARY_PATH
255 setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH"`
257 #- Clean MANPATH
258 setenv MANPATH `$cleanProg "$MANPATH"`:
260 #- Clean LD_PRELOAD
261 if ( $?LD_PRELOAD ) then
262     setenv LD_PRELOAD `$cleanProg "$LD_PRELOAD"`
263 endif
265 # cleanup environment:
266 # ~~~~~~~~~~~~~~~~~~~~
267 unset cleanEnv cleanProg colonPath foamInstall foamOldDirs
268 unalias _foamSource
270 # -----------------------------------------------------------------------------