From 5a5a08f009332b68c8ddec4106e5a2cc5a83e543 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Wed, 11 Oct 2017 18:41:28 +0200
Subject: [PATCH] COMP: handle kahip .so version, and openmp dependency

---
 applications/test/checkDecomposePar/Make/options | 1 +
 etc/config.sh/kahip                              | 4 ++--
 src/parallel/decompose/Allwmake                  | 3 +++
 3 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/applications/test/checkDecomposePar/Make/options b/applications/test/checkDecomposePar/Make/options
index 74501c5fdd..7032381823 100644
--- a/applications/test/checkDecomposePar/Make/options
+++ b/applications/test/checkDecomposePar/Make/options
@@ -6,5 +6,6 @@ EXE_INC = \
     -I$(LIB_SRC)/regionModels/regionModel/lnInclude
 
 EXE_LIBS = \
+    -ldecompose \
     -ldecompositionMethods \
     -lregionModels
diff --git a/etc/config.sh/kahip b/etc/config.sh/kahip
index 9212e7a80a..21d7a8a84a 100644
--- a/etc/config.sh/kahip
+++ b/etc/config.sh/kahip
@@ -42,7 +42,7 @@
 #     An Int64 OpenFOAM version can use it, but the mesh size is limited
 #     accordingly.
 #
-#     If KaHIP was compiled with openmp, you may need to add in additional
+#     If KaHIP was compiled with openmp, you may need additional
 #     compile or link flags in KAHIP_COMP_FLAGS KAHIP_LINK_FLAGS
 #
 #------------------------------------------------------------------------------
@@ -53,7 +53,7 @@ export KAHIP_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$KAHIP
 
 # Adjust as required
 # export KAHIP_COMP_FLAGS="-fopenmp"
-# export KAHIP_LINK_FLAGS="-lgomp"
+export KAHIP_LINK_FLAGS="-lgomp"
 
 # END OF (NORMAL) USER EDITABLE PART
 #------------------------------------------------------------------------------
diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake
index 19dced9e31..39c8f109a5 100755
--- a/src/parallel/decompose/Allwmake
+++ b/src/parallel/decompose/Allwmake
@@ -58,8 +58,11 @@ hasKahip()
     # Library
     [ "${KAHIP_ARCH_PATH##*-}" = system ] || \
     findFirstFile \
+        $FOAM_EXT_LIBBIN/libkahip.so \
         $KAHIP_ARCH_PATH/lib/libkahip.a  \
+        $KAHIP_ARCH_PATH/lib/libkahip.so \
         $KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libkahip.a \
+        $KAHIP_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libkahip.so \
     > /dev/null || {
         echo "$warning (missing library)"
         return 2
-- 
GitLab