From 061379ce8a3a8b20ea974b93b1c6bc913e3838ee Mon Sep 17 00:00:00 2001
From: Matthieu Schaller <schaller@strw.leidenuniv.nl>
Date: Mon, 6 Aug 2018 17:49:55 +0200
Subject: [PATCH] Make sure we can run with -x only if VELOCIraptor is on.
 Temporarily prevent STF to run over MPI.

---
 examples/main.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/examples/main.c b/examples/main.c
index 21eb21e97c..87891ed14d 100644
--- a/examples/main.c
+++ b/examples/main.c
@@ -306,7 +306,11 @@ int main(int argc, char *argv[]) {
         }
         break;
       case 'x':
+#ifdef HAVE_VELOCIRAPTOR
         with_structure_finding = 1;
+#else
+	error("Error: (-x) needs to have the code compiled with VELOCIraptor linked in.");
+#endif
         break;
       case 'y':
         if (sscanf(optarg, "%d", &dump_tasks) != 1) {
@@ -717,6 +721,11 @@ int main(int argc, char *argv[]) {
       error("Periodic self-gravity over MPI temporarily disabled.");
 #endif
 
+#if defined(WITH_MPI) && defined(HAVE_VELOCIRAPTOR)
+    if(with_structure_finding)
+      error("VEOCIraptor not yet enabled over MPI.");
+#endif
+
 #ifdef SWIFT_DEBUG_CHECKS
     /* Check once and for all that we don't have unwanted links */
     if (!with_stars && !dry_run) {
-- 
GitLab