diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake index 6652ef62867774d8a062aef9799e73ea61fbfbc5..9be81484758a98b4a90dcfd10a735bf4f1ee719b 100755 --- a/src/parallel/decompose/Allwmake +++ b/src/parallel/decompose/Allwmake @@ -4,8 +4,21 @@ cd ${0%/*} || exit 1 # Run from this directory # Parse arguments for library compilation . $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments +unset METIS_ARCH_PATH SCOTCH_ARCH_PATH + +# get METIS_VERSION, METIS_ARCH_PATH +if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) +then + . $settings + echo "using METIS_ARCH_PATH=$METIS_ARCH_PATH" +else + echo + echo "Error: no config.sh/metis settings" + echo +fi + # get SCOTCH_VERSION, SCOTCH_ARCH_PATH -if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch` +if settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) then . $settings echo "using SCOTCH_ARCH_PATH=$SCOTCH_ARCH_PATH" @@ -45,21 +58,12 @@ set -x wmakeLnInclude decompositionMethods -if [ -n "$SCOTCH_ARCH_PATH" ] +if [ -f $SCOTCH_ARCH_PATH/include/scotch.h \ + -a -r $FOAM_EXT_LIBBIN/libscotch.so ] then wmake $targetType scotchDecomp - if [ -d "$FOAM_LIBBIN/$FOAM_MPI" ] then - #- Bit of a hack: ptscotch 6 requires scotch linked as well as. Can be - # removed once ptscotch declares dependency on scotch itself. - case "$SCOTCH_VERSION" in - scotch_6.*) - export LINK_FLAGS="-lscotch" - ;; - esac - - wmakeMpiLib ptscotchDecomp fi else @@ -69,8 +73,15 @@ else fi -# Try and build metisDecomp (has own logic) -(cd metisDecomp && ./Allwmake $targetType) +if [ -f $METIS_ARCH_PATH/include/metis.h \ + -a -r $FOAM_EXT_LIBBIN/libmetis.so ] +then + wmake $targetType metisDecomp +else + echo + echo "Skipping metisDecomp: metis not installed" + echo +fi wmake $targetType decompositionMethods diff --git a/src/parallel/decompose/metisDecomp/Allwmake b/src/parallel/decompose/metisDecomp/Allwmake deleted file mode 100755 index 2f666aba2bb31c2c61e2d945562732b074b8bc2f..0000000000000000000000000000000000000000 --- a/src/parallel/decompose/metisDecomp/Allwmake +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Parse arguments for library compilation -. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments - -# get METIS_VERSION, METIS_ARCH_PATH -if settings=`$WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis` -then - . $settings - echo "using METIS_ARCH_PATH=$METIS_ARCH_PATH" - if [ -r $METIS_ARCH_PATH/lib/libmetis.so ] - then - wmake $targetType - fi -else - echo - echo "Error: no config.sh/metis settings" - echo -fi - - -#------------------------------------------------------------------------------ diff --git a/src/parallel/decompose/metisDecomp/Make/options b/src/parallel/decompose/metisDecomp/Make/options index 8acd678fd3f2dacf7f6fdceb5aa7b120ba19876a..fdb35bf1e2708ee79d78d32fa176b3c28e864d6f 100644 --- a/src/parallel/decompose/metisDecomp/Make/options +++ b/src/parallel/decompose/metisDecomp/Make/options @@ -4,4 +4,5 @@ EXE_INC = \ -I../decompositionMethods/lnInclude LIB_LIBS = \ - -L$(METIS_ARCH_PATH)/lib -lmetis + -L$(FOAM_EXT_LIBBIN) \ + -lmetis diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options index cb407ec6b5c8646d634e0d4bc169a3e40c4946b5..37286e91aa0141ba5cb8ca0dd7e918e583ce3d6d 100644 --- a/src/parallel/decompose/ptscotchDecomp/Make/options +++ b/src/parallel/decompose/ptscotchDecomp/Make/options @@ -8,8 +8,12 @@ EXE_INC = \ -I/usr/include/scotch \ -I../decompositionMethods/lnInclude +/* + * The '-lscotch' is a slight hack: + * ptscotch 6 requires scotch linked in, but does not declare the dependency + */ LIB_LIBS = \ - -L$(SCOTCH_ARCH_PATH)/lib \ + -L$(FOAM_EXT_LIBBIN) \ -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) \ -lptscotch \ -lptscotcherrexit \ diff --git a/src/parallel/decompose/scotchDecomp/Make/options b/src/parallel/decompose/scotchDecomp/Make/options index d2cc770692ce384821691c05ef08cd3d47e9a9a5..4bee67053c2708e0acf1a5f9626c526d1d15bc1e 100644 --- a/src/parallel/decompose/scotchDecomp/Make/options +++ b/src/parallel/decompose/scotchDecomp/Make/options @@ -12,7 +12,6 @@ EXE_INC = \ -I../decompositionMethods/lnInclude LIB_LIBS = \ - -L$(SCOTCH_ARCH_PATH)/lib \ -L$(FOAM_EXT_LIBBIN) \ -lscotch \ -lscotcherrexit \