- it is now possible to include the selected mpi version in the top-level bashrc or prefs.sh file. For example, WM_MPLIB=OPENMPI-4.1.1 or WM_MPLIB=openmpi-4.1.1 after evaluation of the config.sh/mpi, this will define WM_MPLIB=OPENMPI-4.1.1 and FOAM_MPI=openmpi-4.1.1 During the wmake, the mpi-rules will first load the MPI 'family' rules (OPENMPI in this example) before trying to load version-specific rules if they exist. NOTE: the regular user-defined prefs system is unaffected by this change. This means it is still possible to use a file such as 'prefs.openmpi' to define the preferred version instead or as well. However, it does mean inconsistent naming can be specified. For example, specify WM_MPLIB=OPENMPI-4.1.1 at the top-level but actually have FOAM_MPI=openmpi-4.0.6 in the prefs.openmpi file. This will make the value of WM_MPLIB misleading. CONFIG: foamConfigurePaths support for sys-openmpi major version CONFIG: cleanup any shadow env variables
91 lines
3.1 KiB
Bash
91 lines
3.1 KiB
Bash
#----------------------------------*-sh-*--------------------------------------
|
|
# ========= |
|
|
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
# \\ / O peration |
|
|
# \\ / A nd | www.openfoam.com
|
|
# \\/ M anipulation |
|
|
#------------------------------------------------------------------------------
|
|
# Copyright (C) 2018-2020 OpenCFD Ltd.
|
|
#------------------------------------------------------------------------------
|
|
# License
|
|
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
|
|
#
|
|
# File
|
|
# etc/config.csh/functions
|
|
# - sourced by OpenFOAM-*/etc/cshrc
|
|
#
|
|
# Description
|
|
# C-shell aliases and variables used when sourcing the OpenFOAM environment
|
|
#
|
|
# Some functionality implemented via bin/tools/lib-dir
|
|
#
|
|
# Defined Variables
|
|
# foamClean : path to bin/foamCleanPath
|
|
# _foam_uname_s : cache value for `uname -s`
|
|
#
|
|
# Defined Functions (Aliases)
|
|
# _foamClean : eval call to foamCleanPath for specific shell
|
|
# _foamEcho : silent/non-silent echo
|
|
# _foamEtc : resolve etc files (silent or verbose)
|
|
# _foamAddPath : prepend to PATH
|
|
# _foamAddMan : prepend to MANPATH
|
|
# _foamAddLib : prepend to [DY]LD_LIBRARY_PATH
|
|
# _foamAddLibAuto: call to lib-dir for lib64/lib resolved name
|
|
#
|
|
#------------------------------------------------------------------------------
|
|
|
|
# Cleaning environment variables
|
|
alias _foamClean 'eval `$WM_PROJECT_DIR/bin/foamCleanPath -csh-env=\!*`'
|
|
|
|
# Cache value for `uname -s`
|
|
set _foam_uname_s=`uname -s`
|
|
|
|
# Prepend PATH, MANPATH, LD_LIBRARY_PATH
|
|
alias _foamAddPath 'setenv PATH \!*\:${PATH}'
|
|
alias _foamAddMan 'setenv MANPATH \!*\:${MANPATH}'
|
|
|
|
# Special treatment for Darwin
|
|
# - DYLD_LIBRARY_PATH instead of LD_LIBRARY_PATH
|
|
if ("${_foam_uname_s}" == "Darwin") then
|
|
alias _foamAddLib 'setenv DYLD_LIBRARY_PATH \!*\:${DYLD_LIBRARY_PATH}'
|
|
else
|
|
alias _foamAddLib 'setenv LD_LIBRARY_PATH \!*\:${LD_LIBRARY_PATH}'
|
|
endif
|
|
|
|
# Prefix to LD_LIBRARY_PATH with additional checking
|
|
# $1 = base directory for 'lib' or 'lib64'
|
|
# $2 = fallback libname ('lib' or 'lib64')
|
|
alias _foamAddLibAuto 'eval `$WM_PROJECT_DIR/bin/tools/lib-dir -csh \!*`'
|
|
|
|
# Echo values when FOAM_VERBOSE is on, no-op otherwise
|
|
# Source an etc file, possibly with some verbosity
|
|
if ($?FOAM_VERBOSE && $?prompt) then
|
|
alias _foamEcho 'echo \!*'
|
|
alias _foamEtc 'eval `$WM_PROJECT_DIR/bin/foamEtcFile -csh-verbose \!*`'
|
|
else
|
|
alias _foamEcho 'true'
|
|
alias _foamEtc 'eval `$WM_PROJECT_DIR/bin/foamEtcFile -csh \!*`'
|
|
endif
|
|
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Avoid any ThirdParty settings that may have 'leaked' into the environment
|
|
|
|
unsetenv MPI_ARCH_PATH
|
|
unsetenv ADIOS_ARCH_PATH
|
|
unsetenv ADIOS1_ARCH_PATH
|
|
unsetenv ADIOS2_ARCH_PATH
|
|
unsetenv BOOST_ARCH_PATH
|
|
unsetenv CCMIO_ARCH_PATH
|
|
unsetenv CGAL_ARCH_PATH
|
|
unsetenv FFTW_ARCH_PATH
|
|
unsetenv GPERFTOOLS_ARCH_PATH
|
|
unsetenv GMP_ARCH_PATH
|
|
unsetenv MPFR_ARCH_PATH
|
|
unsetenv LLVM_ARCH_PATH
|
|
unsetenv MESA_ARCH_PATH
|
|
unsetenv METIS_ARCH_PATH
|
|
unsetenv SCOTCH_ARCH_PATH
|
|
|
|
#------------------------------------------------------------------------------
|