oracle / fastr

A high-performance implementation of the R programming language, built on GraalVM.
Other
623 stars 64 forks source link

RcppBDT build but not loadable #30

Closed comicfans closed 5 years ago

comicfans commented 5 years ago

install.packages('RcppBDT') can successfully build RcppBDT, but failed during test package loadable, with following error:

** help * installing help indices building package indices ** testing if installed package can be loaded Error: package or namespace load failed for ‘RcppBDT’ in .doLoadActions(where, attach): error in load action .A.1 for package RcppBDT: loadModule(module = "bdtDdMod", what = TRUE, env = ns, loadNow = TRUE): Unable to loa d module "bdtDdMod": shared object 'Rcpp_module_bdtDdMod' was not loaded Error: loading failed

RcppBDT seems built into

/usr/lib/jvm/java-8-graal/jre/languages/R/library/RcppBDT/libs/RcppBDT.so

try to load RcppBDT shows similar error:

library(RcppBDT) Error: package or namespace load failed for ‘RcppBDT’ in .doLoadActions(where, attach): error in load action .A.1 for package RcppBDT: loadModule(module = "bdtDdMod", what = TRUE, env = ns, loadNow = TRUE): Unable to loa d module "bdtDdMod": shared object 'Rcpp_module_bdtDdMod' was not loaded

graalvm versions:

GraalVM Polyglot Engine Version 1.0.0-rc9 Installed Languages: R version 3.4.0 JavaScript version 1.0 llvm version 6.0.0 Installed Tools: LLVMTracerInstrument version 1.0.0-rc9 CPU Sampler version 0.4.0 CPU Tracer version 0.3.0 Heap Allocation Monitor version 0.1.0 Chrome Inspector version 0.1 Memory Tracer version 0.2

I'm running archlinux 64 with system boost version 1.68.0-2

steve-s commented 5 years ago

Hi comicfans,

thank you for reporting this. We can reproduce the issue and are working on the fix.

steve-s commented 5 years ago

should be fixed by 2538211b7634d896ce3ff8d710348876db7dc7aa

comicfans commented 5 years ago

Hi steve: I'm afraid not , I've tried 2538211 , it did install and test loadable successfully , but if call library(RcppBDT), it throws

An internal error occurred: "should not reach here: unknown native reference 140506614136224L / 0x7fca3ed2fda0 (current id count: def0000000003c3)"

fastr_errors_pid5080.log

steve-s commented 5 years ago

Hi comicfans,

thanks for testing it and reporting back. We will take a look at it.

steve-s commented 5 years ago

So it seems that the root of the issue is that we had to change memory layout of a C structure so you have to clean build (mx clean && mx build) FastR and re-install all the packages with native code (the safest is just to remove the library directory and reinstall everything). Could you confirm that this solves the problem?

comicfans commented 5 years ago

Hi steve: I've clean & rebuild fastR and problem resolved.