From 35d682a4fb541532c59facb8032d642d512a9181 Mon Sep 17 00:00:00 2001
From: Alexey Matveichev <alexey@matveichev.com>
Date: Fri, 1 Jun 2018 14:17:41 +0200
Subject: [PATCH] COMP: make the scotch librt dependency conditional

---
 src/parallel/decompose/ptscotchDecomp/Make/options | 7 ++++++-
 src/parallel/decompose/scotchDecomp/Make/options   | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options
index 733441c3fc7..4d8690985af 100644
--- a/src/parallel/decompose/ptscotchDecomp/Make/options
+++ b/src/parallel/decompose/ptscotchDecomp/Make/options
@@ -16,4 +16,9 @@ LIB_LIBS = \
     -L$(FOAM_EXT_LIBBIN) \
     -L$(FOAM_EXT_LIBBIN)/$(FOAM_MPI) \
     -lptscotch -lptscotcherrexit \
-    -lscotch -lrt
+    -lscotch
+
+/* May require librt, but scotch does not declare the dependency */
+ifeq ("$(SO)","so")
+    LIB_LIBS += -lrt
+endif
diff --git a/src/parallel/decompose/scotchDecomp/Make/options b/src/parallel/decompose/scotchDecomp/Make/options
index d2165b174da..6846910c047 100644
--- a/src/parallel/decompose/scotchDecomp/Make/options
+++ b/src/parallel/decompose/scotchDecomp/Make/options
@@ -12,4 +12,9 @@ EXE_INC = \
 
 LIB_LIBS = \
     -L$(SCOTCH_LIB_DIR) \
-    -lscotch -lscotcherrexit -lrt
+    -lscotch -lscotcherrexit
+
+/* May require librt, but scotch does not declare the dependency */
+ifeq ("$(SO)","so")
+    LIB_LIBS += -lrt
+endif
-- 
GitLab