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

numpy-svn@scip... numpy-svn@scip...
Sun Oct 14 11:15:15 CDT 2007


Author: cdavid
Date: 2007-10-14 11:14:56 -0500 (Sun, 14 Oct 2007)
New Revision: 4190

Modified:
   branches/numpy.scons/
   branches/numpy.scons/numpy/core/SConstruct
   branches/numpy.scons/numpy/core/setupscons.py
   branches/numpy.scons/numpy/distutils/scons/custom_builders.py
   branches/numpy.scons/test.sh
Log:
Building multiarray finally works



Property changes on: branches/numpy.scons
___________________________________________________________________
Name: bzr:revision-info
   - timestamp: 2007-10-14 21:44:01.213000059 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

   + timestamp: 2007-10-15 01:12:01.368000031 +0900
committer: david <david@david-laptop>
properties: 
	branch-nick: numpy.scons

Name: bzr:file-ids
   - numpy/core/config.h.in	config.h.in-20071014064907-muiokkgfs5im6243-1

   + 
Name: bzr:revision-id:v3-trunk0
   - 3737 david@david-laptop-20070920080908-n8pj8vmszdir3zoa
3738 david@david-laptop-20070920081509-58kkojgmml3t7jxs
3739 david@david-laptop-20070920081910-phlk1ujthksgpm0z
3740 david@david-laptop-20070920082641-bdhrt6eafeoli50i
3741 david@ar.media.kyoto-u.ac.jp-20070920130730-satdeppbh1k0bq2p
3743 david@ar.media.kyoto-u.ac.jp-20070921073742-vpv8pwv0j8fbd93m
3744 david@david-laptop-20070922101656-61kfi2faucemr2rl
3745 david@david-laptop-20070922113708-ror18thshang1cpu
3747 david@david-laptop-20070922140534-n9xsl096tjrzmct1
3749 david@david-laptop-20070922154007-usit009fr6vp377j
3750 david@david-laptop-20070923070011-leu2ozc2fy1q5cht
3751 david@david-laptop-20070924015925-dhsiao40jp7zsfp9
3752 david@ar.media.kyoto-u.ac.jp-20070924070657-nbw23j0ayan30cli
3753 david@ar.media.kyoto-u.ac.jp-20070924082918-i1lc1zikywi8czj4
3754 david@ar.media.kyoto-u.ac.jp-20070924083008-c0edtt8zs31yeh1q
3755 david@ar.media.kyoto-u.ac.jp-20070924112351-pnnho638cohz6lj1
3756 david@david-laptop-20070924153247-yftud00bynilxv69
3757 david@david-laptop-20070924163545-pish34x9fq2h66aj
3758 david@david-laptop-20070924164633-iiyygcaw81ji3n34
3759 david@david-laptop-20070924170201-y14v2yzikdpvamfp
3760 david@david-laptop-20070924171208-5bmitorzf49d1aa2
3761 david@david-laptop-20070925014444-ns9v90gotnxt39mq
3769 david@david-laptop-20070925145952-4osi81tvch7v6luj
3773 david@ar.media.kyoto-u.ac.jp-20070926073429-2kdc6yf1o210aer0
3774 david@ar.media.kyoto-u.ac.jp-20070926084356-938djoytjap90rmo
3775 david@ar.media.kyoto-u.ac.jp-20070926085329-3gquq3gu2k8rgzb0
3776 david@ar.media.kyoto-u.ac.jp-20071009084906-9kradhwpu7su633x
3777 david@ar.media.kyoto-u.ac.jp-20071009093339-q5nf5me6ikdi48k6
3778 david@david-laptop-20071009152108-xh5cltii0h6zjk9b
3779 david@david-laptop-20071009154954-v5se05gbq60opo1z
3780 david@david-laptop-20071009223102-vz2sgf5i6pncxsd8
3781 david@david-laptop-20071009225259-13m6enwqk4w9uihe
3782 david@ar.media.kyoto-u.ac.jp-20071010021710-liz2jvw0ggbxrtgi
3783 david@ar.media.kyoto-u.ac.jp-20071010032218-8qzxvdmith85a056
3784 david@ar.media.kyoto-u.ac.jp-20071010032323-lgbxfd788h402kn0
3792 david@ar.media.kyoto-u.ac.jp-20071011033223-s14976refgeaw00h
3793 david@ar.media.kyoto-u.ac.jp-20071011033241-rrzlo2vu6w0tkdwf
3794 david@ar.media.kyoto-u.ac.jp-20071011071251-c5pxigyynpck262d
3795 david@ar.media.kyoto-u.ac.jp-20071012040323-8ka0mgkx1t8r9fcl
3796 david@ar.media.kyoto-u.ac.jp-20071012042801-44pmvc5o1u6p6wi7
3797 david@ar.media.kyoto-u.ac.jp-20071012071207-nfpsuyfoq0ooy7xf
3798 david@ar.media.kyoto-u.ac.jp-20071012073426-8o9tejzovgk7qzi4
3799 david@ar.media.kyoto-u.ac.jp-20071012074103-1fzviuk1sunv0b9n
3800 david@ar.media.kyoto-u.ac.jp-20071012074129-t5nu6f96wie8fd1y
3801 david@ar.media.kyoto-u.ac.jp-20071012100715-sq8hhctu5tynlx4m
3802 david@david-laptop-20071013043839-hc3yfsbn0t7gsuhe
3803 david@david-laptop-20071013123319-vf4b7yhadz9nxasc
3804 david@david-laptop-20071014063148-0bsktlh609c3rpv7
3805 david@david-laptop-20071014064841-liamaqiv3af71r3g
3806 david@david-laptop-20071014064900-j4yzxzuveukuyj2l
3807 david@david-laptop-20071014124401-n3a37y67u5imyo83

   + 3737 david@david-laptop-20070920080908-n8pj8vmszdir3zoa
