Skip to content

Commit bfb1c1c

Browse files
Hande loading of nmodl files in Windows
1 parent bb4b470 commit bfb1c1c

1 file changed

Lines changed: 10 additions & 3 deletions

File tree

pyNN/neuron/simulator.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,20 @@ def load_mechanisms(path):
5858
return
5959
# in case NEURON is assuming a different architecture to Python,
6060
# we try multiple possibilities
61-
arch_list = [platform.machine(), 'i686', 'x86_64', 'powerpc', 'umac']
62-
for arch in arch_list:
63-
lib_path = os.path.join(path, arch, '.libs', 'libnrnmech.so')
61+
if platform.system() == 'Windows':
62+
lib_path = os.path.join(path, 'nrnmech.dll')
6463
if os.path.exists(lib_path):
6564
h.nrn_load_dll(lib_path)
6665
nrn_dll_loaded.append(path)
6766
return
67+
else:
68+
arch_list = [platform.machine(), 'i686', 'x86_64', 'powerpc', 'umac']
69+
for arch in arch_list:
70+
lib_path = os.path.join(path, arch, '.libs', 'libnrnmech.so')
71+
if os.path.exists(lib_path):
72+
h.nrn_load_dll(lib_path)
73+
nrn_dll_loaded.append(path)
74+
return
6875
raise IOError("NEURON mechanisms not found in %s. You may need to run 'nrnivmodl' in this directory." % path)
6976

7077

0 commit comments

Comments
 (0)