Skip to content

Commit

Permalink
Retrieve the package name from the DESCRIPTION file.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcol committed Nov 19, 2024
1 parent 99c0d66 commit d8fc170
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/rstan_config.R
Original file line number Diff line number Diff line change
Expand Up @@ -214,11 +214,12 @@ rstan_config <- function(pkgdir = ".") {
eigen_incl <- ifelse(utils::packageVersion('StanHeaders') >= "2.31",
"#include <stan/math/prim/fun/Eigen.hpp>",
"#include <stan/math/prim/mat/fun/Eigen.hpp>")
pkgname <- gsub("Package: ", "", readLines("DESCRIPTION", n = 1))
cat("#include <exporter.h>",
eigen_incl,
"#include <stan/math/prim/meta.hpp>",
file = file.path(pkgdir, "src",
paste(basename(pkgdir), "types.h", sep = "_")),
paste(pkgname, "types.h", sep = "_")),
sep = "\n")

} else { # actual Stan model
Expand Down

0 comments on commit d8fc170

Please sign in to comment.