|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r51084 - in sandbox/SCons: libs/mpi/build tools/scons
From: loonycyborg_at_[hidden]
Date: 2009-02-08 07:30:24
Author: loonycyborg
Date: 2009-02-08 07:30:23 EST (Sun, 08 Feb 2009)
New Revision: 51084
URL: http://svn.boost.org/trac/boost/changeset/51084
Log:
Added support for Boost.MPI
Added:
sandbox/SCons/libs/mpi/build/SConscript (contents, props changed)
Text files modified:
sandbox/SCons/tools/scons/boost-configure.py | 11 +++++++++++
sandbox/SCons/tools/scons/boost-libs.py | 8 ++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
Added: sandbox/SCons/libs/mpi/build/SConscript
==============================================================================
--- (empty file)
+++ sandbox/SCons/libs/mpi/build/SConscript 2009-02-08 07:30:23 EST (Sun, 08 Feb 2009)
@@ -0,0 +1,70 @@
+# vi: syntax=python:et:ts=4
+Import("env")
+
+if not env.CheckMPI():
+ Return()
+
+env.Append(
+ CPPDEFINES = "BOOST_MPI_SOURCE=1",
+ LIBPATH = Dir("#/" + Dir(".").path.replace("/mpi/", "/serialization/")),
+ LIBS = "boost_serialization"
+ )
+env.BoostLibrary(
+ "mpi",
+ Split("""
+ broadcast.cpp
+ communicator.cpp
+ computation_tree.cpp
+ content_oarchive.cpp
+ environment.cpp
+ exception.cpp
+ graph_communicator.cpp
+ group.cpp
+ intercommunicator.cpp
+ mpi_datatype_cache.cpp
+ mpi_datatype_oarchive.cpp
+ packed_iarchive.cpp
+ packed_oarchive.cpp
+ packed_skeleton_iarchive.cpp
+ packed_skeleton_oarchive.cpp
+ point_to_point.cpp
+ request.cpp
+ text_skeleton_oarchive.cpp
+ timer.cpp
+ """)
+ )
+
+if not env.CheckPython():
+ Return()
+
+env = env.Clone()
+env.Append(
+ CPPDEFINES = "BOOST_MPI_PYTHON_SOURCE=1",
+ LIBPATH = [Dir("."), Dir("#/" + Dir(".").path.replace("/mpi/", "/python/"))],
+ LIBS = ["boost_mpi", "boost_python"]
+ )
+if env["LINK_DYNAMIC"]:
+ env.Append(CPPDEFINES = ["BOOST_MPI_PYTHON_DYN_LINK=1", "BOOST_PYTHON_DYN_LINK=1"])
+env.BoostLibrary(
+ "mpi_python",
+ "python/serialize.cpp"
+ )
+
+env.PythonExtension(
+ "mpi",
+ Split("""
+ python/collectives.cpp
+ python/py_communicator.cpp
+ python/datatypes.cpp
+ python/documentation.cpp
+ python/py_environment.cpp
+ python/py_nonblocking.cpp
+ python/py_exception.cpp
+ python/module.cpp
+ python/py_request.cpp
+ python/skeleton_and_content.cpp
+ python/status.cpp
+ python/py_timer.cpp
+ """),
+ LIBS = env["LIBS"] + ["boost_mpi_python"]
+ )
Modified: sandbox/SCons/tools/scons/boost-configure.py
==============================================================================
--- sandbox/SCons/tools/scons/boost-configure.py (original)
+++ sandbox/SCons/tools/scons/boost-configure.py 2009-02-08 07:30:23 EST (Sun, 08 Feb 2009)
@@ -36,10 +36,21 @@
env.AppendUnique(**self.flags)
self.have_dep = self.conf.CheckCHeader("Python.h")
+class CheckMPI(DependencyChecker):
+ def Check(self, env):
+ try:
+ from subprocess import Popen, PIPE
+ self.flags = env.ParseFlags(Popen(["mpic++", "-showme"], stdout = PIPE).communicate()[0].split(" ", 1)[1])
+ env.AppendUnique(**self.flags)
+ self.have_dep = self.conf.CheckCHeader("mpi.h")
+ except:
+ self.have_dep = False
+
def generate(env):
env.AddMethod(CheckZLib())
env.AddMethod(CheckBZip2())
env.AddMethod(CheckPython())
+ env.AddMethod(CheckMPI())
def exists():
return True
Modified: sandbox/SCons/tools/scons/boost-libs.py
==============================================================================
--- sandbox/SCons/tools/scons/boost-libs.py (original)
+++ sandbox/SCons/tools/scons/boost-libs.py 2009-02-08 07:30:23 EST (Sun, 08 Feb 2009)
@@ -1,4 +1,5 @@
# vi: syntax=python:et:ts=4
+import distutils.sysconfig
def BoostLibrary(env, lib, sources):
if env["LINK_DYNAMIC"]:
@@ -9,8 +10,15 @@
env.Alias(lib, lib_node)
return lib_node
+def PythonExtension(env, lib, sources, **kw):
+ if env["LINK_DYNAMIC"]:
+ env.Alias(lib,
+ env.SharedLibrary(lib, sources, SHLIBPREFIX='', SHLIBSUFFIX=distutils.sysconfig.get_config_var("SO"), **kw)
+ )
+
def exists(env):
return True
def generate(env):
env.AddMethod(BoostLibrary)
+ env.AddMethod(PythonExtension)
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