Open seananderson opened 4 years ago
I assume the important error is
Symbol not found: _CVode
The above was on OS X as described below. On Windows R 3.6.2 I've been told the error is:
undefined reference to `CVodeFree' collect2.exe: error: ld returned 1 exit status
Sorry you're getting an error. Thanks for reporting this. @bgoodri Any idea what's going here?
I can replicate the installation error on Linux, but I don't know why it is occurring. Perhaps the shared library of StanHeaders is not built correctly, but after a quick look it seems to include the right headers for that CVodeUserData thing.
On Fri, Jul 31, 2020 at 1:24 PM Sean Anderson notifications@github.com wrote:
Summary:
If I try to build an R package that uses rstan and includes the BDF ODE solver (integrate_ode_bdf), I receive the error Symbol not found: _CVode. Description:
- I am unable to build R packages that use the integrate_ode_bdf ODE solver using the set up as built by rstantools.
- The integrate_ode_rk45 ODE solver works.
- I can also build rstan models that use integrate_ode_bdf through rstan::stan_model or rstan::stan outside of an R package structure.
- I have posted a minimal R package in a GitHub repo below as an example.
- I'm not sure if this is an rstan or rstantools issue. If this should be an rstantools issue this could be moved there or this can be closed and I will repost.
Reproducible Steps:
Try to install this minimal package https://github.com/seananderson/testBDF I put together using rstantools::rstan_create_package() and an example from the Stan manual:
remotes::install_github("seananderson/testBDF")
Current Output:
Error: package or namespace load failed for ‘testBDF’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-testBDF/00new/testBDF/libs/testBDF.so':
dlopen(/Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-testBDF/00new/testBDF/libs/testBDF.so, 6): Symbol not found: _CVode
Referenced from: /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-testBDF/00new/testBDF/libs/testBDF.so
Expected in: flat namespace
in /Library/Frameworks/R.framework/Versions/4.0/Resources/library/00LOCK-testBDF/00new/testBDF/libs/testBDF.so
Error: loading failed
Execution halted
I assume the important error is Symbol not found: _CVode
The above was on OS X as described below. On Windows R 3.6.2 I've been told the error is:
undefined reference to `CVodeFree' collect2.exe: error: ld returned 1 exit status
Expected Output:
The package to build and install. The package will build and install if integrate_ode_bdf is replaced with integrate_ode_rk45. RStan Version:
rstan: 2.21.2 StanHeaders: 2.21.0.5 rstantools: 2.1.1 or 2.1.1.9000 R Version:
R version 4.0.2 (2020-06-22)
(Also tested on Windows R 3.6.2) Operating System:
OS X 10.15.6
(Also tested on Windows 10 1909)
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/825, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKTGK5DLO6DWMYWEHSLR6L46LANCNFSM4PQTGMZA .
OK, this is not as bad as I feared. Basically, rstantools does not do the right thing when the package wants to utilize CVODES. To fix it on Linux / Mac
To fix it on Windows,
Note that the added line refers to the lib subdirectory on Linux / Mac and the libs subdirectory on Windows.
@bgoodri Thanks for figuring this out. Can this be fixed in rstantools to avoid people having to manually edit Makevars?
Yes
On Fri, Aug 7, 2020, 12:04 PM Jonah Gabry notifications@github.com wrote:
@bgoodri https://github.com/bgoodri Thanks for figuring this out. Can this be fixed in rstantools to avoid people having to manually edit Makevars?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/825#issuecomment-670589751, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKWFPX6JSEDUPMOFAOTR7QQXFANCNFSM4PQTGMZA .
Ok, we might as well submit a new rstantools. If you fix it in rstantools let me know and I can submit a new version of rstantools to CRAN.
We need to somehow detect when the Stan programs are calling a function that utilizes CVODES. I guess grepl() on the Stan programs could work.
On Sat, Aug 8, 2020 at 3:57 PM Jonah Gabry notifications@github.com wrote:
Ok, we might as well submit a new rstantools. If you fix it in rstantools let me know and I can submit a new version of rstantools to CRAN.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/stan-dev/rstan/issues/825#issuecomment-670967865, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAZ2XKXHKM4KNTFRVU3MRO3R7WUZNANCNFSM4PQTGMZA .
Summary:
If I try to build an R package that uses rstan and includes the BDF ODE solver (
integrate_ode_bdf
), I receive the errorSymbol not found: _CVode
.Description:
integrate_ode_bdf
ODE solver using the set up as built by rstantools.integrate_ode_rk45
ODE solver works.integrate_ode_bdf
throughrstan::stan_model
orrstan::stan
outside of an R package structure.Reproducible Steps:
Try to install this minimal package I put together using
rstantools::rstan_create_package()
and an example from the Stan manual:Current Output:
I assume the important error is
Symbol not found: _CVode
The above was on OS X as described below. On Windows R 3.6.2 I've been told the error is:
Expected Output:
The package to build and install. The package will build and install if
integrate_ode_bdf
is replaced withintegrate_ode_rk45
.RStan Version:
rstan: 2.21.2 StanHeaders: 2.21.0.5 rstantools: 2.1.1 or 2.1.1.9000
R Version:
R version 4.0.2 (2020-06-22)
(Also tested on Windows R 3.6.2)
Operating System:
OS X 10.15.6
(Also tested on Windows 10 1909)