diff --git a/etc/tools/ThirdPartyFunctions b/etc/tools/ThirdPartyFunctions index 3dd146c..1fa756c 100644 --- a/etc/tools/ThirdPartyFunctions +++ b/etc/tools/ThirdPartyFunctions @@ -92,6 +92,29 @@ whichMpicc() echo "${mpicc:-mpicc}" } +# The presence of wmkdep etc required for building with wmake +requireWMakeToolchain() +{ + local dir="${WM_DIR:-$WM_PROJECT_DIR/wmake}" + local src="$dir/src" + local bin="$dir/platforms/$WM_ARCH$WM_COMPILER/wmkdep" + + test -x $bin || { + echo "Warning: the 'wmkdep' binary is missing - attempting to build it" + ( cd $src && make -s ) + } + + test -x $bin || { + exec 1>&2 + echo + echo "Error: cannot use wmake build for '${0##*/}" + echo " The 'wmkdep' binary is missing" + echo " Please run the top-level OpenFOAM Allwmake first" + echo + exit 1 + } +} + #------------------------------------------------------------------------------ # Some functions as per OpenFOAM etc/config.sh/functions diff --git a/makeCCMIO b/makeCCMIO index 539111d..aaf3548 100755 --- a/makeCCMIO +++ b/makeCCMIO @@ -4,7 +4,7 @@ # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | # \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation -# \\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd. +# \\/ M anipulation | Copyright (C) 2016-2018 OpenCFD Ltd. #------------------------------------------------------------------------------ # License # This file is part of OpenFOAM, licensed under GNU General Public License @@ -89,6 +89,8 @@ do shift done +requireWMakeToolchain + #------------------------------------------------------------------------------ # # Build LIBCCMIO diff --git a/makeKAHIP b/makeKAHIP index a17b14b..e8aaaff 100755 --- a/makeKAHIP +++ b/makeKAHIP @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. +# \\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd. # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -119,6 +119,8 @@ then exit 0 fi +requireWMakeToolchain + #------------------------------------------------------------------------------ # # Build KaHIP