File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -846,8 +846,12 @@ toolchain_PATH_env_var <- function() {
846846}
847847
848848rtools4x_toolchain_path <- function () {
849- c_runtime <- ifelse(is_ucrt_toolchain(), " ucrt64" , " mingw64" )
850- repair_path(file.path(rtools4x_home_path(), c_runtime , " bin" ))
849+ if (rtools4x_version() == " 40" ) {
850+ toolchain_folder <- " mingw64"
851+ } else {
852+ toolchain_folder <- " x86_64-w64-mingw32.static.posix"
853+ }
854+ repair_path(file.path(rtools4x_home_path(), toolchain_folder , " bin" ))
851855}
852856
853857rtools4x_version <- function () {
Original file line number Diff line number Diff line change @@ -662,6 +662,7 @@ compile <- function(quiet = TRUE,
662662 cpp_options_to_compile_flags(c(cpp_options , list (" KEEP_OBJECT" = " true" ))),
663663 stancflags_val ),
664664 wd = cmdstan_path(),
665+ env = c(" current" , " CXXFLAGS" = " -fPIC" ),
665666 echo = ! quiet || is_verbose_mode(),
666667 echo_cmd = is_verbose_mode(),
667668 spinner = quiet && rlang :: is_interactive() && ! identical(Sys.getenv(" IN_PKGDOWN" ), " true" ),
Original file line number Diff line number Diff line change @@ -86,7 +86,14 @@ is_rosetta2 <- function() {
8686# Returns the type of make command to use to compile depending on the OS
8787make_cmd <- function () {
8888 if (os_is_windows() && ! os_is_wsl()) {
89- " mingw32-make.exe"
89+ if (R.version $ major == " 3" ) {
90+ make_folder <- file.path(Sys.getenv(" RTOOLS35_HOME" ), " mingw_64" , " bin" )
91+ } else if (rtools4x_version() == " 40" ) {
92+ make_folder <- file.path(rtools4x_home_path(), " mingw64" , " bin" )
93+ } else {
94+ make_folder <- file.path(rtools4x_home_path(), " ucrt64" , " bin" )
95+ }
96+ repair_path(file.path(make_folder , " mingw32-make.exe" ))
9097 } else {
9198 " make"
9299 }
You can’t perform that action at this time.
0 commit comments