ENH: paraFoam : unsetenv FOAM_ABORT so tracebacks do not hang paraview.
[OpenFOAM-1.6.x.git] / etc / cshrc
blobb8d94ec08c13adea00226489e94197c895f4ff48
1 #----------------------------------*-sh-*--------------------------------------
2 # =========                 |
3 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4 #  \\    /   O peration     |
5 #   \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
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.x
37 ################################################################################
38 # USER EDITABLE PART
40 #    either setenv FOAM_INST_DIR before sourcing this file or set
41 #    foamInstall below to where OpenFOAM is installed
43 # Location of FOAM installation
44 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
45 set foamInstall = $HOME/$WM_PROJECT
46 # set foamInstall = ~$WM_PROJECT
47 # set foamInstall = /usr/local/$WM_PROJECT
48 # set foamInstall = /opt/$WM_PROJECT
50 # END OF (NORMAL) USER EDITABLE PART
51 ################################################################################
53 # note the location for later use (eg, in job scripts)
54 if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall
56 # The old dirs to be cleaned from the various environment variables
57 # - remove anything under top-level directory.
58 # NB: the WM_PROJECT_INST_DIR might not be identical between versions
59 set foamOldDirs="$FOAM_INST_DIR $HOME/$WM_PROJECT/$LOGNAME"
61 # Location of site/user files
62 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~
63 setenv WM_PROJECT_INST_DIR $FOAM_INST_DIR
64 setenv WM_PROJECT_DIR $WM_PROJECT_INST_DIR/$WM_PROJECT-$WM_PROJECT_VERSION
65 setenv WM_PROJECT_USER_DIR $HOME/$WM_PROJECT/$LOGNAME-$WM_PROJECT_VERSION
68 # Location of third-party software
69 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70 setenv WM_THIRD_PARTY_DIR $WM_PROJECT_INST_DIR/ThirdParty-$WM_PROJECT_VERSION
73 # Operating System/Platform
74 # ~~~~~~~~~~~~~~~~~~~~~~~~~
75 # WM_OSTYPE = POSIX | ????
76 if ( ! $?WM_OSTYPE ) setenv WM_OSTYPE POSIX
79 # Compiler: set to Gcc, Gcc43 or Icc (for Intel's icc)
80 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
81 if ( ! $?WM_COMPILER ) setenv WM_COMPILER Gcc
83 setenv WM_COMPILER_ARCH
84 setenv WM_COMPILER_LIB_ARCH
87 # Compilation options (architecture, precision, optimised, debug or profiling)
88 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
89 # WM_ARCH_OPTION = 32 | 64
90 if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64
92 # WM_PRECISION_OPTION = DP | SP
93 if ( ! $?WM_PRECISION_OPTION ) setenv WM_PRECISION_OPTION DP
95 # WM_COMPILE_OPTION = Opt | Debug | Prof
96 if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt
98 # WM_MPLIB = | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
99 if ( ! $?WM_MPLIB ) setenv WM_MPLIB OPENMPI
102 # Run options (floating-point signal handling and memory initialisation)
103 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
104 setenv FOAM_SIGFPE
105 # setenv FOAM_SETNAN
108 # Detect system type and set environment variables
109 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
110 setenv WM_ARCH `uname -s`
112 switch ($WM_ARCH)
113 case Linux:
114     setenv WM_ARCH linux
116     switch (`uname -m`)
117     case i686:
118         breaksw
120     case x86_64:
121         switch ($WM_ARCH_OPTION)
122         case 32:
123             setenv WM_ARCH linux
124             setenv WM_COMPILER_ARCH '-64'
125             setenv WM_CC 'gcc'
126             setenv WM_CXX 'g++'
127             setenv WM_CFLAGS '-m32 -fPIC'
128             setenv WM_CXXFLAGS '-m32 -fPIC'
129             setenv WM_LDFLAGS '-m32'
130             breaksw
132         case 64:
133             setenv WM_ARCH linux64
134             setenv WM_COMPILER_LIB_ARCH 64
135             setenv WM_CC 'gcc'
136             setenv WM_CXX 'g++'
137             setenv WM_CFLAGS '-m64 -fPIC'
138             setenv WM_CXXFLAGS '-m64 -fPIC'
139             setenv WM_LDFLAGS '-m64'
140             breaksw
142         default:
143             echo Unknown WM_ARCH_OPTION $WM_ARCH_OPTION, should be 32 or 64
144             breaksw
146         endsw
147         breaksw
149     case ia64:
150         setenv WM_ARCH linuxIA64
151         setenv WM_COMPILER I64
152         breaksw
154     case mips64:
155         setenv WM_ARCH SiCortex64
156         setenv WM_COMPILER_LIB_ARCH 64
157         setenv WM_CC 'gcc'
158         setenv WM_CXX 'g++'
159         setenv WM_CFLAGS '-mabi=64 -fPIC'
160         setenv WM_CXXFLAGS '-mabi=64 -fPIC'
161         setenv WM_LDFLAGS '-mabi=64 -G0'
162         setenv WM_MPLIB MPI
163         breaksw
165     case ppc64:
166         setenv WM_ARCH linuxPPC64
167         setenv WM_COMPILER_LIB_ARCH 64
168         setenv WM_CC 'gcc'
169         setenv WM_CXX 'g++'
170         setenv WM_CFLAGS '-m64 -fPIC'
171         setenv WM_CXXFLAGS '-m64 -fPIC'
172         setenv WM_LDFLAGS '-m64'
173         breaksw
175     default:
176         echo Unknown processor type `uname -m` for Linux
177         breaksw
179     endsw
180     breaksw
182 case SunOS:
183     setenv WM_ARCH SunOS64
184     setenv WM_COMPILER_LIB_ARCH 64
185     setenv WM_CC 'gcc'
186     setenv WM_CXX 'g++'
187     setenv WM_CFLAGS '-mabi=64 -fPIC'
188     setenv WM_CXXFLAGS '-mabi=64 -fPIC'
189     setenv WM_LDFLAGS '-mabi=64 -G0'
190     setenv WM_MPLIB FJMPI
191     breaksw
193 default:
194     echo
195     echo "Your '$WM_ARCH' operating system is not supported by this release"
196     echo "of OpenFOAM. For further assistance, please contact www.OpenFOAM.org"
197     echo
198     breaksw
200 endsw
203 # Clean standard environment variables (path/PATH, LD_LIBRARY_PATH, MANPATH)
204 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
205 set cleanProg=$WM_PROJECT_DIR/bin/foamCleanPath
207 if (! $?LD_LIBRARY_PATH ) then
208     setenv LD_LIBRARY_PATH ''
209 endif
210 if (! $?MANPATH) then
211     setenv MANPATH ''
212 endif
214 #- Clean path/PATH
215 set colonPath=`echo "$path" | sed -e 's/ /:/g'`
216 set cleanEnv=`$cleanProg "$colonPath" "$foamOldDirs"`
217 if ( $status == 0 ) then
218     set path=`echo "$cleanEnv" | sed -e 's/:/ /g'`
219 endif
221 #- Clean LD_LIBRARY_PATH
222 setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH" "$foamOldDirs"`
224 #- Clean MANPATH
225 setenv MANPATH `$cleanProg "$MANPATH" "$foamOldDirs"`
228 # Source project setup files
229 # ~~~~~~~~~~~~~~~~~~~~~~~~~~
230 alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Executing: \!*"; source \!*'
232 _foamSource $WM_PROJECT_DIR/etc/settings.csh
233 _foamSource $WM_PROJECT_DIR/etc/aliases.csh
235 # Source user setup files for optional packages
236 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
237 # _foamSource $WM_PROJECT_DIR/etc/apps/paraview/cshrc
238 _foamSource $WM_PROJECT_DIR/etc/apps/paraview3/cshrc
239 # _foamSource $WM_PROJECT_DIR/etc/apps/ensight/cshrc
242 # Clean environment paths again. Only remove duplicates
243 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
244 #- Clean path/PATH
245 set colonPath=`echo "$path" | sed -e 's/ /:/g'`
246 set cleanEnv=`$cleanProg "$colonPath"`
247 if ( $status == 0 ) then
248     set path=`echo "$cleanEnv" | sed -e 's/:/ /g'`
249 endif
251 #- Clean LD_LIBRARY_PATH
252 setenv LD_LIBRARY_PATH `$cleanProg "$LD_LIBRARY_PATH"`
254 #- Clean MANPATH
255 setenv MANPATH `$cleanProg "$MANPATH"`:
257 #- Clean LD_PRELOAD
258 if ( $?LD_PRELOAD ) then
259     setenv LD_PRELOAD `$cleanProg "$LD_PRELOAD"`
260 endif
262 # cleanup environment:
263 # ~~~~~~~~~~~~~~~~~~~~
264 unset cleanEnv cleanProg colonPath foamInstall foamOldDirs
265 unalias _foamSource
267 # -----------------------------------------------------------------------------