3738 david@david-laptop-20070920081509-58kkojgmml3t7jxs
3739 david@david-laptop-20070920081910-phlk1ujthksgpm0z
3740 david@david-laptop-20070920082641-bdhrt6eafeoli50i
3741 david@ar.media.kyoto-u.ac.jp-20070920130730-satdeppbh1k0bq2p
3743 david@ar.media.kyoto-u.ac.jp-20070921073742-vpv8pwv0j8fbd93m
3744 david@david-laptop-20070922101656-61kfi2faucemr2rl
3745 david@david-laptop-20070922113708-ror18thshang1cpu
3747 david@david-laptop-20070922140534-n9xsl096tjrzmct1
3749 david@david-laptop-20070922154007-usit009fr6vp377j
3750 david@david-laptop-20070923070011-leu2ozc2fy1q5cht
3751 david@david-laptop-20070924015925-dhsiao40jp7zsfp9
3752 david@ar.media.kyoto-u.ac.jp-20070924070657-nbw23j0ayan30cli
3753 david@ar.media.kyoto-u.ac.jp-20070924082918-i1lc1zikywi8czj4
3754 david@ar.media.kyoto-u.ac.jp-20070924083008-c0edtt8zs31yeh1q
3755 david@ar.media.kyoto-u.ac.jp-20070924112351-pnnho638cohz6lj1
3756 david@david-laptop-20070924153247-yftud00bynilxv69
3757 david@david-laptop-20070924163545-pish34x9fq2h66aj
3758 david@david-laptop-20070924164633-iiyygcaw81ji3n34
3759 david@david-laptop-20070924170201-y14v2yzikdpvamfp
3760 david@david-laptop-20070924171208-5bmitorzf49d1aa2
3761 david@david-laptop-20070925014444-ns9v90gotnxt39mq
3769 david@david-laptop-20070925145952-4osi81tvch7v6luj
3773 david@ar.media.kyoto-u.ac.jp-20070926073429-2kdc6yf1o210aer0
3774 david@ar.media.kyoto-u.ac.jp-20070926084356-938djoytjap90rmo
3775 david@ar.media.kyoto-u.ac.jp-20070926085329-3gquq3gu2k8rgzb0
3776 david@ar.media.kyoto-u.ac.jp-20071009084906-9kradhwpu7su633x
3777 david@ar.media.kyoto-u.ac.jp-20071009093339-q5nf5me6ikdi48k6
3778 david@david-laptop-20071009152108-xh5cltii0h6zjk9b
3779 david@david-laptop-20071009154954-v5se05gbq60opo1z
3780 david@david-laptop-20071009223102-vz2sgf5i6pncxsd8
3781 david@david-laptop-20071009225259-13m6enwqk4w9uihe
3782 david@ar.media.kyoto-u.ac.jp-20071010021710-liz2jvw0ggbxrtgi
3783 david@ar.media.kyoto-u.ac.jp-20071010032218-8qzxvdmith85a056
3784 david@ar.media.kyoto-u.ac.jp-20071010032323-lgbxfd788h402kn0
3792 david@ar.media.kyoto-u.ac.jp-20071011033223-s14976refgeaw00h
3793 david@ar.media.kyoto-u.ac.jp-20071011033241-rrzlo2vu6w0tkdwf
3794 david@ar.media.kyoto-u.ac.jp-20071011071251-c5pxigyynpck262d
3795 david@ar.media.kyoto-u.ac.jp-20071012040323-8ka0mgkx1t8r9fcl
3796 david@ar.media.kyoto-u.ac.jp-20071012042801-44pmvc5o1u6p6wi7
3797 david@ar.media.kyoto-u.ac.jp-20071012071207-nfpsuyfoq0ooy7xf
3798 david@ar.media.kyoto-u.ac.jp-20071012073426-8o9tejzovgk7qzi4
3799 david@ar.media.kyoto-u.ac.jp-20071012074103-1fzviuk1sunv0b9n
3800 david@ar.media.kyoto-u.ac.jp-20071012074129-t5nu6f96wie8fd1y
3801 david@ar.media.kyoto-u.ac.jp-20071012100715-sq8hhctu5tynlx4m
3802 david@david-laptop-20071013043839-hc3yfsbn0t7gsuhe
3803 david@david-laptop-20071013123319-vf4b7yhadz9nxasc
3804 david@david-laptop-20071014063148-0bsktlh609c3rpv7
3805 david@david-laptop-20071014064841-liamaqiv3af71r3g
3806 david@david-laptop-20071014064900-j4yzxzuveukuyj2l
3807 david@david-laptop-20071014124401-n3a37y67u5imyo83
3808 david@david-laptop-20071014161201-hdljwkhh4ep0f9k2


