RcppCore/RcppParallel

Error installing my package with recent RcppParallel updates

schuyler-smith opened this issue · 2 comments

Hi. I am using RcppParallel in my package phylosmith for implementing openMP. I hadn't had any issues with the installation until recently where i get the error when R tries to load it

*** installing help indices
** building package indices
** installing vignettes
** testing if installed package can be loaded from temporary location
Error: package or namespace load failed for ‘phylosmith’ in dyn.load(file, DLLpath = DLLpath, ...):
 unable to load shared object '/home/schuyler/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-phylosmith/00new/phylosmith/libs/phylosmith.so':
  /home/schuyler/R/x86_64-pc-linux-gnu-library/4.0/00LOCK-phylosmith/00new/phylosmith/libs/phylosmith.so: undefined symbol: _ZN3tbb10interface58internal9task_base7destroyERNS_4taskE
Error: loading failed
Execution halted
ERROR: loading failed

I reinistalled a previous version of RcppParallel and the error doesn't occur. My understanding is this has something to do with TBB libraries, but I don't have enough understanding to know what I didn't include that would cause the updates to throw this error now. I assume it would be something in my makevars file(s). I tried to update them on my local copy to reflect the documentation here, but still the same result. I also tried updating the flags for oneTBB as detailed on the RcppParallel github page README, and that didn't change the results either.

If you have any ideas of where I should be looking to fix my issues, it'd be much appreciated!

I suspect you need to:

  1. Include Imports: RcppParallel in your DESCRIPTION file, and
  2. Import something explicitly from RcppParallel in your NAMESPACE; e.g. importFrom(RcppParallel, setThreadOptions)

Wow. Thank you so much. The auto-generated NAMESPACE from devtools::document() wasn't adding it as an imported package even after I denoted it as so in the DESCRIPTION file. I didn't think to check that.

Thanks so much for your time and kind help!