--- boost_1_63_0/libs/mpi/build/Jamfile.v2 2016-12-22 06:33:17.000000000 -0600 +++ boost_1_63_0/libs/mpi/build/Jamfile.v2 2017-05-19 01:45:05.485563800 -0500 @@ -11,6 +11,7 @@ import mpi ; import indirect ; import python ; +import feature ; libraries = ; @@ -53,18 +54,38 @@ lib boost_mpi ../../serialization/build//boost_serialization /mpi//mpi [ mpi.extra-requirements ] ; + +rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { return $(no) ; } } libraries += boost_mpi ; +rule find-py3-version +{ + local versions = [ feature.values python ] ; + local py3ver ; + for local v in $(versions) + { + if $(v) >= 3.0 + { + py3ver = $(v) ; + } + } + return $(py3ver) ; +} + +py3-version = [ find-py3-version ] ; if [ python.configured ] { - lib boost_mpi_python + + rule lib_boost_mpi_python ( is-py3 ? ) { + + lib [ cond $(is-py3) : boost_mpi_python3 : boost_mpi_python ] : # Sources python/serialize.cpp : # Requirements boost_mpi /mpi//mpi [ mpi.extra-requirements ] - /boost/python//boost_python + [ cond $(is-py3) : /boost/python//boost_python3 : /boost/python//boost_python ] shared:BOOST_MPI_DYN_LINK=1 shared:BOOST_MPI_PYTHON_DYN_LINK=1 shared:BOOST_PYTHON_DYN_LINK=1 @@ -76,7 +97,6 @@ libraries += boost_mpi ; : # Usage requirements /mpi//mpi [ mpi.extra-requirements ] ; - libraries += boost_mpi_python ; python-extension mpi : # Sources @@ -93,8 +113,8 @@ libraries += boost_mpi ; python/status.cpp python/py_timer.cpp : # Requirements - /boost/python//boost_python - boost_mpi_python + [ cond $(is-py3) : /boost/python//boost_python3 : /boost/python//boost_python ] + [ cond $(is-py3) : boost_mpi_python3 : boost_mpi_python ] boost_mpi /mpi//mpi [ mpi.extra-requirements ] shared:BOOST_MPI_DYN_LINK=1 @@ -102,6 +122,16 @@ libraries += boost_mpi ; shared:BOOST_PYTHON_DYN_LINK=1 shared shared ; + } + + if $(py3-version) { + lib_boost_mpi_python yes ; + libraries += boost_mpi_python3 ; + } else { + lib_boost_mpi_python ; + libraries += boost_mpi_python ; + } + } } else if ! ( --without-mpi in [ modules.peek : ARGV ] )