Skip to content

Commit

Permalink
Find dynamic libraries with extensions common on other platforms.
Browse files Browse the repository at this point in the history
  • Loading branch information
toddsundsted committed Jul 16, 2021
1 parent 39da00e commit e117d0b
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/mxnet/libmxnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
def explain():
msg = '''NO MXNET LIBRARY FOUND
MXNet.cr requires the MXNet (https://mxnet.incubator.apache.org/) deep
learning library be installed. On most platforms, you can either build
the MXNet library from source or you can install the library, along
with Python language bindings, with a tool like "pip". In any case, no
MXNet.cr requires the MXNet (https://mxnet.apache.org/) deep learning
library be installed. On most platforms, you can either build the
MXNet library from source or you can install the library, along with
Python language bindings, with a tool like "pip". In any case, no
MXNet library can be found.
See the MXNet.cr README (https://github.com/toddsundsted/mxnet.cr) for
Expand Down Expand Up @@ -56,8 +56,12 @@ def explain():
dll_path.extend([p.strip() for p in os.environ['DYLD_FALLBACK_LIBRARY_PATH'].split(':')])

dll_path.append('../../../')
dll_path = [os.path.join(p, 'libmxnet.so') for p in dll_path]

dll_path = [os.path.join(p, 'libmxnet.dylib') for p in dll_path] + \
[os.path.join(p, 'libmxnet.dll') for p in dll_path] + \
[os.path.join(p, 'libmxnet.so') for p in dll_path]

lib_path = [p for p in dll_path if os.path.exists(p) and os.path.isfile(p)]

if len(lib_path) > 0:
print(lib_path[0])

0 comments on commit e117d0b

Please sign in to comment.