Open andrjohns opened 8 months ago
Fixed in main
But the package isn't loadable in webR:
> install.packages('StanEstimators',
repos = c('https://andrjohns.r-universe.dev', 'https://repo.r-wasm.org'))
Downloading webR package: Rcpp
Downloading webR package: RcppParallel
Downloading webR package: abind
Downloading webR package: backports
Downloading webR package: checkmate
Downloading webR package: rlang
Downloading webR package: fansi
Downloading webR package: cli
Downloading webR package: glue
Downloading webR package: lifecycle
Downloading webR package: magrittr
Downloading webR package: utf8
Downloading webR package: vctrs
Downloading webR package: pillar
Downloading webR package: pkgconfig
Downloading webR package: tibble
Downloading webR package: tensorA
Downloading webR package: generics
Downloading webR package: numDeriv
Downloading webR package: gtable
Downloading webR package: isoband
Downloading webR package: MASS
Downloading webR package: lattice
Downloading webR package: nlme
Downloading webR package: Matrix
Downloading webR package: mgcv
Downloading webR package: farver
Downloading webR package: labeling
Downloading webR package: colorspace
Downloading webR package: munsell
Downloading webR package: R6
Downloading webR package: RColorBrewer
Downloading webR package: viridisLite
Downloading webR package: scales
Downloading webR package: withr
Downloading webR package: ggplot2
Downloading webR package: digest
Downloading webR package: distributional
Downloading webR package: matrixStats
Downloading webR package: posterior
Downloading webR package: ps
Downloading webR package: processx
Downloading webR package: callr
Downloading webR package: codetools
Downloading webR package: globals
Downloading webR package: listenv
Downloading webR package: parallelly
Downloading webR package: future
Downloading webR package: RcppEigen
Downloading webR package: BH
Downloading webR package: rapidjsonr
Downloading webR package: StanEstimators
> library(StanEstimators)
Error: package or namespace load failed for ‘StanEstimators’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/usr/lib/R/library/StanEstimators/libs/StanEstimators.so':
Could not load dynamic lib: /usr/lib/R/library/StanEstimators/libs/StanEstimators.so
Error: bad export type for '_ZTIN3tbb4taskE': undefined
Ah that's what I get for not testing. What's the easiest way for me to iterate with webR? Do you use the demo web REPL or run something else locally?
I use the demo web REPL.
Ah, it looks like this will be a tricky one to get working. The Math library needs to link to the TBB (not just include it's headers). To do this under WASM, the TBB itself needs to be built with emscripten so that the library is in a format that it can be linked to. However, when installing/building RcppParallel
for webR, the TBB itself does not get built - so there is nothing for StanEstimators
to link to during installation.
I'll open an issue on the r-universe or r-wasm repo, but I don't expect this to be workable anytime too soon
Possibly. But compiling the TBB under emscripten is beyond the scope of what I can patch/fix in this package and likely to need a fairly non-trivial amount of work, so I'm not likely to tackle it any time soon unfortunately
No worries, it is more fun to have, rather than need to have. :)
Package fails to compile due to TBB architecture/machine detection issues, investigate appropriate TBB macros for WASM: