From 362ea38c788dc032de234738e1eed1e79260a476 Mon Sep 17 00:00:00 2001 From: Michael Schnaitter Date: Tue, 28 Nov 2017 16:41:06 -0500 Subject: 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. --- numpy/core/setup_common.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'numpy/core/setup_common.py') 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: -- cgit v1.2.1