diff --git a/src/Pstream/Allwclean b/src/Pstream/Allwclean index c6b20903e8..fa3f2b327a 100755 --- a/src/Pstream/Allwclean +++ b/src/Pstream/Allwclean @@ -1,11 +1,10 @@ #!/bin/sh cd "${0%/*}" || exit # Run from this directory -. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions #------------------------------------------------------------------------------ wclean dummy -wcleanLibMpi mpi +./Allwclean-mpi #------------------------------------------------------------------------------ diff --git a/src/Pstream/Allwclean-mpi b/src/Pstream/Allwclean-mpi new file mode 100755 index 0000000000..d238e435a1 --- /dev/null +++ b/src/Pstream/Allwclean-mpi @@ -0,0 +1,9 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions + +#------------------------------------------------------------------------------ + +wcleanLibMpi mpi + +#------------------------------------------------------------------------------ diff --git a/src/Pstream/Allwmake b/src/Pstream/Allwmake index 7c89339442..dd2ad10d8a 100755 --- a/src/Pstream/Allwmake +++ b/src/Pstream/Allwmake @@ -1,13 +1,12 @@ #!/bin/sh cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments -. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions #------------------------------------------------------------------------------ echo "wmake $targetType dummy (mpi=$WM_MPLIB)" wmake $targetType dummy -wmakeLibMpi mpi +./Allwmake-mpi $targetType $* #------------------------------------------------------------------------------ diff --git a/src/Pstream/Allwmake-mpi b/src/Pstream/Allwmake-mpi new file mode 100755 index 0000000000..bc36b8cc32 --- /dev/null +++ b/src/Pstream/Allwmake-mpi @@ -0,0 +1,13 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +# No AllwmakeParseArguments [infinite loop via Allwmake] +. ${WM_PROJECT_DIR:?}/wmake/scripts/wmake.wmake-args +. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions + +#------------------------------------------------------------------------------ +# Environment +# - FOAM_MPI_LIBBIN (optional: defaults to FOAM_LIBBIN/FOAM_MPI) + +wmakeLibMpi mpi + +#------------------------------------------------------------------------------ diff --git a/src/Pstream/mpi/Make/files b/src/Pstream/mpi/Make/files index c01382d678..eccdf77664 100644 --- a/src/Pstream/mpi/Make/files +++ b/src/Pstream/mpi/Make/files @@ -3,4 +3,4 @@ UIPread.C UPstream.C PstreamGlobals.C -LIB = $(FOAM_LIBBIN)/$(FOAM_MPI)/libPstream +LIB = $(FOAM_MPI_LIBBIN)/libPstream diff --git a/src/Pstream/mpi/Make/options b/src/Pstream/mpi/Make/options index e255c81d10..7d010be785 100644 --- a/src/Pstream/mpi/Make/options +++ b/src/Pstream/mpi/Make/options @@ -1,6 +1,11 @@ sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB) sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB) +/* Default is PROJECT LIB/mpi target */ +ifeq (,$(FOAM_MPI_LIBBIN)) + FOAM_MPI_LIBBIN := $(FOAM_LIBBIN)/$(FOAM_MPI) +endif + EXE_INC = $(PFLAGS) $(PINC) $(c++LESSWARN) LIB_LIBS = $(PLIBS) diff --git a/src/parallel/decompose/Allwclean b/src/parallel/decompose/Allwclean index a9d95a9efe..e6b78d10c6 100755 --- a/src/parallel/decompose/Allwclean +++ b/src/parallel/decompose/Allwclean @@ -1,6 +1,5 @@ #!/bin/sh cd "${0%/*}" || exit # Run from this directory -. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions #------------------------------------------------------------------------------ @@ -10,6 +9,6 @@ wclean scotchDecomp wclean decompositionMethods wclean decompose -wcleanLibMpi ptscotchDecomp +./Allwclean-mpi #------------------------------------------------------------------------------ diff --git a/src/parallel/decompose/Allwclean-mpi b/src/parallel/decompose/Allwclean-mpi new file mode 100755 index 0000000000..2ae2186dc4 --- /dev/null +++ b/src/parallel/decompose/Allwclean-mpi @@ -0,0 +1,9 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions + +#------------------------------------------------------------------------------ + +wcleanLibMpi ptscotchDecomp + +#------------------------------------------------------------------------------ diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake index ad5d2931e6..c9bc6b610a 100755 --- a/src/parallel/decompose/Allwmake +++ b/src/parallel/decompose/Allwmake @@ -1,7 +1,6 @@ #!/bin/sh cd "${0%/*}" || exit # Run from this directory . ${WM_PROJECT_DIR:?}/wmake/scripts/AllwmakeParseArguments -. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions . ${WM_PROJECT_DIR:?}/wmake/scripts/have_kahip . ${WM_PROJECT_DIR:?}/wmake/scripts/have_metis . ${WM_PROJECT_DIR:?}/wmake/scripts/have_scotch @@ -27,12 +26,8 @@ fi if have_scotch then wmake $targetType scotchDecomp - - if have_ptscotch - then - wmakeLibMpi ptscotchDecomp "scotch=$SCOTCH_VERSION" - fi fi +./Allwmake-mpi $targetType $* #------------------------------------------------------------------------------ diff --git a/src/parallel/decompose/Allwmake-mpi b/src/parallel/decompose/Allwmake-mpi new file mode 100755 index 0000000000..6d89dc5179 --- /dev/null +++ b/src/parallel/decompose/Allwmake-mpi @@ -0,0 +1,24 @@ +#!/bin/sh +cd "${0%/*}" || exit # Run from this directory +# No AllwmakeParseArguments [infinite loop via Allwmake] +. ${WM_PROJECT_DIR:?}/wmake/scripts/wmake.wmake-args +. ${WM_PROJECT_DIR:?}/wmake/scripts/wmakeFunctions # Require wmake functions +. ${WM_PROJECT_DIR:?}/wmake/scripts/have_scotch + +#------------------------------------------------------------------------------ +# Environment +# - FOAM_MPI_LIBBIN (optional: defaults to FOAM_LIBBIN/FOAM_MPI) + +: "${FOAM_EXT_LIBBIN:=/usr/lib$WM_COMPILER_LIB_ARCH}" # Extra safety? +export FOAM_EXT_LIBBIN + +if have_scotch +then + if have_ptscotch + then + wmakeLibMpi ptscotchDecomp "scotch=$SCOTCH_VERSION" + fi +fi + + +#------------------------------------------------------------------------------ diff --git a/src/parallel/decompose/ptscotchDecomp/Make/files b/src/parallel/decompose/ptscotchDecomp/Make/files index 8f83423f7e..d2494e36ba 100644 --- a/src/parallel/decompose/ptscotchDecomp/Make/files +++ b/src/parallel/decompose/ptscotchDecomp/Make/files @@ -1,3 +1,3 @@ ptscotchDecomp.C -LIB = $(FOAM_LIBBIN)/$(FOAM_MPI)/libptscotchDecomp +LIB = $(FOAM_MPI_LIBBIN)/libptscotchDecomp diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options index 98e715ac73..5d56198ea8 100644 --- a/src/parallel/decompose/ptscotchDecomp/Make/options +++ b/src/parallel/decompose/ptscotchDecomp/Make/options @@ -5,6 +5,11 @@ sinclude $(GENERAL_RULES)/mplib$(WM_MPLIB) sinclude $(DEFAULT_RULES)/mplib$(WM_MPLIB) +/* Default is PROJECT LIB/mpi target */ +ifeq (,$(strip $(FOAM_MPI_LIBBIN))) + FOAM_MPI_LIBBIN := $(FOAM_LIBBIN)/$(FOAM_MPI) +endif + EXE_INC = \ -I$(PTSCOTCH_INC_DIR) \ -I$(SCOTCH_INC_DIR) \ @@ -22,8 +27,8 @@ LIB_LIBS = \ -lscotch \ -lptscotch -/* Combined into libptscotch for windows compile */ -ifneq ($(WM_OSTYPE),MSwindows) +/* errexit, except for windows compile (already in library) */ +ifeq (,$(findstring windows,$(WM_OSTYPE))) LIB_LIBS += -lptscotcherrexit endif diff --git a/src/parallel/decompose/scotchDecomp/Make/options b/src/parallel/decompose/scotchDecomp/Make/options index 1a4bd79edd..60f174becf 100644 --- a/src/parallel/decompose/scotchDecomp/Make/options +++ b/src/parallel/decompose/scotchDecomp/Make/options @@ -7,8 +7,8 @@ LIB_LIBS = \ -L$(SCOTCH_LIB_DIR) \ -lscotch -/* Combined into libscotch for windows compile */ -ifneq ($(WM_OSTYPE),MSwindows) +/* errexit, except for windows compile (already in library) */ +ifeq (,$(findstring windows,$(WM_OSTYPE))) LIB_LIBS += -lscotcherrexit endif