parksw3 / epidist-paper

Other
10 stars 4 forks source link

Compilation error in latent_truncation_censoring_adjusted_delay() #32

Closed kcharniga closed 1 year ago

kcharniga commented 1 year ago

This function throws "internal compiler error: Segmentation fault" using the example workflow in the vignette. Full error message:

Compiling Stan program... In file included from stan/lib/stan_math/stan/math/rev/core/vari.hpp:7, from stan/lib/stan_math/stan/math/rev/core/var.hpp:8, from stan/lib/stan_math/stan/math/rev/meta/conditional_var_value.hpp:4, from stan/lib/stan_math/stan/math/rev/meta.hpp:6, from stan/lib/stan_math/stan/math/rev/core/accumulate_adjoints.hpp:5, from stan/lib/stan_math/stan/math/rev/core.hpp:4, from stan/lib/stan_math/stan/math/rev.hpp:8, from stan/lib/stan_math/stan/math.hpp:19, from stan/src/stan/model/model_header.hpp:4: stan/lib/stan_math/stan/math/rev/core/arena_matrix.hpp: In constructor 'stan::math::arena_matrix::arena_matrix(const T&) [with T = Eigen::Matrix<stan::math::var_value, -1, 1>; stan::require_eigen_t* = 0; MatrixType = Eigen::Matrix<stan::math::var_value, -1, 1>]': stan/lib/stan_math/stan/math/rev/core/arena_matrix.hpp:74:3: internal compiler error: Segmentation fault } ^

libbacktrace could not find executable to open Please submit a full bug report, with preprocessed source if appropriate. See https://github.com/r-windows for instructions.

mingw32-make.exe: *** [make/program:58: C:\Users\ruq7\AppData\Local\Temp\1\RtmpUhjGgw\model-3ea453d545be.exe] Error 1

Error: An error occurred during compilation! See the message above for more information.

parksw3 commented 1 year ago

Hm, I'm not sure what could be causing this issue. Are you able to run any other functions in the README file?

seabbs commented 1 year ago

Thanks @kcharniga,

Hmm this sounds like an Rtools issue on the face of it. Does cmdstanr::check_cmdstan_toolchain(fix = TRUE) produce no warnings for you?

kcharniga commented 1 year ago

The toolchain command says everything is working properly. I can now run everything in the README file except for this chunk:

draws |> make_relative_to_truth(secondary_dist) |> plot_relative_recovery(fill = model) + facet_wrap(vars(parameter), nrow = 1, scales = "free_x") + scale_fill_brewer(palette = "Dark2") + guides(fill = guide_none()) + labs( y = "Model", x = "Relative to ground truth" )

The error is: Error in eval(jsub, SDenv, parent.frame()) : object 'value' not found

parksw3 commented 1 year ago

Hmmm, that's very weird. I tried running the README file again but didn't have any problems. Is it possible that some packages might not be up to date? Have you tried running with a debug mode? If you're using Rstudio, there's a way to see where it breaks (by clicking rerun with debugs).

parksw3 commented 1 year ago

You can also try running renv::status() to see if any of the packages are out of date.

kcharniga commented 1 year ago

Updating the packages worked! Thanks