stan-dev / stan-dev/rstanarm

Compilation of 'rstanarm' survival extension failed

Open
#614 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
401
Forks
136
PR merge metrics
No merged PRs in 30d

Description

Using the code:

install.packages("rstanarm", repos = c("https://mc-stan.org/r-packages/", getOption("repos")))
devtools::install_github("stan-dev/rstanarm", ref = "feature/survival", build_vignettes = FALSE)

I am trying to install the survival extension of the rstanarm packages into my R version 4.2 on a Windows 10 computer.
It runs until:
C:/Users/wilhch00/AppData/Local/R/win-library/4.2/RcppEigen/include/Eigen/src/Core/DenseCoeffsBase.h:55:30: warning: ignoring attributes on template argument 'Eigen::internal::packet_traits::type' {aka '__m128d'} [-Wignored-attributes]
"C:/PROGRA1/R/R-421.3/bin/x64/Rscript" -e "source(file.path('..', 'tools', 'make_cc.R')); make_cc(commandArgs(TRUE))" stan_files/surv.stan

and then the error states that:
Error in rstan::stanc(file, allow_undefined = TRUE, obfuscate_model_name = FALSE) :
0
Semantic error in 'string', line 404, column 2 to line 411, column 3:

402: }
403:
404: vector quadrature_log_cdf(vector qwts, vector log_hazard, int qnodes, int N) {
^
405: int M = rows(log_hazard);
406: vector[M] hazard = exp(log_hazard);

Real return type required for probability functions ending in _log, _lpdf, _lupdf, _lpmf, _lupmf, _cdf, _lcdf, or _lccdf.
Calls: make_cc ->
Execution halted
make: *** [Makevars.win:28: stan_files/surv.cc] Error 1
rm stan_files/polr.cc stan_files/mvmer.cc stan_files/count.cc stan_files/lm.cc stan_files/jm.cc stan_files/bernoulli.cc stan_files/binomial.cc stan_files/continuous.cc
ERROR: compilation failed for package 'rstanarm'

  • removing 'C:/Users/wilhch00/AppData/Local/R/win-library/4.2/rstanarm'
  • restoring previous 'C:/Users/wilhch00/AppData/Local/R/win-library/4.2/rstanarm'
    Warning messages:
    1: In utils::untar(tarfile, ...) :
    ‘tar.exe -xf "C:\Users\wilhch00\AppData\Local\Temp\RtmpcphJws\file12c849956fc.tar.gz" -C "C:/Users/wilhch00/AppData/Local/Temp/RtmpcphJws/remotes12c83388f58"’ returned error code 1
    2: In i.p(...) :
    installation of package ‘C:/Users/wilhch00/AppData/Local/Temp/RtmpcphJws/file12c83b9a3c1e/rstanarm_2.26.1.tar.gz’ had non-zero exit status

I have tried to also download the survival extension and building the package from R studio as well.
But the same issue reoccurs.
Any help would be greatly appreciated.
Charlotte

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the reported Windows installation command and the failure in stan_files/surv.stan, especially the quadrature_log_cdf declaration around line 404. Read tools/make_cc.R and Makevars.win to trace how the Stan file is compiled, then reproduce the install failure and determine the compatible declaration or dependency state needed for the survival extension to build.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.