8000 BLD, ENH: Add RPATH support for AIX (#16710) · charris/numpy@cb440a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit cb440a3

Browse files
EGuesnetcharris
andcommitted
BLD, ENH: Add RPATH support for AIX (numpy#16710)
* ENH: Add RPATH support for AIX * ENH: Rewrite function returning RPATH * MAINT: Use f-strings for clarity. Co-authored-by: Charles Harris <charlesr.harris@gmail.com>
1 parent 1e54385 commit cb440a3

File tree

1 file changed

+9
-4
lines changed
  • numpy/distutils/fcompiler

1 file changed

+9
-4
lines changed

numpy/distutils/fcompiler/gnu.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,15 +253,20 @@ def get_flags_arch(self):
253253
return []
254254

255255
def runtime_library_dir_option(self, dir):
256-
if sys.platform[:3] == 'aix' or sys.platform == 'win32':
257-
# Linux/Solaris/Unix support RPATH, Windows and AIX do not
256+
if sys.platform == 'win32':
257+
# Linux/Solaris/Unix support RPATH, Windows does not
258258
raise NotImplementedError
259259

260260
# TODO: could use -Xlinker here, if it's supported
261261
assert "," not in dir
262262

263-
sep = ',' if sys.platform == 'darwin' else '='
264-
return '-Wl,-rpath%s%s' % (sep, dir)
263+
if sys.platform == 'darwin':
264+
return f'-Wl,-rpath,{dir}'
265+
elif sys.platform[:3] == 'aix':
266+
# AIX RPATH is called LIBPATH
267+
return f'-Wl,-blibpath:{dir}'
268+
else:
269+
return f'-Wl,-rpath={dir}'
265270

266271

267272
class Gnu95FCompiler(GnuFCompiler):

0 commit comments

Comments
 (0)
0