[Numpy-svn] r4376 - in branches/numpy.scons/numpy: core distutils/scons

numpy-svn@scip... numpy-svn@scip...
Fri Nov 2 05:49:57 CDT 2007


Author: cdavid
Date: 2007-11-02 05:49:49 -0500 (Fri, 02 Nov 2007)
New Revision: 4376

Modified:
   branches/numpy.scons/numpy/core/SConstruct
   branches/numpy.scons/numpy/distutils/scons/default.py
   branches/numpy.scons/numpy/distutils/scons/numpyenv.py
Log:
More info for VS support in scons

Modified: branches/numpy.scons/numpy/core/SConstruct
===================================================================
--- branches/numpy.scons/numpy/core/SConstruct	2007-11-02 08:34:41 UTC (rev 4375)
+++ branches/numpy.scons/numpy/core/SConstruct	2007-11-02 10:49:49 UTC (rev 4376)
@@ -1,4 +1,4 @@
-# Last Change: Tue Oct 30 07:00 PM 2007 J
+# Last Change: Fri Nov 02 06:00 PM 2007 J
 # vim:syntax=python
 import os
 import sys
@@ -55,8 +55,8 @@
 check_type('float')
 check_type('double')
 check_type('long double')
-check_type('Py_intptr_t', include = r"#include <Python.h>\n")
-check_type('PY_LONG_LONG', include = r"#include <Python.h>\n")
+check_type('Py_intptr_t', include = "#include <Python.h>\n")
+check_type('PY_LONG_LONG', include = "#include <Python.h>\n")
 
 # TODO: check python extension can be built (in root or here ?)
 

Modified: branches/numpy.scons/numpy/distutils/scons/default.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/default.py	2007-11-02 08:34:41 UTC (rev 4375)
+++ branches/numpy.scons/numpy/distutils/scons/default.py	2007-11-02 10:49:49 UTC (rev 4376)
@@ -1,5 +1,5 @@
 #! /usr/bin/env python
-# Last Change: Fri Nov 02 05:00 PM 2007 J
+# Last Change: Fri Nov 02 06:00 PM 2007 J
 import sys
 
 # This is a copy of scons/Tools/__init__.py, because scons does not offer any
@@ -90,7 +90,7 @@
 # XXX: customization from site.cfg or other ?
 class CompilerConfig:
     def __init__(self, optim = None, warn = None, debug = None, debug_symbol =
-                 None, thread = None):
+                 None, thread = None, extra = None):
         # XXX: several level of optimizations ?
         self.optim = optim
         # XXX: several level of warnings ?
@@ -101,13 +101,20 @@
         self.debug = debug
         # XXX
         self.thread = thread
+        # XXX
+        self.extra = extra
 
     def get_flags_dict(self):
-        return {'NUMPY_OPTIM_CFLAGS' : self.optim,
+        d = {'NUMPY_OPTIM_CFLAGS' : self.optim,
                 'NUMPY_WARN_CFLAGS' : self.warn,
                 'NUMPY_THREAD_CFLAGS' : self.thread,
+                'NUMPY_EXTRA_CFLAGS' : self.debug,
                 'NUMPY_DEBUG_CFLAGS' : self.debug,
                 'NUMPY_DEBUG_SYMBOL_CFLAGS' : self.debug_symbol}
+        for k, v in d.items():
+            if v is None:
+                d[k] = []
+        return d
 
 # It seems that scons consider any option with space in it as a multi option,
 # which breaks command line options. So just don't put space.
@@ -116,7 +123,7 @@
         cfg = CompilerConfig(optim = ['-O2', '-fno-strict-aliasing', '-DNDEBUG'],
                              warn = ['-Wall', '-Wstrict-prototypes'],
                              debug_symbol = ['-g'], 
-                             thread = ['-pthread'])
+                             thread = [])
     elif name == 'intelc':
         if sys.platform[:5] == 'win32':
             raise NotImplementedError('FIXME: intel compiler on windows not '\
@@ -127,9 +134,32 @@
                              debug_symbol = ['-g'],
                              thread = ['-pthread'])
     elif name == 'msvc':
+        # XXX: distutils part of customization:
+        # if self.__arch == "Intel":
+        #     self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GX' , '/DNDEBUG']
+        #     self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GX', '/Z7', '/D_DEBUG']
+        # else:
+        #     # Win64
+        #     self.compile_options = [ '/nologo', '/Ox', '/MD', '/W3', '/GS-' ,
+        #     '/DNDEBUG']
+        #     self.compile_options_debug = ['/nologo', '/Od', '/MDd', '/W3', '/GS-',
+        #     '/Z7', '/D_DEBUG']
+        # 
+        # self.ldflags_shared = ['/DLL', '/nologo', '/INCREMENTAL:NO']
+        # if self.__version >= 7:
+        #     self.ldflags_shared_debug = [
+        #     '/DLL', '/nologo', '/INCREMENTAL:no', '/DEBUG'
+        #     ]
+        # else:
+        #     self.ldflags_shared_debug = [
+        #     '/DLL', '/nologo', '/INCREMENTAL:no', '/pdb:None', '/DEBUG'
+        #             ]
+        # self.ldflags_static = [ '/nologo']
+
         cfg = CompilerConfig(optim = ['/Ox', '/DNDEBUG'],
                              warn = ['/W3', '/Wall'],
-                             thread = ['/MD', '/GX'])
+                             thread = ['/MD', '/GX'], 
+                             extra = ['/nologo'])
     else:
         cfg = CompilerConfig()
 

Modified: branches/numpy.scons/numpy/distutils/scons/numpyenv.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/numpyenv.py	2007-11-02 08:34:41 UTC (rev 4375)
+++ branches/numpy.scons/numpy/distutils/scons/numpyenv.py	2007-11-02 10:49:49 UTC (rev 4376)
@@ -81,6 +81,7 @@
     env = _GetNumpyEnvironment(args)
     env.AppendUnique(CFLAGS  = env['NUMPY_WARN_CFLAGS'] + env['NUMPY_OPTIM_CFLAGS'] +\
                                env['NUMPY_DEBUG_SYMBOL_CFLAGS'] +\
+                               env['NUMPY_EXTRA_CFLAGS'] +\
                                env['NUMPY_THREAD_CFLAGS'])
     return env
 
@@ -224,6 +225,7 @@
     else:
         BuildDir(env['build_dir'], '.')
 
+    env['CC'] = 'tcc'
     # Generate help (if calling scons directly during debugging, this could be useful)
     Help(opts.GenerateHelpText(env))
 



More information about the Numpy-svn mailing list