--- a/boostcpp.jam +++ b/boostcpp.jam @@ -104,7 +104,7 @@ python-id = [ option.get "python-buildid" ] ; if $(python-id) { - PYTHON_ID = [ regex.replace $(python-id) [*\\/:.\"\'] _ ] ; + PYTHON_ID = [ regex.replace $(python-id) [*\\/:\"\'] _ ] ; } --- a/libs/mpi/build/Jamfile.v2 +++ b/libs/mpi/build/Jamfile.v2 @@ -58,81 +58,50 @@ if [ python.configured ] { - py2-version = [ py-version 2 ] ; - py3-version = [ py-version 3 ] ; - - # These library names are synchronized with those defined by Boost.Python, see libs/python/build/Jamfile. - lib_boost_python(2) = boost_python ; - lib_boost_python(3) = boost_python3 ; - - lib_boost_python($(py2-version)) = $(lib_boost_python(2)) ; - lib_boost_python($(py3-version)) = $(lib_boost_python(3)) ; - - lib_boost_mpi_python(2) = boost_mpi_python ; - lib_boost_mpi_python(3) = boost_mpi_python3 ; - - lib_boost_mpi_python($(py2-version)) = $(lib_boost_mpi_python(2)) ; - lib_boost_mpi_python($(py3-version)) = $(lib_boost_mpi_python(3)) ; - - for local N in 2 3 - { - if $(py$(N)-version) - { - lib $(lib_boost_mpi_python($(py$(N)-version))) - : # Sources - python/serialize.cpp - : # Requirements - boost_mpi - /mpi//mpi [ mpi.extra-requirements ] - /boost/python//$(lib_boost_python($(py$(N)-version))) - shared:BOOST_MPI_DYN_LINK=1 - shared:BOOST_MPI_PYTHON_DYN_LINK=1 - shared:BOOST_PYTHON_DYN_LINK=1 - BOOST_MPI_PYTHON_SOURCE=1 - -@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag - @$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag - on:BOOST_DEBUG_PYTHON - $(py$(N)-version) - : # Default build - shared - : # Usage requirements - /mpi//mpi [ mpi.extra-requirements ] - ; - - python-extension mpi - : # Sources - 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 - : # Requirements - /boost/python//$(lib_boost_python($(py$(N)-version))) - $(lib_boost_mpi_python($(py$(N)-version))) - boost_mpi - /mpi//mpi [ mpi.extra-requirements ] - shared:BOOST_MPI_DYN_LINK=1 - shared:BOOST_MPI_PYTHON_DYN_LINK=1 - shared:BOOST_PYTHON_DYN_LINK=1 - shared shared - on:BOOST_DEBUG_PYTHON - $(py$(N)-version) - ; - - libraries += $(lib_boost_mpi_python($(py$(N)-version))) ; - } - else - { - alias $(lib_boost_mpi_python($(N))) ; - } - } + lib boost_mpi_python + : # Sources + python/serialize.cpp + : # Requirements + boost_mpi + /mpi//mpi [ mpi.extra-requirements ] + /boost/python//boost_python + shared:BOOST_MPI_DYN_LINK=1 + shared:BOOST_MPI_PYTHON_DYN_LINK=1 + shared:BOOST_PYTHON_DYN_LINK=1 + BOOST_MPI_PYTHON_SOURCE=1 + -@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag + @$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag + : # Default build + shared + : # Usage requirements + /mpi//mpi [ mpi.extra-requirements ] + ; + libraries += boost_mpi_python ; + + python-extension mpi + : # Sources + 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 + : # Requirements + /boost/python//boost_python + boost_mpi_python + boost_mpi + /mpi//mpi [ mpi.extra-requirements ] + shared:BOOST_MPI_DYN_LINK=1 + shared:BOOST_MPI_PYTHON_DYN_LINK=1 + shared:BOOST_PYTHON_DYN_LINK=1 + shared shared + ; } } else if ! ( --without-mpi in [ modules.peek : ARGV ] ) --- a/libs/python/build/Jamfile +++ b/libs/python/build/Jamfile @@ -31,26 +31,23 @@ ; } -py2-version = [ py-version 2 ] ; -py3-version = [ py-version 3 ] ; - project boost/python : source-location ../src ; rule cond ( test ? : yes * : no * ) { if $(test) { return $(yes) ; } else { return $(no) ; } } rule unless ( test ? : yes * : no * ) { if ! $(test) { return $(yes) ; } else { return $(no) ; } } -local rule eq ( a : b ) { if $(a) = $(b) { return 1 ; } } - -lib_boost_python(2) = boost_python ; -lib_boost_python(3) = boost_python3 ; - -lib_boost_python($(py2-version)) = $(lib_boost_python(2)) ; -lib_boost_python($(py3-version)) = $(lib_boost_python(3)) ; -rule lib_boost_python ( version ) +rule lib_boost_python { - lib $(lib_boost_python($(version))) + local python_major_version = [ MATCH "^([^.]+)" : [ feature.values python ] ] ; + local python2 ; + if $(python_major_version) = 2 + { + python2 = true ; + } + + lib boost_python : # sources list.cpp long.cpp @@ -96,7 +93,8 @@ # python_for_extensions is a target defined by Boost.Build to # provide the Python include paths, and on Windows, the Python # import library, as usage requirements. - [ cond [ python.configured ] : /python//python_for_extensions ] + [ cond $(python2) : -fno-strict-aliasing ] + [ cond [ python.configured ] : /python//python ] # we prevent building when there is no python available # as it's not possible anyway, and to cause dependents to @@ -105,13 +103,10 @@ config-warning on:BOOST_DEBUG_PYTHON - $(version) -@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag @$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag - @python.require-py - : # default build shared : # usage requirements @@ -120,68 +115,8 @@ ; } -lib_boost_numpy(2) = boost_numpy ; -lib_boost_numpy(3) = boost_numpy3 ; - -lib_boost_numpy($(py2-version)) = $(lib_boost_numpy(2)) ; -lib_boost_numpy($(py3-version)) = $(lib_boost_numpy(3)) ; - -rule lib_boost_numpy ( version ) -{ - numpy-include = [ python.numpy-include ] ; - lib $(lib_boost_numpy($(version))) - : # sources - numpy/dtype.cpp - numpy/matrix.cpp - numpy/ndarray.cpp - numpy/numpy.cpp - numpy/scalars.cpp - numpy/ufunc.cpp - : # requirements - static:BOOST_NUMPY_STATIC_LIB - BOOST_NUMPY_SOURCE - [ cond [ python.numpy ] : /python//python_for_extensions ] - [ unless [ python.numpy ] : no ] - $(numpy-include) - $(lib_boost_python($(version))) - on:BOOST_DEBUG_PYTHON - $(version) +libraries = boost_python ; - -@$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).tag - @$(BOOST_JAMROOT_MODULE)%$(BOOST_JAMROOT_MODULE).python-tag - - @python.require-py - - : # default build - shared - : # usage requirements - static:BOOST_NUMPY_STATIC_LIB - on:BOOST_DEBUG_PYTHON - ; -} - -libraries = ; - -for local N in 2 3 -{ - if $(py$(N)-version) - { - lib_boost_python $(py$(N)-version) ; - libraries += $(lib_boost_python($(py$(N)-version))) ; - } - else - { - alias $(lib_boost_python($(N))) ; - } - if $(py$(N)-version) && [ python.numpy ] - { - lib_boost_numpy $(py$(N)-version) ; - libraries += $(lib_boost_numpy($(py$(N)-version))) ; - } - else - { - alias $(lib_boost_numpy($(N))) ; - } -} +lib_boost_python ; boost-install $(libraries) ;