Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix finding libpython to be non-recursive (and faster!) #560

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions bin/nrnpyenv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -215,15 +215,15 @@ def nrnpylib_darwin_helper():
else: # figure it out from the os path
p = os.path.sep.join(os.__file__.split(os.path.sep)[:-1])
name = "libpython%d.%d" % (sys.version_info[0], sys.version_info[1])
cmd = r'find %s -name %s\*.dylib' % (p, name)
cmd = r'find %s -maxdepth 1 -name %s\*.dylib' % (p, name)
print ('# %s'%cmd)
f = os.popen(cmd)
libs = []
for line in f:
libs.append(line.strip())
if len(libs) == 0: # try again searching the parent folder
p = os.path.sep.join(os.__file__.split(os.path.sep)[:-2])
cmd = r'find %s -name %s\*.dylib' % (p, name)
cmd = r'find %s -maxdepth 1 -name %s\*.dylib' % (p, name)
print ('# %s'%cmd)
f = os.popen(cmd)
for line in f:
Expand Down Expand Up @@ -301,15 +301,15 @@ def nrnpylib_linux():
else: # figure it out from the os path
p = os.path.sep.join(os.__file__.split(os.path.sep)[:-1])
name = "libpython%d.%d" % (sys.version_info[0], sys.version_info[1])
cmd = r'find %s -name %s\*.so' % (p, name)
cmd = r'find %s -maxdepth 1 -name %s\*.so' % (p, name)
print ('# %s'%cmd)
f = os.popen(cmd)
libs = []
for line in f:
libs.append(line.strip())
if len(libs) == 0: # try again searching the parent folder
p = os.path.sep.join(os.__file__.split(os.path.sep)[:-2])
cmd = r'find %s -name %s\*.so' % (p, name)
cmd = r'find %s -maxdepth 1 -name %s\*.so' % (p, name)
print ('# %s'%cmd)
f = os.popen(cmd)
for line in f:
Expand Down