COMP: add sentinels to catch mpi or scotch version changes when compiling

This commit is contained in:
Mark Olesen 2011-04-28 16:26:00 +02:00
parent 22fae65263
commit b646589996
2 changed files with 58 additions and 14 deletions

View File

@ -1,8 +1,31 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
makeType=${1:-libso}
set -x
#
# define how to create an mpi-versioned library of $makeType
# compile into qualified directory
# use sentinel file to handle version changes
#
wmakeMpiLib()
{
set +x
for libName
do
(
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
whichmpi="$libName/Make/$WM_OPTIONS/using:$FOAM_MPI"
[ -e "$whichmpi" ] || wclean $libName
echo "wmake $makeType $libName"
wmake $makeType $libName
touch "$whichmpi"
)
done
set -x
}
set -x
wmake $makeType dummy
case "$WM_MPLIB" in
@ -11,9 +34,7 @@ case "$WM_MPLIB" in
echo
echo "Note: ignore spurious warnings about missing mpicxx.h headers"
echo
set -x
# force compilation into qualified directory
WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB wmake $makeType mpi
wmakeMpiLib mpi
;;
#GAMMA)

View File

@ -3,8 +3,7 @@ cd ${0%/*} || exit 1 # run from this directory
makeType=${1:-libso}
# get SCOTCH_VERSION, SCOTCH_ARCH_PATH
settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc`
if [ -f "$settings" ]
if settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc`
then
. $settings
echo "using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH"
@ -13,21 +12,45 @@ else
echo "Error: no apps/scotch/bashrc settings"
echo
fi
#
# define how to create an mpi-versioned library of $makeType
# compile into qualified directory
# use sentinel file to handle version changes
#
wmakeMpiLib()
{
set +x
for libName
do
(
WM_OPTIONS="$WM_OPTIONS$WM_MPLIB"
whichmpi="$libName/Make/$WM_OPTIONS/using:$FOAM_MPI"
whichscotch="$libName/Make/$WM_OPTIONS/using:$SCOTCH_VERSION"
[ -e "$whichmpi" -a -e "$whichscotch" ] || wclean $libName
echo "wmake $makeType $libName"
wmake $makeType $libName
touch "$whichmpi" "$whichscotch"
)
done
set -x
}
set -x
wmakeLnInclude decompositionMethods
wmake $makeType scotchDecomp
if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ]
if [ -n "$SCOTCH_ARCH_PATH" ]
then
(
WM_OPTIONS=${WM_OPTIONS}$WM_MPLIB
wmake $makeType ptscotchDecomp
)
wmake $makeType scotchDecomp
[ -d "$FOAM_LIBBIN/$FOAM_MPI" ] && wmakeMpiLib ptscotchDecomp
else
echo
echo "Skipping scotchDecomp (ptscotchDecomp)"
echo
fi
wmake $makeType decompositionMethods
# ----------------------------------------------------------------- end-of-file