Modified: branches/numpy.scons/numpy/core/SConstruct
===================================================================
--- branches/numpy.scons/numpy/core/SConstruct	2007-10-14 16:14:28 UTC (rev 4189)
+++ branches/numpy.scons/numpy/core/SConstruct	2007-10-14 16:14:56 UTC (rev 4190)
@@ -1,7 +1,7 @@
 # Last Change: Fri Oct 12 07:00 PM 2007 J
 # vim:syntax=python
 import os
-from os.path import join as pjoin
+from os.path import join as pjoin, basename as pbasename, dirname as pdirname
 import sys
 
 from numpy.distutils.scons import get_python_inc
@@ -73,15 +73,15 @@
 # Checking Types
 #---------------
 def check_type(type, include = None):
-    # XXX: handle space in type string
-    # Implement type size info in CheckSizeof
-    if config.CheckTypeSize(type, includes = include):
-        config_sym.append(('SIZEOF_%s' % type.upper(), 1))
+    st = config.CheckTypeSize(type, includes = include)
+    type = type.replace(' ', '_')
+    if st:
+        config_sym.append(('SIZEOF_%s' % type.upper(), '%d' % st))
     else:
         config_sym.append(('SIZEOF_%s' % type.upper(), 0))
 check_type('short')
 check_type('int')
-check_type('long')
+#check_type('long')
 check_type('float')
 check_type('double')
 check_type('long double')
@@ -155,10 +155,14 @@
 config_header = env.GenerateConfigHeader(pjoin(env['build_dir'], 'config.h'), [])
 
 # Builder to generate .inc from .inc.src
-from numpy.distutils.from_template import process_file
+from numpy.distutils.conv_template import process_str
 def do_generate_from_template(targetfile, sourcefile, env):
     t = open(targetfile, 'w')
-    string = process_file(sourcefile)
+    s = open(sourcefile, 'r')
+    allstr = s.read()
+    s.close()
+    writestr = process_str(allstr)
+    t.write(writestr)
     t.close()
     return 0
 
@@ -167,8 +171,8 @@
         do_generate_from_template(str(t), str(s), env)
 
 def generate_from_template_emitter(target, source, env):
-    base, ext = SCons.Util.splitext(str(target[0]))
-    t = base + '.inc'
+    base, ext = SCons.Util.splitext(pbasename(str(source[0])))
+    t = pjoin(pdirname(str(target[0])), base)
     return ([t], source)
     
 bld = Builder(action = generate_from_template, emitter = generate_from_template_emitter)
@@ -184,4 +188,15 @@
 multiarray_src = [
     pjoin('src', 'multiarraymodule.c'),
 ]
-#multiarray = env.NumpyPythonExtension('multiarray', source = multiarray_src)
+multiarray = env.NumpyPythonExtension('multiarray', source = multiarray_src)
+
+# Build sort module
+sortmodule_src = env.FromTemplate(pjoin(env['build_dir'], 'src', '_sortmodule'), 
+                                   pjoin(env['src_dir'], 'src', '_sortmodule.c.src'))
+sort = env.NumpyPythonExtension('_sort', source = sortmodule_src)
+
+# Build umath module
+umathmodule_src = env.FromTemplate(pjoin(env['build_dir'], 'src', 'umathmodule'), 
+                                   pjoin(env['src_dir'], 'src', 'umathmodule.c.src'))
+sort = env.NumpyPythonExtension('_sort', source = sortmodule_src)
+

