Eliminate RUNPATH to use correct cuDNN
@@ -425,13 +425,17 @@ def make_extensions(options, compiler, use_cython):
depth = name.count('.') - 1
rpath.append('{}{}/_lib'.format(_rpath_base(), '/..' * depth))
- if not PLATFORM_WIN32:
+ if not PLATFORM_WIN32 and not PLATFORM_LINUX:
s['runtime_library_dirs'] = rpath
- if PLATFORM_DARWIN:
+ if PLATFORM_LINUX or PLATFORM_DARWIN:
+ ldflag = '-Wl,'
+ if PLATFORM_LINUX:
+ ldflag += '--disable-new-dtags,'
+ ldflag += ','.join('-rpath,' + p
+ for p in s['library_dirs'])
args = s.setdefault('extra_link_args', [])
- args.append(
- '-Wl,' + ','.join('-rpath,' + p
- for p in s['library_dirs']))
+ args.append(ldflag)
+ if PLATFORM_DARWIN:
# -rpath is only supported when targetting Mac OS X 10.5 or
# later
args.append('-mmacosx-version-min=10.5')
