Skip to content

Commit

Permalink
Change error message on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
kdheepak committed Sep 24, 2020
1 parent 659d425 commit aed04a2
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions helics/_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,19 @@
if platform.system() == "Windows":
for file in os.listdir(os.path.join(PYHELICS_INSTALL, "bin")):
if "helicsSharedLib" in file:
lib = ffi.dlopen(os.path.join(PYHELICS_INSTALL, "bin", file))
break
try:
lib = ffi.dlopen(os.path.join(PYHELICS_INSTALL, "bin", file))
break
except OSError as _:
pass
else:
lib = ffi.dlopen("helicsShared.dll")
try:
lib = ffi.dlopen("helicsShared.dll")
except OSError as e:
raise OSError(
str(e)
+ "\n\nRECOMMENDATION: When using Python / Anaconda on Windows, users must manually install the latest version of Visual C++ Redistributable for Visual Studio 2019. See https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads for links. If this problem persists after installing Visual C++ Redistributable, please open an issue on https://github.com/GMLC-TDC/HELICS."
)
if lib is None:
raise Exception("Unable to load helics shared library")
elif platform.system() == "Darwin":
Expand Down

0 comments on commit aed04a2

Please sign in to comment.