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

[BUG] installation issues #27

Closed ghost closed 3 years ago

ghost commented 3 years ago

I am trying to install Torsten on macOS Mojave system version 10.14.6. I am using R version 3.6.3 and rstan_2.21.2.

After downloading the folder from:
https://github.com/metrumresearchgroup/Torsten

I also tried to install Torsten by running R script “install_torsten” found in folder downloaded from https://github.com/metrumresearchgroup/TorstenHeaders but now success and got following massages

library(rstan) library(devtools) devtools::load_all('TorstenHeaders') Error in normalizePath(path, winslash = "/", mustWork = TRUE) : path[1]="TorstenHeaders": No such file or directory install_torsten() Error in find.package("torstenHeaders") : there is no package called ‘torstenHeaders’

I would be grateful if you give me some instruction on how to successfully install Torsten.

Best redards

yizhang-yiz commented 3 years ago

We're in the middle of switching from rstan to cmdstanr as our R interface. You can follow instruction here to use cmdstanr with the latest release candidate. On the other hand, v0.87.2 is the last version with rstan. You can access it by

git clone -b torsten_v0.87.2 git@github.com:metrumresearchgroup/Torsten.git
ghost commented 3 years ago

Thank you for your prompted response. I have installed the cmdstanr and run the example provided with package : https://mc-stan.org/cmdstanr/articles/cmdstanr.html

"file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan") mod <- cmdstan_model(file)"

However, when I tried to run different examples provided in the same package or examples from torsten package I receive the following error:

Error in .subset2(public_bind_env, "initialize")(...) : Assertion on 'stan_file' failed: File does not exist: '/Users/mg/.cmdstanr/cmdstan-2.25.0/examples/radon/radon.stan'.

I really appreciate your help and time.

regards,

yizhang-yiz commented 3 years ago

Looks like cmdstan couldn’t locate radon model. Could you double check the path?

On Dec 4, 2020 at 4:23 PM, <melagha (mailto:notifications@github.com)> wrote:

Thank you for your prompted response. I have installed the cmdstanr and run the example provided with package : https://mc-stan.org/cmdstanr/articles/cmdstanr.html

"file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan") mod <- cmdstan_model(file)"

However, when I tried to run different examples provided in the same package or examples from torsten package I receive the following error:

Error in .subset2(public_bind_env, "initialize")(...) : Assertion on 'stan_file' failed: File does not exist: '/Users/mg/.cmdstanr/cmdstan-2.25.0/examples/radon/radon.stan'.

I really appreciate your help and time.

regards,

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub (https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-739088590), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AH4SDMFWOOMKJZJN4W5KHFLSTF4PLANCNFSM4UM5FALA).

ghost commented 3 years ago

It is

"/Users/mg/.cmdstanr/cmdstan-2.25.0"

On Dec 4, 2020, at 7:27 PM, Yi Zhang notifications@github.com wrote:

Looks like cmdstan couldn’t locate radon model. Could you double check the path?

On Dec 4, 2020 at 4:23 PM, <melagha (mailto:notifications@github.com)> wrote:

Thank you for your prompted response. I have installed the cmdstanr and run the example provided with package : https://mc-stan.org/cmdstanr/articles/cmdstanr.html

"file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan") mod <- cmdstan_model(file)"

However, when I tried to run different examples provided in the same package or examples from torsten package I receive the following error:

Error in .subset2(public_bind_env, "initialize")(...) : Assertion on 'stan_file' failed: File does not exist: '/Users/mg/.cmdstanr/cmdstan-2.25.0/examples/radon/radon.stan'.

I really appreciate your help and time.

regards,

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub (https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-739088590), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AH4SDMFWOOMKJZJN4W5KHFLSTF4PLANCNFSM4UM5FALA).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-739089551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCB3IT4W5CPELAQVDDZPXLSTF47PANCNFSM4UM5FALA.

ghost commented 3 years ago

Sorry, The file for the radon model is setwd("~/Desktop/Torsten-master-2/cmdstan/examples/radon”) Actually the same file where the bernoulli.stan located .

On Dec 4, 2020, at 7:27 PM, Yi Zhang notifications@github.com wrote:

Looks like cmdstan couldn’t locate radon model. Could you double check the path?

On Dec 4, 2020 at 4:23 PM, <melagha (mailto:notifications@github.com)> wrote:

Thank you for your prompted response. I have installed the cmdstanr and run the example provided with package : https://mc-stan.org/cmdstanr/articles/cmdstanr.html

"file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan") mod <- cmdstan_model(file)"

However, when I tried to run different examples provided in the same package or examples from torsten package I receive the following error:

Error in .subset2(public_bind_env, "initialize")(...) : Assertion on 'stan_file' failed: File does not exist: '/Users/mg/.cmdstanr/cmdstan-2.25.0/examples/radon/radon.stan'.

I really appreciate your help and time.

regards,

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub (https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-739088590), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AH4SDMFWOOMKJZJN4W5KHFLSTF4PLANCNFSM4UM5FALA).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-739089551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCB3IT4W5CPELAQVDDZPXLSTF47PANCNFSM4UM5FALA.

yizhang-yiz commented 3 years ago

