Skip to content

Commit e5506cb

Browse files
authored
Merge pull request #130 from stan-dev/issue_129
Retrieve the package name from the DESCRIPTION file
2 parents 99c0d66 + 08a6dc3 commit e5506cb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

R/rstan_config.R

+2-1
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,12 @@ rstan_config <- function(pkgdir = ".") {
214214
eigen_incl <- ifelse(utils::packageVersion('StanHeaders') >= "2.31",
215215
"#include <stan/math/prim/fun/Eigen.hpp>",
216216
"#include <stan/math/prim/mat/fun/Eigen.hpp>")
217+
pkgname <- unname(read.dcf("DESCRIPTION", "Package")[1, 1])
217218
cat("#include <exporter.h>",
218219
eigen_incl,
219220
"#include <stan/math/prim/meta.hpp>",
220221
file = file.path(pkgdir, "src",
221-
paste(basename(pkgdir), "types.h", sep = "_")),
222+
paste(pkgname, "types.h", sep = "_")),
222223
sep = "\n")
223224

224225
} else { # actual Stan model

0 commit comments

Comments
 (0)