Files
openfoam/src/parallel/decompose/Allwmake
Mark Olesen 0e6a160639 ENH: improve handling of pt-scotch headers/libraries
- provide dedicated detection 'have_ptscotch' function that can be
  used after the 'have_scotch' function.

  It sets the PTSCOTCH_ARCH_PATH, PTSCOTCH_INC_DIR, PTSCOTCH_LIB_DIR
  and helps when the serial and parallel versions are located with
  different logic.
2019-04-05 13:10:53 +02:00

66 lines
1.6 KiB
Bash
Executable File

#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
. $WM_PROJECT_DIR/wmake/scripts/have_kahip
. $WM_PROJECT_DIR/wmake/scripts/have_metis
. $WM_PROJECT_DIR/wmake/scripts/have_scotch
#------------------------------------------------------------------------------
: ${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH} # Extra safety?
export FOAM_EXT_LIBBIN
#
# Define how to create an mpi-versioned library of $targetType
# compile into qualified directory
# use sentinel file(s) to handle version changes
#
wmakeMpiLib()
{
local decompName="$1"
local objectsDir
shift
for libName
do
(
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
objectsDir="$WM_PROJECT_DIR/build/$WM_OPTIONS/src/parallel/decompose/$libName"
whichmpi="$objectsDir/using:$FOAM_MPI"
whichdecomp="$objectsDir/using:$decompName"
[ -e "$whichmpi" -a -e "$whichdecomp" ] || wclean $libName
echo "wmake $targetType $libName"
wmake $targetType $libName
mkdir -p "$objectsDir"
touch "$whichdecomp" "$whichmpi"
)
done
}
wmakeLnInclude -u decompositionMethods
if have_scotch
then
wmake $targetType scotchDecomp
if have_ptscotch
then
wmakeMpiLib "$SCOTCH_VERSION" ptscotchDecomp
fi
fi
if have_metis
then
wmake $targetType metisDecomp
fi
if have_kahip
then
wmake $targetType kahipDecomp
fi
wmake $targetType decompositionMethods
wmake $targetType decompose
#------------------------------------------------------------------------------