Skip to content

Commit

Permalink
Revert "Maybe fix library resolution"
Browse files Browse the repository at this point in the history
This reverts commit 2a68b36.
  • Loading branch information
kartik-s committed Sep 13, 2024
1 parent 7b9e3d1 commit 209e4c1
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/python-bindings.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -45,23 +45,8 @@
(if library-path
(format stream "libpath = Path(\"~a\")~%~%" library-path)
(progn
(format stream "def find_~a():~%" name)
(format stream " if platform.system() == 'Windows' or platform.system() == 'Linux':~%")
(format stream " return find_library('~a')~%" name)
(format stream " elif platform.system() == 'Darwin':~%")
(format stream " # cf. https://github.com/ContinuumIO/anaconda-issues/issues/1716~%")
(format stream " fallback_path = os.environ.get('DYLD_FALLBACK_LIBRARY_PATH', '')~%")
(format stream " conda_path = os.environ.get('CONDA_PREFIX')~%")
(format stream " try:~%")
(format stream " os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = (conda_path+'/lib:'+fallback_path) if conda_path else fallback_path~%")
(format stream " return find_library('~a')~%" name)
(format stream " finally:~%")
(format stream " os.environ['DYLD_FALLBACK_LIBRARY_PATH'] = fallback_path~%")
(format stream " else:~%")
(format stream " raise Exception(f'Unexpected platform {platform.system()}')~%~%")

(format stream "try:~%")
(format stream " libpath = Path(find_~a('~:*~a')).resolve()~%" name)
(format stream " libpath = Path(find_library('~a')).resolve()~%" name)
(format stream "except TypeError as e:~%")
(format stream " raise Exception('Unable to locate ~a') from e~%~%" name)))

Expand Down

0 comments on commit 209e4c1

Please sign in to comment.