Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
klytje committed Oct 21, 2024
1 parent 6ac7d56 commit 125ca72
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
3 changes: 3 additions & 0 deletions build_tools/get_external_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions installers/sasview.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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=[],
Expand Down
9 changes: 5 additions & 4 deletions src/sas/sascalc/calculator/ausaxs/ausaxs_sans_debye.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 125ca72

Please sign in to comment.