CONFIG: adjustments to environment

- provide default WM_DIR if not already set, to improve robustness if a
  reduced environment is used

- add etc/ to WM_PROJECT_SITE search. This makes the site directory
  structure consistent with the OpenFOAM structure.
  Eg,

      WM_PROJECT_SITE/etc/..
      WM_PROJECT_SITE/bin/..
      WM_PROJECT_SITE/platforms/..

- Don't set/export WM_OSTYPE.  The default is POSIX and is properly
  defaulted throughout, including in CMakeLists-OpenFOAM.txt (also for
  Catalyst)
This commit is contained in:
Mark Olesen
2018-12-03 09:50:48 +01:00
parent e917586574
commit b8c257d6ad
19 changed files with 112 additions and 69 deletions

View File

@ -18,7 +18,7 @@
#
#------------------------------------------------------------------------------
setenv WM_ARCH `uname -s` # System name
if (! $?WM_OSTYPE ) setenv WM_OSTYPE POSIX # System type (POSIX is default)
## if (! $?WM_OSTYPE ) setenv WM_OSTYPE POSIX # System type (POSIX is default)
# Default compiler = gcc/g++ and C++11
setenv WM_CC "gcc"
@ -171,7 +171,16 @@ setenv FOAM_USER_APPBIN "$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/bin"
setenv FOAM_USER_LIBBIN "$WM_PROJECT_USER_DIR/platforms/$WM_OPTIONS/lib"
# Prepend wmake to the path - not required for runtime-only environment
if ( -d "${WM_DIR}" ) setenv PATH "${WM_DIR}:${PATH}"
set foundDir="${WM_PROJECT_DIR}/wmake"
if ( $?WM_DIR ) then
if ( -d "${WM_DIR}" ) foundDir="${WM_DIR}"
endif
if ( -d "$foundDir" ) then
setenv PATH "${foundDir}:${PATH}"
else
unsetenv WM_DIR
endif
# Prepend OpenFOAM scripts to the path
setenv PATH "${WM_PROJECT_DIR}/bin:${PATH}"
@ -346,7 +355,7 @@ endsw
# Cleanup
# ~~~~~~~
unset archDir siteDir
unset archDir siteDir foundDir
unset gcc_version gccDir
unset gmp_version gmpDir mpfr_version mpfrDir mpc_version mpcDir
unset clang_version clangDir