From d716c59f57675a2d2ee105aaf606628c52fb0e31 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Fri, 19 Aug 2016 10:46:53 +0100
Subject: [PATCH] COMP: foamDebugSwitches: support for missing randomProcesses.
 Fixes #213.

---
 .../miscellaneous/foamDebugSwitches/Allwmake          | 11 +++++++++++
 .../miscellaneous/foamDebugSwitches/Make/options      |  2 +-
 2 files changed, 12 insertions(+), 1 deletion(-)
 create mode 100755 applications/utilities/miscellaneous/foamDebugSwitches/Allwmake

diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Allwmake b/applications/utilities/miscellaneous/foamDebugSwitches/Allwmake
new file mode 100755
index 00000000000..edc1f5f0dd9
--- /dev/null
+++ b/applications/utilities/miscellaneous/foamDebugSwitches/Allwmake
@@ -0,0 +1,11 @@
+#!/bin/sh
+cd ${0%/*} || exit 1    # run from this directory
+
+if [ -f "$FFTW_ARCH_PATH/include/fftw3.h" ] || \
+   [ "${FFTW_ARCH_PATH##*-}" = system -a -f "/usr/include/fftw3.h" ]
+then
+    export LINK_FLAGS="-lrandomProcesses"
+fi
+wmake
+
+#------------------------------------------------------------------------------
diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
index 0a415b6bfbd..14779c37357 100644
--- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
+++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
@@ -1,4 +1,5 @@
 EXE_LIBS = \
+    $(LINK_FLAGS) \
     -lsnappyHexMesh \
     -lbarotropicCompressibilityModel \
     -lsolidThermo \
@@ -41,7 +42,6 @@ EXE_LIBS = \
     -lOpenFOAM \
     -lpotential \
     -lradiationModels \
-    -lrandomProcesses \
     -lreactionThermophysicalModels \
     -lreconstruct \
     -lsampling \
-- 
GitLab