1 # Copyright (C) 2005, 2006 The Trustees of Indiana University.
2 # Copyright (C) 2005 Douglas Gregor <doug.gregor -at- gmail.com>
3 # Copyright (c) 2018 Stefan Seefeld
5 # Use, modification and distribution is subject to the Boost Software
6 # License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 # http://www.boost.org/LICENSE_1_0.txt)
9 # Authors: Douglas Gregor
19 # The `version-suffix` rule really belongs into python.jam, and
20 # should be moved there. `split-version` is only duplicated here
21 # as a prerequisite. (See https://github.com/boostorg/build/pull/290)
25 # Validate the version string and extract the major/minor part we care about.
27 local rule split-version ( version )
29 local major-minor = [ MATCH "^([0-9]+)\.([0-9]+)(.*)$" : $(version) : 1 2 3 ] ;
30 if ! $(major-minor[2]) || $(major-minor[3])
32 ECHO "Warning: \"using python\" expects a two part (major, minor) version number; got" $(version) instead ;
34 # Add a zero to account for the missing digit if necessary.
38 return $(major-minor[1]) $(major-minor[2]) ;
41 # Define a version suffix for libraries depending on Python.
42 # For example, Boost.Python built for Python 2.7 uses the suffix "27"
43 rule version-suffix ( version )
45 local major-minor = [ split-version $(version) ] ;
46 local suffix = $(major-minor:J="") ;
51 # Python build id (for Python libraries only).
52 python-id = [ option.get "python-buildid" ] ;
55 PYTHON_ID = [ regex.replace $(python-id) "[*\\/:.\"\']" _ ] ;
58 rule python-tag ( name : type ? : property-set )
60 local result = $(name) ;
61 if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB
63 local version = [ $(property-set).get <python> ] ;
64 local lib-suffix = [ version-suffix $(version) ] ;
65 result = $(result)$(lib-suffix) ;
67 if $(type) in STATIC_LIB SHARED_LIB IMPORT_LIB && $(PYTHON_ID)
69 result = $(result)-$(PYTHON_ID) ;
72 # forward to the boost tagging rule
73 return [ tag $(result) : $(type) : $(property-set) ] ;
82 : source-location ../src
88 cartesian_communicator.cpp
95 graph_communicator.cpp
98 mpi_datatype_cache.cpp
99 mpi_datatype_oarchive.cpp
102 packed_skeleton_iarchive.cpp
103 packed_skeleton_oarchive.cpp
106 text_skeleton_oarchive.cpp
110 <library>../../serialization/build//boost_serialization
111 <library>/mpi//mpi [ mpi.extra-requirements ]
112 <define>BOOST_MPI_SOURCE=1
113 <link>shared:<define>BOOST_MPI_DYN_LINK=1
114 <local-visibility>global
117 : # Usage requirements
118 <library>../../serialization/build//boost_serialization
119 <library>/mpi//mpi [ mpi.extra-requirements ]
122 if [ python.configured ]
129 <library>/mpi//mpi [ mpi.extra-requirements ]
130 <library>/boost/python//boost_python
131 <link>shared:<define>BOOST_MPI_DYN_LINK=1
132 <link>shared:<define>BOOST_MPI_PYTHON_DYN_LINK=1
133 <link>shared:<define>BOOST_PYTHON_DYN_LINK=1
134 <define>BOOST_MPI_PYTHON_SOURCE=1
135 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
136 -<tag>@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag
137 <tag>@$(__name__).python-tag
138 <conditional>@python.require-py
139 <local-visibility>global
143 : # Usage requirements
144 <library>/mpi//mpi [ mpi.extra-requirements ]
149 python/collectives.cpp
150 python/py_communicator.cpp
152 python/documentation.cpp
153 python/py_environment.cpp
154 python/py_nonblocking.cpp
155 python/py_exception.cpp
157 python/py_request.cpp
158 python/skeleton_and_content.cpp
162 <library>/boost/python//boost_python
163 <library>boost_mpi_python
165 <library>/mpi//mpi [ mpi.extra-requirements ]
166 <link>shared:<define>BOOST_MPI_DYN_LINK=1
167 <link>shared:<define>BOOST_MPI_PYTHON_DYN_LINK=1
168 <link>shared:<define>BOOST_PYTHON_DYN_LINK=1
169 <link>shared <runtime-link>shared
170 <python-debugging>on:<define>BOOST_DEBUG_PYTHON
173 mpi_python_libs = boost_mpi_python mpi ;
176 else if ! ( --without-mpi in [ modules.peek : ARGV ] )
179 : "warning: skipping optional Message Passing Interface (MPI) library."
180 : "note: to enable MPI support, add \"using mpi ;\" to user-config.jam."
181 : "note: to suppress this message, pass \"--without-mpi\" to bjam."
182 : "note: otherwise, you can safely ignore this message."
190 boost-install boost_mpi $(mpi_python_libs) ;