From 326b646bb84765a04fc091bda443de01c7b4e659 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sat, 11 Jun 2016 16:28:40 +0100 Subject: [PATCH] Allwmake -update: Further improvements to handle source-tree/dep file inconsistencies after git pull Patch contributed by Bruno Santos Resolves bug-report http://bugs.openfoam.org/view.php?id=2091 --- src/parallel/decompose/Allwclean | 61 +++++++++++++++++++++++ wmake/scripts/AllwmakeParseArguments | 12 ++++- wmake/scripts/wmakeFunctions | 6 ++- wmake/wclean | 73 ++++++++++++++++++++++++++-- 4 files changed, 145 insertions(+), 7 deletions(-) create mode 100755 src/parallel/decompose/Allwclean diff --git a/src/parallel/decompose/Allwclean b/src/parallel/decompose/Allwclean new file mode 100755 index 0000000000..f984966f85 --- /dev/null +++ b/src/parallel/decompose/Allwclean @@ -0,0 +1,61 @@ +#!/bin/sh +cd ${0%/*} || exit 1 # Run from this directory + +# Parse arguments for library compilation +targetType=libso +. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments + +# get SCOTCH_VERSION, SCOTCH_ARCH_PATH +if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch` +then + . $settings + echo "using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH" +else + echo + echo "Error: no config.sh/scotch settings" + echo +fi + + +# +# define how to clean an mpi-versioned library +# +wcleanMpiLib() +{ + set +x + for libName + do + ( + WM_OPTIONS="$WM_OPTIONS$WM_MPLIB" + whichmpi="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/parallel/decompose/$libName/using:$FOAM_MPI" + whichscotch="$WM_PROJECT_DIR/platforms/$WM_OPTIONS/src/parallel/decompose/$libName/using:$SCOTCH_VERSION" + wclean $targetType $libName + ) + done + set -x +} + +set -x + +if [ -n "$SCOTCH_ARCH_PATH" ] +then + wclean scotchDecomp + + if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ] + then + wcleanMpiLib ptscotchDecomp + fi +else + echo + echo "Skipping scotchDecomp (ptscotchDecomp)" + echo +fi + + +wclean metisDecomp + +wclean decompositionMethods + +wclean decompose + +#------------------------------------------------------------------------------ diff --git a/wmake/scripts/AllwmakeParseArguments b/wmake/scripts/AllwmakeParseArguments index 941ad64928..d77c86fab2 100644 --- a/wmake/scripts/AllwmakeParseArguments +++ b/wmake/scripts/AllwmakeParseArguments @@ -55,7 +55,8 @@ options: -j Compile using all local cores/hyperthreads -jN or -j N Compile using N cores/hyperthreads -no-scheduler Compile without wmakeScheduler - -update Update lnInclude directories and dep files + -update Update lnInclude directories, dep files, remove deprecated + files and directories USAGE # Print options for building code documentation @@ -123,10 +124,17 @@ do -no-scheduler) unset WM_SCHEDULER ;; - # Update lnInclude directories and dep files following a pull + # Meant to be used following a pull, this will: + # - remove dep files that depend on deleted files; + # - remove stale dep files; + # - update lnInclude directories; + # - remove empty directories, along with deprecated object directories + # and respective binaries. -update) wrmdep -update + wrmdep -old wmakeLnIncludeAll + wclean empty # Set WM_UPDATE_DEPENDENCIES, so that wmake will pick up on it export WM_UPDATE_DEPENDENCIES=yes diff --git a/wmake/scripts/wmakeFunctions b/wmake/scripts/wmakeFunctions index c011519b87..f0d8ad143d 100755 --- a/wmake/scripts/wmakeFunctions +++ b/wmake/scripts/wmakeFunctions @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2015-2016 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -101,7 +101,9 @@ findObjectDir() depToSource() { sourceFile=$(echo ${depFile%.dep} | \ - sed -e s%platforms/${WM_OPTIONS}/%% -e s%Make/${WM_OPTIONS}/%% ) + sed -e s%platforms/${WM_OPTIONS}/%% -e s%Make/${WM_OPTIONS}/%% \ + -e s%platforms/${WM_OPTIONS}${WM_MPLIB}/%% \ + -e s%Make/${WM_OPTIONS}${WM_MPLIB}/%% ) } #------------------------------------------------------------------------------ diff --git a/wmake/wclean b/wmake/wclean index c4f3808ba5..d71f9d87ac 100755 --- a/wmake/wclean +++ b/wmake/wclean @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------- # License @@ -36,6 +36,9 @@ #------------------------------------------------------------------------------ Script=${0##*/} +# Source the wmake functions +. ${0%/*}/scripts/wmakeFunctions + usage() { while [ "$#" -ge 1 ]; do echo "$1"; shift; done cat</dev/null + fi + + # Remove the deprecated object directory + rm -rvf $depFile 2>/dev/null + fi + done + + echo "Search for deprecated object directories complete." + fi + fi + exit 0 fi