@@ -297,7 +297,9 @@ CmdStanModel <- R6::R6Class(
297
297
298
298
# exe_info is updated inside the compile method (if compile command is run)
299
299
self $ exe_info(update = TRUE )
300
- if (file.exists(self $ exe_file())) exe_info_reflects_cpp_options(self $ exe_info(), args $ cpp_options )
300
+ if (file.exists(self $ exe_file())) {
301
+ exe_info_reflects_cpp_options(self $ exe_info(), args $ cpp_options )
302
+ }
301
303
}
302
304
if (length(self $ exe_file()) > 0 && file.exists(self $ exe_file())) {
303
305
private $ cpp_options_ <- model_compile_info_legacy(self $ exe_file(), self $ cmdstan_version())
@@ -368,7 +370,10 @@ CmdStanModel <- R6::R6Class(
368
370
info <- if (cli_info_success ) parse_exe_info_string(ret $ stdout ) else list ()
369
371
cpp_options <- exe_info_style_cpp_options(private $ precompile_cpp_options_ )
370
372
compiled_with_cpp_options <- ! is.null(private $ cmdstan_version_ )
371
-
373
+ if (! cli_info_success ) warning(
374
+ ' Retrieving exe_file info failed. ' ,
375
+ ' This may be due to running a model that was compiled with pre-2.26.1 cmdstan.'
376
+ )
372
377
private $ exe_info_ <- if (compiled_with_cpp_options ) {
373
378
# recompile has occurred since the CmdStanModel was created
374
379
# cpp_options as were used as configured
@@ -402,7 +407,9 @@ CmdStanModel <- R6::R6Class(
402
407
# this is intentionally not private$cmdstan_version_
403
408
# because that value is only set if model has been recomplied
404
409
# since CmdStanModel instantiation
405
- if (! fallback ) self $ exe_info()[[' stan_version' ]]
410
+ if (! fallback ) {
411
+ return (self $ exe_info()[[' stan_version' ]])
412
+ }
406
413
for (candidate in c(
407
414
self $ exe_info()[[' stan_version' ]],
408
415
self $ exe_info_fallback()[[' stan_version' ]]
0 commit comments