Skip to content

cmdstanr cannot find external drive (Windows) #1108

@AdamCSmithCWS

Description

@AdamCSmithCWS

If I use an external drive to store the csv files cmdstanr::sample(..., output_dir = "d:/output") , cmdstanr cannot find the directory.

It appears to mis-read the directory location: I get an error that 'mnt/d/output' does not exist.

[Edit]
This is issue seems specific to R 4.5.1

Everything runs as expected if I use R 4.4.1 (the earlier version of R that I have installed).

To Reproduce


library(cmdstanr) ## version 0.9.0, running with wsl


file <- file.path(cmdstan_path(), "examples/bernoulli/bernoulli.stan")
mod <- cmdstan_model(file)
stan_data <- list(N = 10, y = c(0,1,0,0,0,0,0,0,0,1))

test_dir <- "d:/output"

dir.exists(test_dir)
[1] TRUE

fit_mcmc <- mod$sample(
  data = stan_data,
  seed = 123,
  chains = 2,
  parallel_chains = 2,
  output_dir = test_dir
)

Error in validate_cmdstan_args(self) : 
  Assertion on 'self$output_dir' failed: Directory '/mnt/d/output' does not exist.

Operating system
Windows 10 x64, build version 26100
CmdStan 2.36.0 with wsl

R 4.5.1

CmdStanR version number
Your CmdStanR version number (e.g. from packageVersion("cmdstanr")).
This is cmdstanr version 0.9.0

  • CmdStan path: //wsl$/ECCC-WSL-UBUNTU-24/home/acsmith/.cmdstan/cmdstan-2.36.0
  • CmdStan version: 2.36.0

Additional context
perhaps related to #1026 and #1038

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions