From e117d0bf83c22c772312a10fe3a4210fa512fd85 Mon Sep 17 00:00:00 2001 From: Todd Sundsted Date: Fri, 16 Jul 2021 08:08:09 -0400 Subject: [PATCH] Find dynamic libraries with extensions common on other platforms. --- src/mxnet/libmxnet.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/mxnet/libmxnet.py b/src/mxnet/libmxnet.py index a16fbf62..dd5a536a 100644 --- a/src/mxnet/libmxnet.py +++ b/src/mxnet/libmxnet.py @@ -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 @@ -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])