summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRalf Gommers <ralf.gommers@gmail.com>2015-08-02 21:49:57 +0200
committerCharles Harris <charlesr.harris@gmail.com>2015-08-03 11:38:44 -0600
commit2ce50d23bce43610a04eaee752fb116d46076187 (patch)
tree9444f0c9f67222daf306a70c8a0caa32ec687e1f
parent0d294c15be17109d683eec01cf588dc8a5aea1d9 (diff)
downloadnumpy-2ce50d23bce43610a04eaee752fb116d46076187.tar.gz
BLD: some fixes for Intel compilers.
- Fix an incorrect import - Enable C99 complex support (Qstd=c99) - Don't use MSVC complex types for Intel compilers Thanks to Intel for this patch (contact: Yolanda Chen).
-rw-r--r--numpy/core/src/npymath/npy_math_private.h8
-rw-r--r--numpy/distutils/command/build_ext.py2
-rw-r--r--numpy/distutils/command/config.py3
-rw-r--r--numpy/distutils/intelccompiler.py9
4 files changed, 14 insertions, 8 deletions
diff --git a/numpy/core/src/npymath/npy_math_private.h b/numpy/core/src/npymath/npy_math_private.h
index cf54d2bd9..5dd55e3bc 100644
--- a/numpy/core/src/npymath/npy_math_private.h
+++ b/numpy/core/src/npymath/npy_math_private.h
@@ -486,8 +486,12 @@ do { \
*/
#ifdef NPY_USE_C99_COMPLEX
-/* Microsoft C defines _MSC_VER */
-#if defined(_MSC_VER) && (_MSC_VER < 1900)
+/*
+ * Microsoft C defines _MSC_VER
+ * Intel compiler does not use MSVC complex types, but defines _MSC_VER by
+ * default.
+ */
+#if defined(_MSC_VER) && (_MSC_VER < 1900) && !defined(__INTEL_COMPILER)
typedef union {
npy_cdouble npy_z;
_Dcomplex c99_z;
diff --git a/numpy/distutils/command/build_ext.py b/numpy/distutils/command/build_ext.py
index d95faf5e1..0fa52a281 100644
--- a/numpy/distutils/command/build_ext.py
+++ b/numpy/distutils/command/build_ext.py
@@ -420,7 +420,7 @@ class build_ext (old_build_ext):
linker = self.compiler.link_shared_object
# Always use system linker when using MSVC compiler.
- if self.compiler.compiler_type=='msvc':
+ if self.compiler.compiler_type in ('msvc', 'intelw', 'intelemw'):
# expand libraries with fcompiler libraries as we are
# not using fcompiler linker
self._libs_with_msvc_and_fortran(fcompiler, libraries, library_dirs)
diff --git a/numpy/distutils/command/config.py b/numpy/distutils/command/config.py
index 47dc17df3..4f20fc0de 100644
--- a/numpy/distutils/command/config.py
+++ b/numpy/distutils/command/config.py
@@ -39,7 +39,8 @@ class config(old_config):
old_config._check_compiler(self)
from numpy.distutils.fcompiler import FCompiler, new_fcompiler
- if sys.platform == 'win32' and self.compiler.compiler_type == 'msvc':
+ if sys.platform == 'win32' and (self.compiler.compiler_type in
+ ('msvc', 'intelw', 'intelemw')):
# XXX: hack to circumvent a python 2.6 bug with msvc9compiler:
# initialize call query_vcvarsall, which throws an IOError, and
# causes an error along the way without much information. We try to
diff --git a/numpy/distutils/intelccompiler.py b/numpy/distutils/intelccompiler.py
index aed652ee6..25ee0e998 100644
--- a/numpy/distutils/intelccompiler.py
+++ b/numpy/distutils/intelccompiler.py
@@ -2,7 +2,7 @@ from __future__ import division, absolute_import, print_function
from distutils.unixccompiler import UnixCCompiler
from numpy.distutils.exec_command import find_executable
-from numpy.distutils.msvc9compiler import MSVCCompiler
+from distutils.msvc9compiler import MSVCCompiler
from numpy.distutils.ccompiler import simple_version_match
@@ -40,6 +40,7 @@ class IntelEM64TCCompiler(UnixCCompiler):
compiler_type = 'intelem'
cc_exe = 'icc -m64 -fPIC'
cc_args = "-fPIC"
+
def __init__(self, verbose=0, dry_run=0, force=0):
UnixCCompiler.__init__(self, verbose, dry_run, force)
self.cc_exe = 'icc -m64 -fPIC'
@@ -66,9 +67,9 @@ class IntelCCompilerW(MSVCCompiler):
MSVCCompiler.initialize(self, plat_name)
self.cc = self.find_exe("icl.exe")
self.linker = self.find_exe("xilink")
- self.compile_options = ['/nologo', '/O3', '/MD', '/W3']
- self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/Z7',
- '/D_DEBUG']
+ self.compile_options = ['/nologo', '/O3', '/MD', '/W3', '/Qstd=c99']
+ self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3',
+ '/Qstd=c99', '/Z7', '/D_DEBUG']
class IntelEM64TCCompilerW(IntelCCompilerW):