I don’t think cmdstanr comes with radon model. Please follow cmdstanr tutorial to use “set_cmdstan_path” to pick Torsten’s cmdstan. Note that Torsten ships its own customized cmdstan, which is different from cmdstanr would install.

On Dec 4, 2020 at 4:30 PM, <melagha (mailto:notifications@github.com)> wrote:

It is

"/Users/mg/.cmdstanr/cmdstan-2.25.0"

On Dec 4, 2020, at 7:27 PM (x-apple-data-detectors://1), Yi Zhang <notifications@github.com (mailto:notifications@github.com)> wrote:

Looks like cmdstan couldn’t locate radon model. Could you double check the path?

On Dec 4, 2020 at 4:23 PM, <melagha (mailto:notifications@github.com)> wrote:

Thank you for your prompted response. I have installed the cmdstanr and run the example provided with package : https://mc-stan.org/cmdstanr/articles/cmdstanr.html

"file <- file.path(cmdstan_path(), "examples", "bernoulli", "bernoulli.stan") mod <- cmdstan_model(file)"

However, when I tried to run different examples provided in the same package or examples from torsten package I receive the following error:

Error in .subset2(public_bind_env, "initialize")(...) : Assertion on 'stan_file' failed: File does not exist: '/Users/mg/.cmdstanr/cmdstan-2.25.0/examples/radon/radon.stan'.

I really appreciate your help and time.

regards,

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub (https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-739088590), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AH4SDMFWOOMKJZJN4W5KHFLSTF4PLANCNFSM4UM5FALA).

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-739089551, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCB3IT4W5CPELAQVDDZPXLSTF47PANCNFSM4UM5FALA.

— You are receiving this because you were assigned. Reply to this email directly, view it on GitHub (https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-739090156), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AH4SDMGG5ABPAEYJUJBJ3IDSTF5KLANCNFSM4UM5FALA).

yizhang-yiz commented 3 years ago

@melagha were you able to compile and run radon model? Let me know if you have any questions.

ghost commented 3 years ago

Thank you for the follow up.

Unfortunately I still not been able to run it. Please see below the log of my run and results:

check_cmdstan_toolchain() The CmdStan toolchain is setup properly! cmdstan_path() [1] "/Users/mg/Desktop/Torsten-master/example-models/pk2cpt/../../cmdstan" file <- file.path(cmdstan_path(), "example-models", "pk2cpt", "pk2cpt.stan") mod <- cmdstan_model(file) Error in .subset2(public_bind_env, "initialize")(...) : Assertion on 'stan_file' failed: File does not exist: '/Users/mg/Desktop/Torsten-master/example-models/pk2cpt/../../cmdstan/example-models/pk2cpt/pk2cpt.stan'

Best regards

On Dec 7, 2020, at 5:49 PM, Yi Zhang notifications@github.com wrote:

@melagha https://github.com/melagha were you able to compile and run radon model? Let me know if you have any questions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-740228485, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCB3ISYJZEMHFNASRTGMRTSTVLY3ANCNFSM4UM5FALA.

ghost commented 3 years ago

Please ignore previous post. Following is the log of the run.

library("cmdstanr") set_cmdstan_path("~/Desktop/Torsten-master/cmdstan") CmdStan path set to: /Users/mg/Desktop/Torsten-master/cmdstan file.dir <- file.path("Torsten", "example-models", "pk2cpt") file <- file.path(file.dir, "pk2cpt.stan") model <- cmdstan_model(file) Error in .subset2(public_bind_env, "initialize")(...) : Assertion on 'stan_file' failed: File does not exist: 'Torsten/example-models/pk2cpt/pk2cpt.stan'.

On Dec 7, 2020, at 5:49 PM, Yi Zhang <notifications@github.com mailto:notifications@github.com> wrote:

@melagha https://github.com/melagha were you able to compile and run radon model? Let me know if you have any questions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-740228485, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCB3ISYJZEMHFNASRTGMRTSTVLY3ANCNFSM4UM5FALA.

yizhang-yiz commented 3 years ago

By

file.dir <- file.path("Torsten", "example-models", "pk2cpt")
 file  <- file.path(file.dir, "pk2cpt.stan")

you are asking for "Torsten/example-models/pk2cpt/pk2cpt.stan" at your current working directory. Please see if the following works

file <- file.path(cmdstan_path(), "..", "example-models", "pk2cpt", "pk2cpt.stan")
model <- cmdstan_model(file)
ghost commented 3 years ago

It worked. I really appreciate your time and help.

Best regard

On Dec 8, 2020, at 12:39 PM, Yi Zhang notifications@github.com wrote:

By

file.dir <- file.path("Torsten", "example-models", "pk2cpt") file <- file.path(file.dir, "pk2cpt.stan") you are asking for "Torsten/example-models/pk2cpt/pk2cpt.stan" at your current working directory. Please see if the following works

file <- file.path(cmdstan_path(), "..", "example-models", "pk2cpt", "pk2cpt.stan") model <- cmdstan_model(file) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/metrumresearchgroup/Torsten/issues/27#issuecomment-740789150, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJCB3IVFTT7COOMLYUZ3H4TSTZQE7ANCNFSM4UM5FALA.

yizhang-yiz commented 3 years ago

Great. I'm closing this one.