Adjusting the environment variables when using the system-installed version of

the metis, parMetis and scotch packages.
This commit is contained in:
Martin Beaudoin 2021-07-07 23:54:42 -04:00
parent 9ffbe794a9
commit b42fb8a346
2 changed files with 93 additions and 45 deletions

View file

@ -502,6 +502,21 @@ if ( $?CGAL_LIB_DIR ) then
_foamAddLib $CGAL_LIB_DIR _foamAddLib $CGAL_LIB_DIR
endif endif
# Third party packages
#
# In order to use a pre-installed version of the ThirdParty packages, just set the
# appropriate XXX_SYSTEM environment variable for a given package in your prefs.sh
# file in order to disable the activation of the ThirdParty version of the same package.
# Default locations for pre-installed version of the ThirdParty packages
# Use prefs.sh to pre-initialize to different default values, accordingly to
# your Linux/Unix flavour
if ( ! $?WM_SYSTEM_DIR ) setenv WM_SYSTEM_DIR /usr
if ( ! $?WM_SYSTEM_BIN_DIR ) setenv WM_SYSTEM_BIN_DIR $WM_SYSTEM_DIR/bin
if ( ! $?WM_SYSTEM_LIB_DIR ) setenv WM_SYSTEM_LIB_DIR $WM_SYSTEM_DIR/lib
if ( ! $?WM_SYSTEM_INCLUDE_DIR ) setenv WM_SYSTEM_INCLUDE_DIR $WM_SYSTEM_DIR/include
# Mesquite library if available # Mesquite library if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( $?MESQUITE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_MESQUITE_212 != 0 && -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS ) then if ( $?MESQUITE_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_MESQUITE_212 != 0 && -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS ) then
@ -514,24 +529,32 @@ endif
# Metis library if available # Metis library if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( $?METIS_SYSTEM) then if ( $?METIS_SYSTEM) then
setenv METIS_DIR /usr # Using system libraries.
setenv METIS_BIN_DIR /usr/bin # Some values might already be pre-initialized in prefs.sh
setenv METIS_LIB_DIR /lib # If not, use the default WM_SYSTEM_XXX values
setenv METIS_INCLUDE_DIR /usr/include if ( ! $?METIS_DIR ) setenv METIS_DIR $WM_SYSTEM_DIR
if ( ! $?METIS_BIN_DIR ) setenv METIS_BIN_DIR $WM_SYSTEM_BIN_DIR
if ( ! $?METIS_LIB_DIR ) setenv METIS_LIB_DIR $WM_SYSTEM_LIB_DIR
if ( ! $?METIS_INCLUDE_DIR ) setenv METIS_INCLUDE_DIR $WM_SYSTEM_INCLUDE_DIR
endif endif
if ( $?METIS_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_METIS_510 != 0 && -e $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS ) then if ( $?METIS_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_METIS_510 != 0 && -e $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS ) then
# Using ThirdParty package for Metis
_foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS/etc/metis-5.1.0.csh _foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS/etc/metis-5.1.0.csh
endif endif
# ParMetis library if available # ParMetis library if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( $?PARMETIS_SYSTEM) then if ( $?PARMETIS_SYSTEM) then
setenv PARMETIS_DIR /usr # Using system libraries.
setenv PARMETIS_BIN_DIR /usr/bin # Some values might already be pre-initialized in prefs.sh
setenv PARMETIS_LIB_DIR /lib # If not, use the default WM_SYSTEM_XXX values
setenv PARMETIS_INCLUDE_DIR /usr/include if ( ! $?PARMETIS_DIR ) setenv PARMETIS_DIR $WM_SYSTEM_DIR
if ( ! $?PARMETIS_BIN_DIR ) setenv PARMETIS_BIN_DIR $WM_SYSTEM_BIN_DIR
if ( ! $?PARMETIS_LIB_DIR ) setenv PARMETIS_LIB_DIR $WM_SYSTEM_LIB_DIR
if ( ! $?PARMETIS_INCLUDE_DIR ) setenv PARMETIS_INCLUDE_DIR $WM_SYSTEM_INCLUDE_DIR
endif endif
if ( $?PARMETIS_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARMETIS_403 != 0 && -e $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS ) then if ( $?PARMETIS_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_PARMETIS_403 != 0 && -e $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS ) then
# Using ThirdParty package for ParMetis
_foamSource $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS/etc/parmetis-4.0.3.csh _foamSource $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS/etc/parmetis-4.0.3.csh
endif endif
@ -551,12 +574,16 @@ endif
# Scotch library if available # Scotch library if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~
if ( $?SCOTCH_SYSTEM) then if ( $?SCOTCH_SYSTEM) then
setenv SCOTCH_DIR /usr # Using system libraries.
setenv SCOTCH_BIN_DIR /usr/bin # Some values might already be pre-initialized in prefs.sh
setenv SCOTCH_LIB_DIR /lib # If not, use the default WM_SYSTEM_XXX values
setenv SCOTCH_INCLUDE_DIR /usr/include/scotch if ( ! $?SCOTCH_DIR ) setenv SCOTCH_DIR $WM_SYSTEM_DIR
if ( ! $?SCOTCH_BIN_DIR ) setenv SCOTCH_BIN_DIR $WM_SYSTEM_BIN_DIR
if ( ! $?SCOTCH_LIB_DIR ) setenv SCOTCH_LIB_DIR $WM_SYSTEM_LIB_DIR
if ( ! $?SCOTCH_INCLUDE_DIR ) setenv SCOTCH_INCLUDE_DIR $WM_SYSTEM_INCLUDE_DIR
endif endif
if ( $?SCOTCH_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_SCOTCH_604 != 0 && -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.4/platforms/$WM_OPTIONS ) then if ( $?SCOTCH_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_SCOTCH_604 != 0 && -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.4/platforms/$WM_OPTIONS ) then
# Using ThirdParty package for Scotch
_foamSource $WM_THIRD_PARTY_DIR/packages/scotch-6.0.4/platforms/$WM_OPTIONS/etc/scotch-6.0.4.csh _foamSource $WM_THIRD_PARTY_DIR/packages/scotch-6.0.4/platforms/$WM_OPTIONS/etc/scotch-6.0.4.csh
endif endif
if ( $?SCOTCH_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_SCOTCH_600 != 0 && -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS ) then if ( $?SCOTCH_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_SCOTCH_600 != 0 && -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS ) then

