[R-pkg-team] Bug#1012219: Please adjust StanHeaders to new version of (one)tbb

Nilesh Patra nilesh at nileshpatra.info
Sat Sep 3 21:44:24 BST 2022


Hi all,

On 9/3/22 22:06, Benjamin K Goodrich wrote:
> Sorry for the late reply. I am told that StanHeaders can be built
> successfully with oneTBB by setting environmental variables like
> TBB_INC and TBB_LIB. On CRAN, we would like to use the version of TBB
> that comes with the RcppParallel package
> [...]

Thanks for the pointers, but
we are able to build cppparallel and stanheaders without problems as is. But the built package is
unusable as it uses "#include" statements that try to include files available in older tbb but
not in new onetbb, as observed in rstan compilation.

The problematic #include statment (and corresponding removed APIs) seems to be stemming from
"inst/include/stan/math/prim/core/init_threadpool_tbb.hpp"

On taking a deeper look, I observed that this is directly embedded from stan/math[1]
The current release of stanheaders contains an older copy of the math lib.
Going fwd, a patch had been added to stan/math to make it compatible with onetbb[2]
On cherry-picking a couple of changes from there, I am able to get rstan to compile.

I am not very sure if everything is good/works as expected (autopkgtests / CRAN tests seem
to pass, so that's a good indication), but I'd be thrilled to believe so.

[1]: https://github.com/stan-dev/math
[2]: https://github.com/stan-dev/math/commit/6f94b2a70d11276a53e5b5bc4100d3ffa524b96c

-- 
Best,
Nilesh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 840 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/r-pkg-team/attachments/20220904/68a839b7/attachment.sig>


More information about the R-pkg-team mailing list