From 555fba1e4bb5559079b3572ffd09f6bfbd20fe60 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 29 Sep 2020 18:46:32 -0400 Subject: [PATCH] add special case for windows installer package where the .dll file is in the bin folder --- python/lammps.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/python/lammps.py b/python/lammps.py index 6f9cf5031d..e3c8f7f61c 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -169,6 +169,8 @@ class lammps(object): # determine module file location modpath = dirname(abspath(getsourcefile(lambda:0))) + # for windows installers the shared library is in a different folder + winpath = abspath(os.path.join(modpath,'..','bin')) self.lib = None self.lmp = None @@ -197,6 +199,10 @@ class lammps(object): elif any([f.startswith('liblammps') and f.endswith('.dll') for f in os.listdir(modpath)]): lib_ext = ".dll" + elif any([f.startswith('liblammps') and f.endswith('.dll') + for f in os.listdir(winpath)]): + lib_ext = ".dll" + modpath = winpath else: lib_ext = ".so"