Skip to content

Commit

Permalink
Fix #19
Browse files Browse the repository at this point in the history
  • Loading branch information
wlandau-lilly committed Feb 6, 2024
1 parent 18cca24 commit c69fb64
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
5 changes: 3 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Description: Similar to 'rstantools' for 'rstan',
migrate from 'rstan' to the more modern 'cmdstanr'.
Packages 'rstantools', 'cmdstanr', 'stannis', and
'stanapi' are similar Stan clients with different objectives.
Version: 0.2.0.9000
Version: 0.2.1
License: MIT + file LICENSE
URL: https://wlandau.github.io/instantiate/,
https://github.com/wlandau/instantiate
Expand All @@ -31,6 +31,7 @@ Authors@R: c(
Depends:
R (>= 4.0.0)
Imports:
callr,
fs,
rlang,
utils
Expand All @@ -44,4 +45,4 @@ Encoding: UTF-8
Language: en-US
Config/testthat/edition: 3
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.1
1 change: 1 addition & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export(stan_package_configure)
export(stan_package_create)
export(stan_package_model)
export(stan_package_model_files)
importFrom(callr,r)
importFrom(fs,dir_copy)
importFrom(rlang,abort)
importFrom(rlang,check_installed)
Expand Down
4 changes: 2 additions & 2 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# instantiate 0.2.0.9000 (development)

# instantiate 0.2.1

* Address CRAN warnings in generated packages about non-portable compilation flags (#19, @xinxinc476).

# instantiate 0.2.0

Expand Down
2 changes: 1 addition & 1 deletion R/stan_package.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#' instantiate: pre-compiled CmdStan models in R packages
#' @docType package
#' @name instantiate-package
#' @family help
#' @description Similar to [`rstantools`](https://mc-stan.org/rstantools/)
Expand All @@ -16,6 +15,7 @@
#' migrate from [`rstan`](https://mc-stan.org/rstan/)
#' to the more modern [`CmdStanR`](https://mc-stan.org/cmdstanr/).
#' @useDynLib instantiate, .registration = TRUE
#' @importFrom callr r
#' @importFrom fs dir_copy
#' @importFrom rlang abort check_installed inform is_installed warn
#' @importFrom utils capture.output globalVariables install.packages
Expand Down
4 changes: 2 additions & 2 deletions R/stan_package_configure.R
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ stan_package_configure <- function(path = getwd(), overwrite = FALSE) {
copy.mode = TRUE
)
if (!file.exists(out_makevars)) {
file.create(out_makevars)
writeLines("", out_makevars)
}
if (!file.exists(out_makevars_win)) {
file.create(out_makevars_win)
writeLines("", out_makevars_win)
}
invisible()
}
9 changes: 7 additions & 2 deletions inst/configuration/install.libs.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ if (!file.exists(bin)) {
}
bin_stan <- file.path(bin, "stan")
fs::dir_copy(path = "stan", new_path = bin_stan)
instantiate::stan_package_compile(
models = instantiate::stan_package_model_files(path = bin_stan)
callr::r(
func = function(bin_stan) {
instantiate::stan_package_compile(
models = instantiate::stan_package_model_files(path = bin_stan)
)
},
args = list(bin_stan = bin_stan)
)
1 change: 0 additions & 1 deletion man/instantiate-package.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit c69fb64

Please sign in to comment.