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

numpy-svn@scip... numpy-svn@scip...
Fri Nov 9 01:37:06 CST 2007


Author: cdavid
Date: 2007-11-09 01:36:57 -0600 (Fri, 09 Nov 2007)
New Revision: 4425

Modified:
   branches/numpy.scons/numpy/distutils/scons/core/default.py
   branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py
   branches/numpy.scons/test.sh
Log:
Add optim flags for link step in compiler configuration

Modified: branches/numpy.scons/numpy/distutils/scons/core/default.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/core/default.py	2007-11-09 06:37:38 UTC (rev 4424)
+++ branches/numpy.scons/numpy/distutils/scons/core/default.py	2007-11-09 07:36:57 UTC (rev 4425)
@@ -94,7 +94,7 @@
 
 class CompilerConfig:
     def __init__(self, optim = None, warn = None, debug = None, debug_symbol =
-                 None, thread = None, extra = None):
+                 None, thread = None, extra = None, link_optim = None):
         # XXX: several level of optimizations ?
         self.optim = optim
         # XXX: several level of warnings ?
@@ -107,9 +107,12 @@
         self.thread = thread
         # XXX
         self.extra = extra
+        # XXX
+        self.link_optim = link_optim
 
     def get_flags_dict(self):
         d = {'NUMPY_OPTIM_CFLAGS' : self.optim,
+             'NUMPY_OPTIM_LDFLAGS' : self.link_optim,
                 'NUMPY_WARN_CFLAGS' : self.warn,
                 'NUMPY_THREAD_CFLAGS' : self.thread,
                 'NUMPY_EXTRA_CFLAGS' : self.debug,
@@ -175,8 +178,14 @@
         cfg = CompilerConfig(optim = ['-O2', '-fno-strict-aliasing'],
                              warn = ['-Wall', '-Wstrict-prototypes'])
     elif name == 'suncc':
+	# -xtarget and co (-xarch, etc...) should be put in link_optim and
+	# optim for optimal performances.  If you do not need the package to be
+	# redistributable, using -xtarget=native is a good choice. See man cc
+	# for more info.
+	# XXX: detect this automatically ?
         cfg = CompilerConfig(optim = ['-fast'],
-			     debug_symbol = ['-g'])
+			     debug_symbol = ['-g'], 
+			     link_optim = [])
     else:
         # For not yet supported compiler, just put everything in optims from
         # distutils

Modified: branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py	2007-11-09 06:37:38 UTC (rev 4424)
+++ branches/numpy.scons/numpy/distutils/scons/core/numpyenv.py	2007-11-09 07:36:57 UTC (rev 4425)
@@ -83,6 +83,7 @@
                                env['NUMPY_DEBUG_SYMBOL_CFLAGS'] +\
                                env['NUMPY_EXTRA_CFLAGS'] +\
                                env['NUMPY_THREAD_CFLAGS'])
+    env.AppendUnique(LINKFLAGS = env['NUMPY_OPTIM_LDFLAGS'])
     return env
 
 def _GetNumpyEnvironment(args):

Modified: branches/numpy.scons/test.sh
===================================================================
--- branches/numpy.scons/test.sh	2007-11-09 06:37:38 UTC (rev 4424)
+++ branches/numpy.scons/test.sh	2007-11-09 07:36:57 UTC (rev 4425)
@@ -1,5 +1,5 @@
 PREFIX=$PWD
 rm -rf $PREFIX/build
 rm -rf $PREFIX/tmp
-python setup.py scons --jobs=4 install --prefix=$PREFIX/tmp
-(cd $PREFIX/tmp && PYTHONPATH=$PREFIX/tmp/lib/python2.5/site-packages python -c "import numpy; print numpy; numpy.test(level = 9999); numpy.show_config()")
+DEBUG_SCONS_CHECK=0 python setup.py scons --jobs=1 install --prefix=$PREFIX/tmp
+(cd $PREFIX/tmp && PYTHONPATH=$PREFIX/tmp/lib/python2.4/site-packages python -c "import numpy; print numpy; numpy.test(level = 9999); numpy.show_config()")



More information about the Numpy-svn mailing list