Commit 1f2ba251 authored by Mark Olesen's avatar Mark Olesen
Browse files

STYLE: inconsistency in scotch, metis library locations (issue #290)

- Only reference the FOAM_EXT_LIBBIN locations when linking.
  The respective SCOTCH_ARCH_PATH/lib, METIS_ARCH_PATH/lib locations
  either do not exist, or are possibly inconsistent and won't be
  seen at run-time anyhow.

- Incorporate decompose/metisDecomp/Allwmake into the top-level
  decompose/Allwmake
parent 91d5efdc
......@@ -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
......
#!/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
#------------------------------------------------------------------------------
......@@ -4,4 +4,5 @@ EXE_INC = \
-I../decompositionMethods/lnInclude
LIB_LIBS = \
-L$(METIS_ARCH_PATH)/lib -lmetis
-L$(FOAM_EXT_LIBBIN) \
-lmetis
......@@ -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 \
......
......@@ -12,7 +12,6 @@ EXE_INC = \
-I../decompositionMethods/lnInclude
LIB_LIBS = \
-L$(SCOTCH_ARCH_PATH)/lib \
-L$(FOAM_EXT_LIBBIN) \
-lscotch \
-lscotcherrexit \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment