metrumresearchgroup / Torsten

library of C++ functions that support applications of Stan in Pharmacometrics
BSD 3-Clause "New" or "Revised" License
52 stars 11 forks source link

cmdstanr cannot load Torsten path from the user guide #39

Closed cleonowens closed 1 year ago

cleonowens commented 2 years ago

I have attempted to install Torsten, but I am having trouble. Can you please help?

I have successfully installed cmdstan: cmdstan_path() [1] "C:/Users/Cathrine Leonowens/Documents/.cmdstan/cmdstan-2.29.2"

check_cmdstan_toolchain() The C++ toolchain required for CmdStan is setup properly!

And RStan is correctly installed (tested using the code here: )

When I run the following code from your installation instructions (): cmdstanr::set_cmdstan_path("Torsten/cmdstan") I get the following error: Warning message: Path not set. Can't find directory: Torsten/cmdstan

When I re-check the path for cmdstan, I get the correct path: cmdstan_path() [1] "C:/Users/Cathrine Leonowens/Documents/.cmdstan/cmdstan-2.29.2"

Current Version:

R: 4.1.3 RStudio: 2022.02.1 Build 461, "Prairie Trillium" Release (8aaa5d47, 2022-03-17) for Windows cmdstan:2.29.2 Rstan: 2.21.0 rtools: 4.0.3.0

Am I missing a step?

yizhang-yiz commented 2 years ago

Sorry that the installation instruction is clear enough. I'll update it soon.

Please do the following.

  1. Download Torsten from here.
  2. Unpack the downloaded file to, let's say, workpath/Torsten
  3. In R, do cmdstanr::set_cmdstan_path("workpath/Torsten/cmdstan")
  4. In R, do cmdstanr::rebuild_comstanr()
  5. In R, try to build a test model such as model <- cmdstan_model("workpath/Torsten/example-models/pk2cpt_ode/pk2cpt_ode.stan")

Finishing step 5 would indicate Torsten is successfully set up.

cleonowens commented 2 years ago

Hi, Yi. I see you closed the ticket but I still have this question: Does workpath/Torsten have to be in a sub folder in the one found with cmdstan_path()?

Cathrine Cathrine Leonowens Mobile 303.653.5411 "Think higher, feel deeper" - Elie Wiesel

On Apr 8, 2022, at 1:11 AM, Yi Zhang @.***> wrote:

 Closed #39.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.

yizhang-yiz commented 2 years ago

@cleonowens workpath/Torsten/ can be anywhere as long as you can write to that path. Regardless of the current value of cmdstan_path, you can always use `set_cmdstan_path to let cmdstanr konw where that path workpath/Torsten is.

Let me know if this helps. Thanks.

cleonowens commented 1 year ago

Thank you! Does workpath/Torsten have to be in a sub folder in the one found with cmdstan_path()?

Cathrine Cathrine Leonowens Mobile 303.653.5411 "Think higher, feel deeper" - Elie Wiesel

On Apr 1, 2022, at 12:09 AM, Yi Zhang @.***> wrote:

workpath/Torsten In R, do cmdstanr::set_cmdstan_path

yizhang-yiz commented 1 year ago

Thank you! Does workpath/Torsten have to be in a sub folder in the one found with cmdstan_path()?

No it doesn't.