summaryrefslogtreecommitdiff
path: root/numpy/core/setup_common.py
diff options
context:
space:
mode:
authorMichael Schnaitter <schnaitterm@knights.ucf.edu>2017-11-28 16:41:06 -0500
committerMichael Schnaitter <schnaitterm@knights.ucf.edu>2017-11-28 16:41:06 -0500
commit362ea38c788dc032de234738e1eed1e79260a476 (patch)
tree6d5a5877f727075588013fa0890a94774ca9c1f3 /numpy/core/setup_common.py
parent1493023518f956bec74a9f5113d83510c28f44c7 (diff)
downloadnumpy-362ea38c788dc032de234738e1eed1e79260a476.tar.gz
patched `numpy/core/setup_common.py` to check for the `-ipo` flag when running the intel compiler and not on windows
before checking for the long double representation, as this option causes the compiler to generate intermediary object files and interferes with checking the representation. This had already been done for MSVC style compilers.
Diffstat (limited to 'numpy/core/setup_common.py')
-rw-r--r--numpy/core/setup_common.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/numpy/core/setup_common.py b/numpy/core/setup_common.py
index 97608d18a..f6544e954 100644
--- a/numpy/core/setup_common.py
+++ b/numpy/core/setup_common.py
@@ -216,6 +216,24 @@ def check_long_double_representation(cmd):
except (AttributeError, ValueError):
pass
+ # Disable multi-file interprocedural optimization in the Intel compiler on Linux
+ # which generates intermediary object files and prevents checking the
+ # float representation.
+ elif sys.platform != "win32" and cmd.compiler.compiler_type.startswith('intel') \
+ and '-ipo' in cmd.compiler.cc_exe:
+ try:
+ newcompiler = cmd.compiler.cc_exe.replace(' -ipo', '')
+ cmd.compiler.set_executables(
+ compiler=newcompiler,
+ compiler_so=newcompiler,
+ compiler_cxx=newcompiler,
+ linker_exe=newcompiler,
+ linker_so=newcompiler + ' -shared'
+ )
+ except (AttributeError, ValueError):
+ pass
+
+
# We need to use _compile because we need the object filename
src, obj = cmd._compile(body, None, None, 'c')
try: