Skip to content

Commit

Permalink
Merge pull request #196 from rheiland/fix/libRR
Browse files Browse the repository at this point in the history
improve setup_libroadrunner.py
  • Loading branch information
MathCancer authored Aug 2, 2023
2 parents c83b5cd + fa7a858 commit 96b916d
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions beta/setup_libroadrunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,24 @@ def reminder_dynamic_link_path_linux():
print("\n* To make this permanent, add this line to the bottom of the respective shell startup file, e.g., .bashrc, .bash_profile, or .zshenv in your home directory.")
print("\n!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n")

if os.path.exists(os.path.join(os.path.dirname(os.path.dirname(__file__)), "addons", "libRoadrunner", "roadrunner")):
os_type = platform.system()

# Old:
# if os.path.exists(os.path.join(os.path.dirname(os.path.dirname(__file__)), "addons", "libRoadrunner", "roadrunner")):

# New: July 2023 - trying to be smarter about deciding whether to (re)download libRR
# NOTE: needs to be tested cross-platform!
if os.path.exists(os.path.join(os.path.dirname(os.path.dirname(__file__)), "addons", "libRoadrunner", "roadrunner","include","rr","C","rrc_api.h")):
print('\nlibroadrunner already installed.\n')

# regardless, let's remind the user about the env var requirement!
if os_type.lower() == 'darwin':
reminder_dynamic_link_path_macos()
elif os_type.lower().startswith("linux"):
reminder_dynamic_link_path_linux()

else:
print('\nThis model requires the libRoadrunner libraries which will now be downloaded.')
os_type = platform.system()
print('(for your ',os_type, ' operating system)')

# Assume Windows
Expand Down

0 comments on commit 96b916d

Please sign in to comment.