From 125ca724a563b926f027f6465ae9ad23782e99ba Mon Sep 17 00:00:00 2001 From: krellemeister Date: Mon, 21 Oct 2024 19:58:33 +0200 Subject: [PATCH] update --- build_tools/get_external_dependencies.py | 3 +++ installers/sasview.spec | 2 ++ src/sas/sascalc/calculator/ausaxs/ausaxs_sans_debye.py | 9 +++++---- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/build_tools/get_external_dependencies.py b/build_tools/get_external_dependencies.py index ee5bc61ea7..c3b574c3a7 100644 --- a/build_tools/get_external_dependencies.py +++ b/build_tools/get_external_dependencies.py @@ -41,6 +41,9 @@ def get_ausaxs(): with open(base_loc+lib, "wb") as f: f.write(response.content) + print("Downloaded AUSAXS library:", lib) + import os + print(f"Location: {base_loc+lib}, found by path: {"yes" if os.path.exists(base_loc+lib) else "no"}") def fetch_external_dependencies(): #surround with try/except to avoid breaking the build if the download fails diff --git a/installers/sasview.spec b/installers/sasview.spec index 2e5933101c..40c2324bc9 100644 --- a/installers/sasview.spec +++ b/installers/sasview.spec @@ -77,6 +77,8 @@ if platform.system() == 'Windows': 'win32.win32console', ]) +import os +print(f"Library location: sas/sascalc/calculator/ausaxs/lib, found by path: {"yes" if os.path.exists(sas/sascalc/calculator/ausaxs/lib/libausaxs.dylib) else "no"}") a = Analysis( ['sasview.py'], pathex=[], diff --git a/src/sas/sascalc/calculator/ausaxs/ausaxs_sans_debye.py b/src/sas/sascalc/calculator/ausaxs/ausaxs_sans_debye.py index 9e0d24af25..3c074a1e4f 100644 --- a/src/sas/sascalc/calculator/ausaxs/ausaxs_sans_debye.py +++ b/src/sas/sascalc/calculator/ausaxs/ausaxs_sans_debye.py @@ -15,17 +15,18 @@ class lib_state(Enum): def _attach_hooks(): ausaxs = None ausaxs_state = lib_state.UNINITIALIZED - from sas.sascalc.calculator.ausaxs.architecture import get_ausaxs_filename + from sas.sascalc.calculator.ausaxs.architecture import get_shared_lib_extension # as_file extracts the dll if it is in a zip file and probably deletes it afterwards, # so we have to do all operations on the dll inside the with statement with resources.as_file(resources.files("sas.sascalc.calculator.ausaxs.lib")) as loc: - file = get_ausaxs_filename() - if (not file): + ext = get_shared_lib_extension() + if (ext == ""): logging.log("AUSAXS: Unsupported OS. Using default Debye implementation.") return None, lib_state.FAILED - path = loc.joinpath(file) + path = loc.joinpath("libausaxs" + ext) + ausaxs_state = lib_state.READY try: # evaluate_sans_debye func