summaryrefslogtreecommitdiff
path: root/numpy/distutils/msvc9compiler.py
diff options
context:
space:
mode:
authorDmitry Zagorny <dmitry.zagorny@intel.com>2015-09-14 13:03:38 -0500
committerDmitry Zagorny <dmitry.zagorny@intel.com>2015-09-15 14:34:43 +0300
commit72753bbdf8736a13f1cb60c25cf8683608f46e29 (patch)
tree5a0f17e10c88a02e4b9d6438ad88a447172f5174 /numpy/distutils/msvc9compiler.py
parent44c9b2aba51f73e50c17b7f990a054d0d4804269 (diff)
downloadnumpy-72753bbdf8736a13f1cb60c25cf8683608f46e29.tar.gz
MSVCCompiler overwrite 'lib' and 'include' environment variables. This
behavior affect at least python 3.5 and SciPy build and build failed. During initialization <python>.distutils.MSVCCompiler replace Intel environment('include' and 'lib' paths). This fix decorate 'initialize' function in MSVCCompiler and extend 'lib' and 'include' environment variables. Changed compilation keys: generate optimized code specialized for Intel processors with SSE4.2 support.
Diffstat (limited to 'numpy/distutils/msvc9compiler.py')
-rw-r--r--numpy/distutils/msvc9compiler.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/numpy/distutils/msvc9compiler.py b/numpy/distutils/msvc9compiler.py
new file mode 100644
index 000000000..c60826de9
--- /dev/null
+++ b/numpy/distutils/msvc9compiler.py
@@ -0,0 +1,21 @@
+import os
+from distutils.msvccompiler import *
+from distutils.msvc9compiler import MSVCCompiler as distutils_MSVCCompiler
+
+
+class MSVCCompiler(distutils_MSVCCompiler):
+ def __init__(self, verbose=0, dry_run=0, force=0):
+ distutils_MSVCCompiler.__init__(self, verbose, dry_run, force)
+
+ def initialize(self, plat_name=None):
+ environ_lib = os.getenv('lib')
+ environ_include = os.getenv('include')
+ distutils_MSVCCompiler.initialize(self, plat_name)
+ if environ_lib is not None:
+ os.environ['lib'] = environ_lib + os.environ['lib']
+ if environ_include is not None:
+ os.environ['include'] = environ_include + os.environ['include']
+
+ def manifest_setup_ldargs(self, output_filename, build_temp, ld_args):
+ ld_args.append('/MANIFEST')
+ distutils_MSVCCompiler.manifest_setup_ldargs(self, output_filename, build_temp, ld_args)