View file

@ -602,6 +602,14 @@ export MPI_BUFFER_SIZE
# appropriate XXX_SYSTEM environment variable for a given package in your prefs.sh # appropriate XXX_SYSTEM environment variable for a given package in your prefs.sh
# file in order to disable the activation of the ThirdParty version of the same package. # file in order to disable the activation of the ThirdParty version of the same package.
# Default locations for pre-installed version of the ThirdParty packages
# Use prefs.sh to pre-initialize to different default values, accordingly to
# your Linux/Unix flavour
: ${WM_SYSTEM_DIR:=/usr}; export WM_SYSTEM_DIR
: ${WM_SYSTEM_BIN_DIR:=$WM_SYSTEM_DIR/bin}; export WM_SYSTEM_BIN_DIR
: ${WM_SYSTEM_LIB_DIR:=$WM_SYSTEM_DIR/lib}; export WM_SYSTEM_LIB_DIR
: ${WM_SYSTEM_INCLUDE_DIR:=$WM_SYSTEM_DIR/include}; export WM_SYSTEM_INCLUDE_DIR
# Load Mesquite library # Load Mesquite library
# ~~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~~
[ -z "$MESQUITE_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_MESQUITE_212 ] && [ -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS ] && { [ -z "$MESQUITE_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_MESQUITE_212 ] && [ -e $WM_THIRD_PARTY_DIR/packages/mesquite-2.1.2/platforms/$WM_OPTIONS ] && {
@ -616,31 +624,41 @@ export MPI_BUFFER_SIZE
# Load Metis library # Load Metis library
# ~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~
[ ! -z "$METIS_SYSTEM" ] && { if [ ! -z "$METIS_SYSTEM" ]
export METIS_DIR=/usr then
export METIS_BIN_DIR=/usr/bin # Using system libraries.
export METIS_LIB_DIR=/lib # Some values might already be pre-initialized in prefs.sh
export METIS_INCLUDE_DIR=/usr/include # If not, use the default WM_SYSTEM_XXX values
} : ${METIS_DIR:=$WM_SYSTEM_DIR}; export METIS_DIR
: ${METIS_BIN_DIR:=$WM_SYSTEM_BIN_DIR}; export METIS_BIN_DIR
[ -z "$METIS_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_METIS_510 ] && [ -e $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS ] && { : ${METIS_LIB_DIR:=$WM_SYSTEM_LIB_DIR}; export METIS_LIB_DIR
: ${METIS_INCLUDE_DIR:=$WM_SYSTEM_INCLUDE_DIR}; export METIS_INCLUDE_DIR
else
# Using ThirdParty package for Metis
[ ! -z $WM_THIRD_PARTY_USE_METIS_510 ] && [ -e $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS/etc/metis-5.1.0.sh _foamSource $WM_THIRD_PARTY_DIR/packages/metis-5.1.0/platforms/$WM_OPTIONS/etc/metis-5.1.0.sh
} }
fi
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " METIS_DIR is initialized to: $METIS_DIR" [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " METIS_DIR is initialized to: $METIS_DIR"
# Load ParMetis library # Load ParMetis library
# ~~~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~~~
[ ! -z "$PARMETIS_SYSTEM" ] && { if [ ! -z "$PARMETIS_SYSTEM" ]
export PARMETIS_DIR=/usr then
export PARMETIS_BIN_DIR=/usr/bin # Using system libraries
export PARMETIS_LIB_DIR=/lib # Some values might already be pre-initialized in prefs.sh
export PARMETIS_INCLUDE_DIR=/usr/include # If not, use the default WM_SYSTEM_XXX values
} : ${PARMETIS_DIR:=$WM_SYSTEM_DIR}; export PARMETIS_DIR
: ${PARMETIS_BIN_DIR:=$WM_SYSTEM_BIN_DIR}; export PARMETIS_BIN_DIR
[ -z "$PARMETIS_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_PARMETIS_403 ] && [ -e $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS ] && { : ${PARMETIS_LIB_DIR:=$WM_SYSTEM_LIB_DIR}; export PARMETIS_LIB_DIR
_foamSource $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS/etc/parmetis-4.0.3.sh : ${PARMETIS_INCLUDE_DIR:=$WM_SYSTEM_INCLUDE_DIR}; export PARMETIS_INCLUDE_DIR
} else
# Using ThirdParty package for ParMetis
[ ! -z $WM_THIRD_PARTY_USE_PARMETIS_403 ] && [ -e $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/parmetis-4.0.3/platforms/$WM_OPTIONS/etc/parmetis-4.0.3.sh
}
fi
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PARMETIS_DIR is initialized to: $PARMETIS_DIR" [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " PARMETIS_DIR is initialized to: $PARMETIS_DIR"
@ -662,21 +680,24 @@ export MPI_BUFFER_SIZE
# Load Scotch library # Load Scotch library
# ~~~~~~~~~~~~~~~~~~~ # ~~~~~~~~~~~~~~~~~~~
[ ! -z "$SCOTCH_SYSTEM" ] && { if [ ! -z "$SCOTCH_SYSTEM" ]
export SCOTCH_DIR=/usr then
export SCOTCH_BIN_DIR=/usr/bin # Using system libraries
export SCOTCH_LIB_DIR=/lib # Some values might already be pre-initialized in prefs.sh
export SCOTCH_INCLUDE_DIR=/usr/include/scotch # If not, use the default WM_SYSTEM_XXX values
} : ${SCOTCH_DIR:=$WM_SYSTEM_DIR}; export SCOTCH_DIR
: ${SCOTCH_BIN_DIR:=$WM_SYSTEM_BIN_DIR}; export SCOTCH_BIN_DIR
[ -z "$SCOTCH_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_SCOTCH_604 ] && [ -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.4/platforms/$WM_OPTIONS ] && { : ${SCOTCH_LIB_DIR:=$WM_SYSTEM_LIB_DIR}; export SCOTCH_LIB_DIR
_foamSource $WM_THIRD_PARTY_DIR/packages/scotch-6.0.4/platforms/$WM_OPTIONS/etc/scotch-6.0.4.sh : ${SCOTCH_INCLUDE_DIR:=$WM_SYSTEM_INCLUDE_DIR}; export SCOTCH_INCLUDE_DIR
} else
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " SCOTCH_DIR is initialized to: $SCOTCH_DIR" # Using ThirdParty package for Scotch
[ ! -z $WM_THIRD_PARTY_USE_SCOTCH_604 ] && [ -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.4/platforms/$WM_OPTIONS ] && {
[ -z "$SCOTCH_SYSTEM" ] && [ ! -z $WM_THIRD_PARTY_USE_SCOTCH_600 ] && [ -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS ] && { _foamSource $WM_THIRD_PARTY_DIR/packages/scotch-6.0.4/platforms/$WM_OPTIONS/etc/scotch-6.0.4.sh
_foamSource $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS/etc/scotch-6.0.0.sh }
[ ! -z $WM_THIRD_PARTY_USE_SCOTCH_600 ] && [ -e $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS ] && {
_foamSource $WM_THIRD_PARTY_DIR/packages/scotch-6.0.0/platforms/$WM_OPTIONS/etc/scotch-6.0.0.sh
} }
fi
[ "$FOAM_VERBOSE" -a "$PS1" ] && echo " SCOTCH_DIR is initialized to: $SCOTCH_DIR" [ "$FOAM_VERBOSE" -a "$PS1" ] && echo " SCOTCH_DIR is initialized to: $SCOTCH_DIR"