diff options
| author | Joshua Watt <jpewhacker@gmail.com> | 2018-02-12 13:39:58 -0600 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2018-02-16 18:05:40 +0000 |
| commit | feded5fe2755fc6523c235fd6e82a0972e197c08 (patch) | |
| tree | 91d80f0b7121167e9e7822ee6a450d56d6a06e60 /meta/recipes-support/boost/boost.inc | |
| parent | c723f7c92a15daba5c8ec1d801ce8debb47d59bf (diff) | |
| download | poky-feded5fe2755fc6523c235fd6e82a0972e197c08.tar.gz | |
utils.py: add parallel make helpers
The code to extract the integer number of parallel build threads and
construct a new argument from them has started to be copied in multiple
locations, so create two new helper utilities to aid recipes.
The first helper (parallel_make()) extracts the integer number of
parallel build threads from PARALLEL_MAKE. The second
(parallel_make_argument()) does the same and then puts the result back
into a format string, optionally clamping it to some maximum value.
Additionally, rework the oe-core recipes that were manually doing this
to use the new helper utilities.
(From OE-Core rev: ccd1142d22b31ed85d8823b1bc9e11ccfd72b61f)
Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-support/boost/boost.inc')
| -rw-r--r-- | meta/recipes-support/boost/boost.inc | 24 |
1 files changed, 1 insertions, 23 deletions
diff --git a/meta/recipes-support/boost/boost.inc b/meta/recipes-support/boost/boost.inc index 41fc90fb21..0461ec6fcf 100644 --- a/meta/recipes-support/boost/boost.inc +++ b/meta/recipes-support/boost/boost.inc | |||
| @@ -135,29 +135,7 @@ BJAM_TOOLS = "--ignore-site-config \ | |||
| 135 | 135 | ||
| 136 | # use PARALLEL_MAKE to speed up the build, but limit it by -j 64, greater parallelism causes bjam to segfault or to ignore -j | 136 | # use PARALLEL_MAKE to speed up the build, but limit it by -j 64, greater parallelism causes bjam to segfault or to ignore -j |
| 137 | # https://svn.boost.org/trac/boost/ticket/7634 | 137 | # https://svn.boost.org/trac/boost/ticket/7634 |
| 138 | def get_boost_parallel_make(d): | 138 | BOOST_PARALLEL_MAKE = "${@oe.utils.parallel_make_argument(d, '-j%d', limit=64)}" |
| 139 | pm = d.getVar('PARALLEL_MAKE') | ||
| 140 | if pm: | ||
| 141 | # look for '-j' and throw other options (e.g. '-l') away | ||
| 142 | # because they might have different meaning in bjam | ||
| 143 | pm = pm.split() | ||
| 144 | while pm: | ||
| 145 | v = None | ||
| 146 | opt = pm.pop(0) | ||
| 147 | if opt == '-j': | ||
| 148 | v = pm.pop(0) | ||
| 149 | elif opt.startswith('-j'): | ||
| 150 | v = opt[2:].strip() | ||
| 151 | else: | ||
| 152 | v = None | ||
| 153 | |||
| 154 | if v: | ||
| 155 | v = min(64, int(v)) | ||
| 156 | return '-j' + str(v) | ||
| 157 | |||
| 158 | return "" | ||
| 159 | |||
| 160 | BOOST_PARALLEL_MAKE = "${@get_boost_parallel_make(d)}" | ||
| 161 | BJAM_OPTS = '${BOOST_PARALLEL_MAKE} -d+2 -q \ | 139 | BJAM_OPTS = '${BOOST_PARALLEL_MAKE} -d+2 -q \ |
| 162 | ${BJAM_TOOLS} \ | 140 | ${BJAM_TOOLS} \ |
| 163 | -sBOOST_BUILD_USER_CONFIG=${WORKDIR}/user-config.jam \ | 141 | -sBOOST_BUILD_USER_CONFIG=${WORKDIR}/user-config.jam \ |
