mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-11-18 08:53:42 +00:00
Store compiled model in platform specific location
This commit is contained in:
parent
192b9160a7
commit
6bbac0c47b
2 changed files with 11 additions and 2 deletions
|
|
@ -248,7 +248,11 @@ compile_stan_model <- function() {
|
||||||
'You should not see this message more than once after install.'
|
'You should not see this message more than once after install.'
|
||||||
)
|
)
|
||||||
|
|
||||||
dest <- file.path(path.package("prophet"), 'libs')
|
if (.Platform$OS.type == "windows") {
|
||||||
|
dest <- file.path(path.package("prophet"), 'libs', .Platform$r_arch)
|
||||||
|
} else {
|
||||||
|
dest <- file.path(path.package("prophet"), 'libs')
|
||||||
|
}
|
||||||
dir.create(dest, recursive = TRUE, showWarnings = FALSE)
|
dir.create(dest, recursive = TRUE, showWarnings = FALSE)
|
||||||
|
|
||||||
packageStartupMessage(paste('Writing model to:', dest))
|
packageStartupMessage(paste('Writing model to:', dest))
|
||||||
|
|
|
||||||
|
|
@ -7,8 +7,13 @@
|
||||||
# Create environment for storing stan model
|
# Create environment for storing stan model
|
||||||
assign("prophet_model_env", new.env(), parent.env(environment()))
|
assign("prophet_model_env", new.env(), parent.env(environment()))
|
||||||
tryCatch({
|
tryCatch({
|
||||||
|
if (.Platform$OS.type == "windows") {
|
||||||
|
dest <- file.path('libs', .Platform$r_arch)
|
||||||
|
} else {
|
||||||
|
dest <- 'libs'
|
||||||
|
}
|
||||||
binary <- system.file(
|
binary <- system.file(
|
||||||
'libs',
|
dest,
|
||||||
'prophet_stan_model.RData',
|
'prophet_stan_model.RData',
|
||||||
package = 'prophet',
|
package = 'prophet',
|
||||||
mustWork = TRUE
|
mustWork = TRUE
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue