1 #----------------------------------*-sh-*--------------------------------------
3 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
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
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your 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, see <http://www.gnu.org/licenses/>.
25 # etc/config/unset.csh
28 # Clear as many OpenFOAM environment settings as possible
30 #------------------------------------------------------------------------------
32 # Clean standard environment variables (PATH, LD_LIBRARY_PATH, MANPATH)
35 if ( $?WM_PROJECT_DIR ) then
36 set foamClean=$WM_PROJECT_DIR/bin/foamCleanPath
37 if ( ! -f "$foamClean" || ! -x "$foamClean" ) unset foamClean
42 # The old dirs to be cleaned from the various environment variables
43 # - remove anything under top-level directory.
44 # NB: the WM_PROJECT_INST_DIR might not be identical between versions
46 if ( $?WM_PROJECT_INST_DIR ) then
47 set foamOldDirs="$WM_PROJECT_INST_DIR"
50 if ( $?WM_PROJECT ) then
51 set foamOldDirs="$HOME/$WM_PROJECT/$LOGNAME $foamOldDirs"
54 if ( $?WM_PROJECT_SITE ) then
55 set foamOldDirs="$WM_PROJECT_SITE $foamOldDirs"
59 #------------------------------------------------------------------------------
60 # unset WM_* environment variables
63 unsetenv WM_ARCH_OPTION
67 unsetenv WM_COMPILER_LIB_ARCH
68 unsetenv WM_COMPILE_OPTION
74 unsetenv WM_LINK_LANGUAGE
76 unsetenv WM_NCOMPPROCS
79 unsetenv WM_PRECISION_OPTION
81 unsetenv WM_PROJECT_DIR
82 unsetenv WM_PROJECT_INST_DIR
83 unsetenv WM_PROJECT_SITE
84 unsetenv WM_PROJECT_USER_DIR
85 unsetenv WM_PROJECT_VERSION
87 unsetenv WM_THIRD_PARTY_DIR
90 #------------------------------------------------------------------------------
91 # unset FOAM_* environment variables
95 unsetenv FOAM_EXT_LIBBIN
96 unsetenv FOAM_CODE_TEMPLATES
97 unsetenv FOAM_INST_DIR
102 unsetenv FOAM_SETTINGS
105 unsetenv FOAM_SITE_APPBIN
106 unsetenv FOAM_SITE_LIBBIN
107 unsetenv FOAM_SOLVERS
109 unsetenv FOAM_TUTORIALS
110 unsetenv FOAM_USER_APPBIN
111 unsetenv FOAM_USER_LIBBIN
112 unsetenv FOAM_UTILITIES
115 #------------------------------------------------------------------------------
116 # unset MPI-related environment variables
118 unsetenv MPI_ARCH_PATH
119 unsetenv MPI_BUFFER_SIZE
122 #------------------------------------------------------------------------------
123 # unset Ensight/ParaView-related environment variables
125 unsetenv ENSIGHT9_READER
127 unsetenv ParaView_DIR
128 unsetenv PV_PLUGIN_PATH
131 #------------------------------------------------------------------------------
132 # cleanup environment
133 # PATH, LD_LIBRARY_PATH, MANPATH
135 if ( $?foamClean ) then
137 set cleaned=`$foamClean "$PATH" "$foamOldDirs"`
138 if ( $status == 0 ) setenv PATH $cleaned
140 if ($?LD_LIBRARY_PATH) then
141 set cleaned=`$foamClean "$LD_LIBRARY_PATH" "$foamOldDirs"`
142 if ( $status == 0 ) setenv LD_LIBRARY_PATH $cleaned
144 if ( ${%LD_LIBRARY_PATH} == 0 ) unsetenv LD_LIBRARY_PATH
148 set cleaned=`$foamClean "$MANPATH" "$foamOldDirs"`
149 if ( $status == 0 ) setenv MANPATH $cleaned
151 if ( ${%MANPATH} == 0 ) unsetenv MANPATH
157 unset cleaned foamClean foamOldDirs
159 #------------------------------------------------------------------------------
193 # ----------------------------------------------------------------- end-of-file