Modified: branches/numpy.scons/numpy/core/setupscons.py
===================================================================
--- branches/numpy.scons/numpy/core/setupscons.py	2007-10-14 16:14:28 UTC (rev 4189)
+++ branches/numpy.scons/numpy/core/setupscons.py	2007-10-14 16:14:56 UTC (rev 4190)
@@ -203,17 +203,17 @@
     if sys.platform == 'cygwin':
         config.add_data_dir('include/numpy/fenv')
 
-    config.add_extension('multiarray',
-                         sources = [join('src','multiarraymodule.c'),
-                                    generate_config_h,
-                                    generate_array_api,
-                                    join('src','scalartypes.inc.src'),
-                                    join('src','arraytypes.inc.src'),
-                                    join(codegen_dir,'generate_array_api.py'),
-                                    join('*.py')
-                                    ],
-                         depends = deps,
-                         )
+    #config.add_extension('multiarray',
+    #                     sources = [join('src','multiarraymodule.c'),
+    #                                generate_config_h,
+    #                                generate_array_api,
+    #                                join('src','scalartypes.inc.src'),
+    #                                join('src','arraytypes.inc.src'),
+    #                                join(codegen_dir,'generate_array_api.py'),
+    #                                join('*.py')
+    #                                ],
+    #                     depends = deps,
+    #                     )
 
     config.add_extension('umath',
                          sources = [generate_config_h,
@@ -229,12 +229,12 @@
                                     ]+deps,
                          )
 
-    config.add_extension('_sort',
-                         sources=[join('src','_sortmodule.c.src'),
-                                  generate_config_h,
-                                  generate_array_api,
-                                  ],
-                         )
+    #config.add_extension('_sort',
+    #                     sources=[join('src','_sortmodule.c.src'),
+    #                              generate_config_h,
+    #                              generate_array_api,
+    #                              ],
+    #                     )
 
     config.add_extension('scalarmath',
                          sources=[join('src','scalarmathmodule.c.src'),

Modified: branches/numpy.scons/numpy/distutils/scons/custom_builders.py
===================================================================
--- branches/numpy.scons/numpy/distutils/scons/custom_builders.py	2007-10-14 16:14:28 UTC (rev 4189)
+++ branches/numpy.scons/numpy/distutils/scons/custom_builders.py	2007-10-14 16:14:56 UTC (rev 4190)
@@ -1,6 +1,7 @@
 from os.path import join as pjoin
 
 from SCons.Environment import Environment
+import SCons.Util
 
 def NumpySharedLibrary(env, target, source, *args, **kw):
     """This builder is the same than SharedLibrary, except for the fact that it
@@ -17,9 +18,14 @@
     """This builder is the same than PythonExtension, except for the fact that it
     takes into account build dir info passed by distutils, and put the target at
     the right location in distutils build directory for correct installation."""
-    source = [pjoin(env['build_dir'], i) for i in source]
+    newsource = []
+    for i in source:
+        if SCons.Util.is_String(i):
+            newsource.append(pjoin(env['build_dir'], i)) 
+        else:
+            newsource.append(i) 
     # XXX: why target is a list ? It is always true ?
-    lib = env.PythonExtension("$build_dir/%s" % target[0], source, *args, **kw)
+    lib = env.PythonExtension("$build_dir/%s" % target[0], newsource, *args, **kw)
 
     inst_lib = env.Install("$distutils_installdir", lib)
     return lib, inst_lib

Modified: branches/numpy.scons/test.sh
===================================================================
--- branches/numpy.scons/test.sh	2007-10-14 16:14:28 UTC (rev 4189)
+++ branches/numpy.scons/test.sh	2007-10-14 16:14:56 UTC (rev 4190)
@@ -1,5 +1,5 @@
-PREFIX=/usr/media/src/src/dsp/bzrversion/numpy.scons/tmp
+PREFIX=/usr/src/dsp/bzrversion/numpy.scons/tmp
 #rm -rf build
 rm -rf $PREFIX
-python setup.py install --prefix=$PREFIX
+python setupscons.py install --prefix=$PREFIX
 (cd $PREFIX && PYTHONPATH=$PREFIX/lib/python2.5/site-packages python -c "import numpy; print numpy; numpy.test(level = 9999)")



More information about the Numpy-svn mailing list