Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r72292 - in sandbox/numpy: . libs/python/numpy/src libs/python/numpy/test
From: seefeld_at_[hidden]
Date: 2011-05-30 16:39:45


Author: stefan
Date: 2011-05-30 16:39:43 EDT (Mon, 30 May 2011)
New Revision: 72292
URL: http://svn.boost.org/trac/boost/changeset/72292

Log:
Move build system improvements
Added:
   sandbox/numpy/Jamroot
      - copied unchanged from r72269, /sandbox/numpy/Jamroot.jam
Removed:
   sandbox/numpy/Jamroot.jam
   sandbox/numpy/numpy.jam
   sandbox/numpy/patch
Text files modified:
   sandbox/numpy/libs/python/numpy/src/Jamfile | 23 +++++++++++++++++++----
   sandbox/numpy/libs/python/numpy/test/Jamfile | 21 +++++++++++----------
   2 files changed, 30 insertions(+), 14 deletions(-)

Deleted: sandbox/numpy/Jamroot.jam
==============================================================================
--- sandbox/numpy/Jamroot.jam 2011-05-30 16:39:43 EDT (Mon, 30 May 2011)
+++ (empty file)
@@ -1,7 +0,0 @@
-
-
-project boost_numpy
- : requirements <include>.
- : build-dir bin.v2
- ;
-

Modified: sandbox/numpy/libs/python/numpy/src/Jamfile
==============================================================================
--- sandbox/numpy/libs/python/numpy/src/Jamfile (original)
+++ sandbox/numpy/libs/python/numpy/src/Jamfile 2011-05-30 16:39:43 EDT (Mon, 30 May 2011)
@@ -1,12 +1,10 @@
 import python ;
-import numpy ;
-
+#import numpy ;
+import regex ;
 using python ;
 
 libraries = ;
 
-#How will the probe command be called ?
-
 if [ python.configured ]
 {
 
@@ -17,6 +15,20 @@
 
 lib boost_python ;
 
+rule numpy-includes ( properties * )
+{
+ import feature ;
+ local python-interpreter = [ feature.get-values python.interpreter : $(properties) ] ;
+ if $(python-interpreter)
+ {
+ local full-cmd =
+ $(python-interpreter)" -c \"from numpy.distutils import misc_util; print ':'.join(misc_util.get_numpy_include_dirs())\" " ;
+ local output = [ SHELL $(full-cmd) ] ;
+ local includes = [ regex.split $(output) ":" ] ;
+ return <include>$(includes) ;
+ }
+}
+
 lib boost_numpy
   : # sources
     dtype.cpp
@@ -29,8 +41,11 @@
     <library>/python//python_for_extensions
     #<library>/boost/python//boost_python
     <library>boost_python
+ <conditional>@numpy-includes
   : # default build
     <link>shared
+ : # usage requirements
+ <conditional>@numpy-includes
   ;
 
 libraries += boost_numpy ;

Modified: sandbox/numpy/libs/python/numpy/test/Jamfile
==============================================================================
--- sandbox/numpy/libs/python/numpy/test/Jamfile (original)
+++ sandbox/numpy/libs/python/numpy/test/Jamfile 2011-05-30 16:39:43 EDT (Mon, 30 May 2011)
@@ -1,18 +1,20 @@
-import numpy ;
-
+import testing ;
+import python ;
 
 use-project /boost/numpy : ../src ;
-project /boost/numpy/test
- : requirements
- # Why isn't this provided by 'using python' ?
- #<include>/usr/include/python2.7
- ;
+project /boost/numpy/test ;
 
+rule numpy-test ( name : sources * : requirements * )
+{
+ sources ?= $(name).py $(name)_mod.cpp ;
+ return [ testing.make-test run-pyd : $(sources) /boost/numpy//boost_numpy
+ : $(requirements) : $(name) ] ;
+}
 
 test-suite numpy
   :
 
-[ numpy.numpy-test templates ]
-[ numpy.numpy-test ufunc ]
+ [ numpy-test templates ]
+ [ numpy-test ufunc ]
 
   ;

Deleted: sandbox/numpy/numpy.jam
==============================================================================
--- sandbox/numpy/numpy.jam 2011-05-30 16:39:43 EDT (Mon, 30 May 2011)
+++ (empty file)
@@ -1,23 +0,0 @@
-import testing ;
-import python ;
-
-rule init ( )
-{
- project.push-current $(.project) ;
- debug-message Configuring numpy... ;
-
- local full-cmd =
- $(python.interpreter)" -c \"from numpy.distutils import misc_util; print misc_util.get_numpy_include_dirs()" ;
-
- local output = [ shell-cmd $(full-cmd) ] ;
- includes = $(output) ;
-
- project.pop-current ;
-}
-
-rule numpy-test ( name : sources * : requirements * )
-{
- sources ?= $(name).py $(name)_mod.cpp ;
- return [ testing.make-test run-pyd : $(sources) /boost/numpy//boost_numpy
- : $(requirements) : $(name) ] ;
-}

Deleted: sandbox/numpy/patch
==============================================================================
--- sandbox/numpy/patch 2011-05-30 16:39:43 EDT (Mon, 30 May 2011)
+++ (empty file)
@@ -1,14 +0,0 @@
-Index: SConscript
-===================================================================
---- SConscript (revision 70774)
-+++ SConscript (working copy)
-@@ -10,7 +10,8 @@
- )
- bp_numpy_env = scons_tools.GetEnvironment().Clone()
- bp_numpy_env.Append(CPPPATH=[os.path.abspath(os.curdir)])
--libpath = os.path.abspath("%s/python/numpy/src" % scons_tools.GetBuildDir())
-+#libpath = os.path.abspath("%s/python/numpy/src" % scons_tools.GetBuildDir())
-+libpath = os.path.abspath("libs/python/numpy/src")
- if os.environ.has_key("LD_LIBRARY_PATH"):
- bp_numpy_env["ENV"]["LD_LIBRARY_PATH"] = "%s:%s" % (libpath, os.environ["LD_LIBRARY_PATH"])
- else:


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk