richfitz / diversitree

diversitree: comparative phylogenetic analyses of diversification
http://www.zoology.ubc.ca/prog/diversitree
30 stars 9 forks source link

crash in fortran code with new clang #44

Open richfitz opened 10 months ago

richfitz commented 10 months ago
docker pull ghcr.io/r-hub/containers/clang17
docker run -v ${PWD}:/src -it --rm ghcr.io/r-hub/containers/clang17
apt-get update && apt-get -y install gdb git libfftw3-dev libgsl-dev vim
R -e 'options(repos = "https://cloud.r-project.org"); install.packages(c("Rcpp", "ape", "deSolve", "subplex", "Rcpp"))'

# Fresh
git clone https://github.com/richfitz/diversitree
git -C diversitree checkout cran-fixes

# There are lots of concerning warnings in about the problematic part
# of the fortran code here.
R CMD INSTALL diversitree

cat <<EOF > err.R
library(diversitree)
RNGkind(sample.kind = "Rounding")
pars <- c(0.1, 0.2, 0.03, 0.03, 0.01, 0.01)
set.seed(4)
phy <- tree.bisse(pars, max.t=30, x0=0)
unresolved <- data.frame(tip.label=I(c("sp25", "sp30", "sp40", "sp56", "sp20")),
                         Nc =c(10, 9, 6, 5, 2),
                         n0=0, n1=0)
unresolved.bd <- structure(unresolved[["Nc"]], names=unresolved[["tip.label"]])
lik.bisse3 <- make.bisse(phy, phy[["tip.state"]], unresolved)
lik.bisse3(pars)
EOF
Rscript err.R

Confirmed with images 8c7713c7033e and 4a6a9279096b