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

Model compile apparent error in the getting started but fitting is successful? #532

Open
athowes opened this issue Feb 17, 2025 · 7 comments · Fixed by #533
Open

Model compile apparent error in the getting started but fitting is successful? #532

athowes opened this issue Feb 17, 2025 · 7 comments · Fixed by #533
Labels
bug Something isn't working

Comments

@athowes
Copy link
Collaborator

athowes commented Feb 17, 2025

The getting started vignette has a bug on main currently, see here, or:

fit <- epidist(
  data = data, chains = 2, cores = 2, refresh = ifelse(interactive()), 250, 0)
)
#> Running /opt/R/4.4.2/lib/R/bin/R CMD SHLIB foo.c
#> using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
#> gcc -I"/opt/R/4.4.2/lib/R/include" -DNDEBUG   -I"/home/runner/work/_temp/Library/Rcpp/include/"  -I"/home/runner/work/_temp/Library/RcppEigen/include/"  -I"/home/runner/work/_temp/Library/RcppEigen/include/unsupported"  -I"/home/runner/work/_temp/Library/BH/include" -I"/home/runner/work/_temp/Library/StanHeaders/include/src/"  -I"/home/runner/work/_temp/Library/StanHeaders/include/"  -I"/home/runner/work/_temp/Library/RcppParallel/include/"  -I"/home/runner/work/_temp/Library/rstan/include" -DEIGEN_NO_DEBUG  -DBOOST_DISABLE_ASSERTS  -DBOOST_PENDING_INTEGER_LOG2_HPP  -DSTAN_THREADS  -DUSE_STANC3 -DSTRICT_R_HEADERS  -DBOOST_PHOENIX_NO_VARIADIC_EXPRESSION  -D_HAS_AUTO_PTR_ETC=0  -include '/home/runner/work/_temp/Library/StanHeaders/include/stan/math/prim/fun/Eigen.hpp'  -D_REENTRANT -DRCPP_PARALLEL_USE_TBB=1   -I/usr/local/include    -fpic  -g -O2  -c foo.c -o foo.o
#> In file included from /home/runner/work/_temp/Library/RcppEigen/include/Eigen/Core:19,
#>                  from /home/runner/work/_temp/Library/RcppEigen/include/Eigen/Dense:1,
#>                  from /home/runner/work/_temp/Library/StanHeaders/include/stan/math/prim/fun/Eigen.hpp:22,
#>                  from <command-line>:
#> /home/runner/work/_temp/Library/RcppEigen/include/Eigen/src/Core/util/Macros.h:679:10: fatal error: cmath: No such file or directory
#>   679 | #include <cmath>
#>       |          ^~~~~~~
#> compilation terminated.
#> make: *** [/opt/R/4.4.2/lib/R/etc/Makeconf:195: foo.o] Error 1

Looks to be to do with Stan versions ("fatal error: cmath: No such file or directory").

Edit: doesn't happen with cmdstanr backend so an rstan problem.

@athowes athowes added the bug Something isn't working label Feb 17, 2025
@athowes
Copy link
Collaborator Author

athowes commented Feb 17, 2025

Looks related (both fatal to do with cmath) to my report in #526 (comment).

@seabbs
Copy link
Contributor

seabbs commented Feb 17, 2025

it doesnt exist in the CI so I think its a caching failure. I am not sure why the cache is on

@seabbs seabbs mentioned this issue Feb 17, 2025
9 tasks
seabbs added a commit that referenced this issue Feb 17, 2025
* Removce caching

* Update NEWS.md
@seabbs seabbs reopened this Feb 17, 2025
@seabbs seabbs changed the title Model fit failure on getting started vignette Model compile apparent error in the getting started Feb 17, 2025
@seabbs
Copy link
Contributor

seabbs commented Feb 17, 2025

I see that this isnt blocking a fit from happening as the fit object is present with or without caching so it must be a compile warning vs fit. I have edited the title to reflect this

@seabbs seabbs changed the title Model compile apparent error in the getting started Model compile apparent error in the getting started but fitting is successful? Feb 17, 2025
@athowes
Copy link
Collaborator Author

athowes commented Feb 18, 2025

I have a similar issue locally. Initially was discussed on #526:

I downgraded rstan to:

> packageVersion("rstan")
[1] ‘2.32.6

and used:

> packageVersion("primarycensored")
[1] ‘1.1.0.1000

Doing this and trying to run the model I get a pop-up:

Image

If I press "Yes" then it hangs at for a while:

Image

Then eventually it runs and fits OK.

The next time I run the code, it asks me again if I'd like to install the build tools.

This looks like it would explain the results in #532 (there is a compile error, but eventually it runs).

@seabbs
Copy link
Contributor

seabbs commented Feb 18, 2025

As in the other thread can you check the cran version of primarycensored?

@athowes
Copy link
Collaborator Author

athowes commented Feb 18, 2025

As in the other thread can you check the cran version of primarycensored?

Yep with CRAN version of primarycensored (primarycensored_1.1.0) then it was OK.

@seabbs
Copy link
Contributor

seabbs commented Feb 18, 2025

Hmm tricky. I can look at this more but my expectation is that this is related to the build tools (i.e it should show up if forcing the install from CRAN to be from source). We have had a flag from CRAN that rstan is throwing a warning/error somewhat like this for all CRAN rstan based packages which I expect will get resolved pretty quick so I would think this should be transcient. I think given that I am going to take no action for a week or so and see where we are? As this doesn't stop models actually being fit that seems like it wont block anything?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants