From 7d2637daaab70c4caba2906bc788aae593df89cf Mon Sep 17 00:00:00 2001
From: dgelessus <dgelessus@users.noreply.github.com>
Date: Thu, 9 Nov 2023 16:21:47 +0100
Subject: [PATCH] Run universal probcli as arm64 if possible

---
 de.prob.core/src/de/prob/cli/CliStarter.java | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/de.prob.core/src/de/prob/cli/CliStarter.java b/de.prob.core/src/de/prob/cli/CliStarter.java
index e6566a7f..782df75f 100644
--- a/de.prob.core/src/de/prob/cli/CliStarter.java
+++ b/de.prob.core/src/de/prob/cli/CliStarter.java
@@ -85,6 +85,16 @@ public final class CliStarter {
 		}
 
 		List<String> command = new ArrayList<String>();
+		if (Platform.OS_MACOSX.equals(os)) {
+			// Run universal probcli as arm64 if possible (i. e. if the host processor is arm64),
+			// even if Rodin/Eclipse is running as x86_64.
+			// (The macOS default behavior is to match the architecture of the parent process,
+			// which is bad in our case,
+			// because x86_64 probcli under Rosetta 2 is much slower than native arm64 probcli.)
+			command.add("arch");
+			command.add("-arm64");
+			command.add("-x86_64");
+		}
 		command.add(executable);
 		// command.add("-ll");
 		command.add("-sf");
-- 
GitLab