Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change minimum required version of rstan #179

Open
2 of 4 tasks
davidsantiagoquevedo opened this issue May 4, 2024 · 6 comments
Open
2 of 4 tasks

Change minimum required version of rstan #179

davidsantiagoquevedo opened this issue May 4, 2024 · 6 comments
Assignees

Comments

@davidsantiagoquevedo
Copy link
Member

Please place an "x" in all the boxes that apply

  • I have the most recent version of linelist and R
  • I have found a bug
  • I have a reproducible example
  • I want to request a new feature

I got the following error when installing serofoi v 0.1.0. I have rstan 2.21.8 and rstantools 2.3.1.1. Updating both dependencies to their last versions fixes it. However, the versions in the DESCRIPTION file are > 2.18.1 and > 2.3.1, respectively.

Building serofoi 0.1.0Failed to build serofoi 0.1.0                                    
Error:                                                             
! error in pak subprocess
Caused by error in `stop_task_build(state, worker)`:
! Failed to build source package 'serofoi'
Full installation output:
* installing *source* package 'serofoi' ...
staged installation is only possible with locking
** using non-staged installation
SYNTAX ERROR, MESSAGE(S) FROM PARSER:
No matches for: 

  prob_infected_calculate(vector, matrix, int, int, int[ ])

Function prob_infected_calculate not found.
 error in 'model_tv_normal' at line 39, column 3
  -------------------------------------------------
    37:     age_max,
    38:     chunks
    39:   );
          ^
    40: }
  -------------------------------------------------

Error in rstan::stanc(file_name, allow_undefined = TRUE, obfuscate_model_name = FALSE,  : 
  failed to parse Stan model 'tv_normal' due to the above error.
Calls: <Anonymous> -> sapply -> lapply -> FUN -> <Anonymous>
Ejecución interrumpida
ERROR: configuration failed for package 'serofoi'
* removing '/tmp/RtmpQrI27O/pkg-lib2692291c945a/serofoi'
Type .Last.error to see the more details

@ntorresd
Copy link
Member

ntorresd commented May 4, 2024

It seems like it's a problem with the inclusion of prob_infected.stan in the functions{} chunks of the stan models. This is also done in {EpiNow2}, where the minimum required versions of these packages are rstan v2.26.0 and rstantools v2.2.0.

@jpavlich is there any way we can check what the minimum versions actually are for serofoi?

@jpavlich
Copy link
Member

jpavlich commented May 6, 2024

I'm not aware of any direct way to find that out. I see two possible alternatives:

  1. Carefully review stan's documentation to find the minimum version that supports every stan function used by serofoi
  2. Brute-force test until we find the minimum version for which serofoi builds without issues

It seems 2 is the easiest one :)

@jpavlich
Copy link
Member

jpavlich commented May 6, 2024

@davidsantiagoquevedo Which version of StanHeaders are you using?

@davidsantiagoquevedo
Copy link
Member Author

After updating rstan and rstantools I have 2.32.7. But I didn't take the version I had when the error occurred.

@davidsantiagoquevedo
Copy link
Member Author

I tested the installation on another machine, and it worked with

 > packageVersion("rstan")
[1] ‘2.26.22’
> packageVersion("rstantools")
[1] ‘2.3.1.1’
> packageVersion("StanHeaders")
[1] ‘2.26.27’

This might be a good starting point for the brute-force approach.

@jpavlich
Copy link
Member

I would postpone this issue until we create the new, refactored, serofoi version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants