summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Papior Andersen <nickpapior@gmail.com>2015-02-27 08:14:59 +0000
committerNick Papior Andersen <nickpapior@gmail.com>2015-02-27 08:14:59 +0000
commit525f0cd85fa270ee0fb843a8cfdd21dfe98238cd (patch)
treef24c95ff49417f7de5828182cd00e02a30959d77
parent29b9480f62fd01b6d19da39391bd522cc66bdc6b (diff)
downloadnumpy-525f0cd85fa270ee0fb843a8cfdd21dfe98238cd.tar.gz
BUG: rpath was not implemented for numpy.distutils.fcompiler
This bug-fix only applies for non gnu-compilers. The fortran compilers in numpy inherited the Ccompier class which had the runtime library directories NotImplemented. Hence the compilers need to define their own runtime library path. I have added that information to the intel/pgi/sun compilers. The rest are either already implemented or I do not know them. I have tested the bug-fix with intel compilers of numpy AND the subsequent installation of scipy (which relies on the fortran compilers). Hence this bug will only occur when linking with the fortran compilers.
-rw-r--r--numpy/distutils/fcompiler/intel.py13
-rw-r--r--numpy/distutils/fcompiler/pg.py3
-rw-r--r--numpy/distutils/fcompiler/sun.py3
3 files changed, 19 insertions, 0 deletions
diff --git a/numpy/distutils/fcompiler/intel.py b/numpy/distutils/fcompiler/intel.py
index f76174c7a..63436e4ed 100644
--- a/numpy/distutils/fcompiler/intel.py
+++ b/numpy/distutils/fcompiler/intel.py
@@ -14,12 +14,17 @@ def intel_version_match(type):
# Match against the important stuff in the version string
return simple_version_match(start=r'Intel.*?Fortran.*?(?:%s).*?Version' % (type,))
+
class BaseIntelFCompiler(FCompiler):
def update_executables(self):
f = dummy_fortran_file()
self.executables['version_cmd'] = ['<F77>', '-FI', '-V', '-c',
f + '.f', '-o', f + '.o']
+ def runtime_library_dir_option(self, dir):
+ return '-Wl,-rpath="%s"' % dir
+
+
class IntelFCompiler(BaseIntelFCompiler):
compiler_type = 'intel'
@@ -71,6 +76,7 @@ class IntelFCompiler(BaseIntelFCompiler):
opt[idx:idx] = ['-dynamiclib', '-Wl,-undefined,dynamic_lookup']
return opt
+
class IntelItaniumFCompiler(IntelFCompiler):
compiler_type = 'intele'
compiler_aliases = ()
@@ -90,6 +96,7 @@ class IntelItaniumFCompiler(IntelFCompiler):
'ranlib' : ["ranlib"]
}
+
class IntelEM64TFCompiler(IntelFCompiler):
compiler_type = 'intelem'
compiler_aliases = ()
@@ -122,6 +129,7 @@ class IntelEM64TFCompiler(IntelFCompiler):
# Is there no difference in the version string between the above compilers
# and the Visual compilers?
+
class IntelVisualFCompiler(BaseIntelFCompiler):
compiler_type = 'intelv'
description = 'Intel Visual Fortran Compiler for 32-bit apps'
@@ -167,6 +175,10 @@ class IntelVisualFCompiler(BaseIntelFCompiler):
def get_flags_arch(self):
return ["/arch:IA-32", "/QaxSSE3"]
+ def runtime_library_dir_option(self, dir):
+ raise NotImplementedError
+
+
class IntelItaniumVisualFCompiler(IntelVisualFCompiler):
compiler_type = 'intelev'
description = 'Intel Visual Fortran Compiler for Itanium apps'
@@ -186,6 +198,7 @@ class IntelItaniumVisualFCompiler(IntelVisualFCompiler):
'ranlib' : None
}
+
class IntelEM64VisualFCompiler(IntelVisualFCompiler):
compiler_type = 'intelvem'
description = 'Intel Visual Fortran Compiler for 64-bit apps'
diff --git a/numpy/distutils/fcompiler/pg.py b/numpy/distutils/fcompiler/pg.py
index f3f5ea22b..ee357c6d0 100644
--- a/numpy/distutils/fcompiler/pg.py
+++ b/numpy/distutils/fcompiler/pg.py
@@ -51,6 +51,9 @@ class PGroupFCompiler(FCompiler):
def get_flags_linker_so(self):
return ["-dynamic", '-undefined', 'dynamic_lookup']
+ def runtime_library_dir_option(self, dir):
+ return '-R"%s"' % dir
+
if __name__ == '__main__':
from distutils import log
log.set_verbosity(2)
diff --git a/numpy/distutils/fcompiler/sun.py b/numpy/distutils/fcompiler/sun.py
index 0955f14a1..76ce1cabc 100644
--- a/numpy/distutils/fcompiler/sun.py
+++ b/numpy/distutils/fcompiler/sun.py
@@ -43,6 +43,9 @@ class SunFCompiler(FCompiler):
opt.extend(['fsu', 'sunmath', 'mvec'])
return opt
+ def runtime_library_dir_option(self, dir):
+ return '-R"%s"' % dir
+
if __name__ == '__main__':
from distutils import log
log.set_verbosity(2)