From 95d61aba60c58b679ad7e1711425fba3504ede98 Mon Sep 17 00:00:00 2001 From: Yuanpeng Zhang Date: Fri, 11 Jul 2025 14:16:33 -0400 Subject: [PATCH] fix the linux RMCProfile launching issue --- GSASII/GSASIIphsGUI.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/GSASII/GSASIIphsGUI.py b/GSASII/GSASIIphsGUI.py index e4f169c0..0e48fbfc 100644 --- a/GSASII/GSASIIphsGUI.py +++ b/GSASII/GSASIIphsGUI.py @@ -57,6 +57,7 @@ from . import atmdata from . import ISODISTORT as ISO from . import SUBGROUPS +from pathlib import Path try: wx.NewIdRef @@ -6260,6 +6261,15 @@ def RunRMCProfile(event): f.write(f' do script "bash {script_file}" in window 1\n') f.write("end tell\n") subp.Popen(['osascript', ascript_file]) + elif sys.platform.startswith("linux"): + script_file = os.path.join(os.getcwd(), "runrmc.sh") + with open(script_file, 'w') as frmc: + frmc.write("#!/bin/bash\n") + frmc.write(f"export LD_LIBRARY_PATH={Path(rmcfile).parent.parent}/exe/libs\n") + frmc.write(f"export LIBRARY_PATH={Path(rmcfile).parent.parent}/exe/libs\n") + frmc.write(f"export PATH=$PATH:{Path(rmcfile).parent.parent}/exe\n") + frmc.write(f'"rmcprofile" "{pName}"\n') + subp.Popen(['bash', script_file]) else: script_file = os.path.join(os.getcwd(), "runrmc.bat") with open(script_file,'w') as batch: