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

Torsten integration with Stan #26

Closed sundav05 closed 3 years ago

sundav05 commented 3 years ago

Hi, the current(latest) release of Torsten requires a bundled installation of stan-2.19 and doesnt play well with an system installation of stan. I would like to understand if your plans for a more loosely coupled integration with a standard installation of stan has materialized and when the next release of Torsten compatible with the current release of rstan (2.21 at the moment) is being planned. Thanks,

-Vijay

yizhang-yiz commented 3 years ago

We're aware of the installation problem and plan to move from rstan to cmdstanr in next release. For now you can access the release candidate and using it through cmdstanr by following

yizhang-yiz commented 3 years ago

I'm closing this for the moment. @sundav05 feel free to reopen the issue when you have any questions.

sundav05 commented 3 years ago

Thanks, Yi. We will test the approach suggested and get back to you if we run into any issues.

-Vijay

From: Yi Zhang notifications@github.com Sent: Wednesday, December 2, 2020 1:55 AM To: metrumresearchgroup/Torsten Torsten@noreply.github.com Cc: Vijayakumar, Sundararajan Sundararajan.Vijayakumar@pfizer.com; Mention mention@noreply.github.com Subject: [EXTERNAL] Re: [metrumresearchgroup/Torsten] Torsten integration with Stan (#26)

I'm closing this for the moment. @sundav05https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_sundav05&d=DwMCaQ&c=UE1eNsedaKncO0Yl_u8bfw&r=ueuEqNzstMJESrhThj151JFBA3B9xmEODqKonL6Ot9Ekuh7msUUYIw4wzjeszBo-&m=XU3VesCMLQD7xoUtWdJVHreHBpVt7bM3JEy61D9d0eA&s=MvVjl5joiufjMRSQRa_an2eF4G6ph6-J-U4BIIZVFYY&e= feel free to reopen the issue when you have any questions.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_metrumresearchgroup_Torsten_issues_26-23issuecomment-2D737033924&d=DwMCaQ&c=UE1eNsedaKncO0Yl_u8bfw&r=ueuEqNzstMJESrhThj151JFBA3B9xmEODqKonL6Ot9Ekuh7msUUYIw4wzjeszBo-&m=XU3VesCMLQD7xoUtWdJVHreHBpVt7bM3JEy61D9d0eA&s=glD1vRPArH4VZ77apUpnUx-6NKdXi5RjuJT26r8nL1M&e=, or unsubscribehttps://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_notifications_unsubscribe-2Dauth_AKMOWOL6FFJ555R5R5SYQETSSXQELANCNFSM4UHYF6AQ&d=DwMCaQ&c=UE1eNsedaKncO0Yl_u8bfw&r=ueuEqNzstMJESrhThj151JFBA3B9xmEODqKonL6Ot9Ekuh7msUUYIw4wzjeszBo-&m=XU3VesCMLQD7xoUtWdJVHreHBpVt7bM3JEy61D9d0eA&s=1en_BW0j-3jX3ulwTewUpmv0WUhzHiCpGBhBoxv5ueI&e=.

sundav05 commented 3 years ago

Hi Yi,

We followed your above steps and was able to successfully install and execute cmdstanr. However, we couldn't successfully compile any stan model files from Torsten examples folder. Please see R session details below. Would appreciate any pointers you can provide to get us started.

Thanks,

-Vijay

R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

[Previously saved workspace restored]

library("cmdstanr") This is cmdstanr version 0.2.0

  • Online documentation and vignettes at mc-stan.org/cmdstanr
  • CmdStan path set to: /root/.cmdstanr/cmdstan-2.25.0
  • Use set_cmdstan_path() to change the path cmdstan_path() [1] "/root/.cmdstanr/cmdstan-2.25.0" file <- file.path("/Torsten/example-models/pk2cpt/pk2cpt") /Torsten/example-models/pk2cpt/pk2cpt.data.R /Torsten/example-models/pk2cpt/pk2cpt.stan /Torsten/example-models/pk2cpt/pk2cpt.init.R /Torsten/example-models/pk2cpt/pk2cpt_sim.R file <- file.path("/Torsten/example-models/pk2cpt/pk2cpt") /Torsten/example-models/pk2cpt/pk2cpt.data.R /Torsten/example-models/pk2cpt/pk2cpt.stan /Torsten/example-models/pk2cpt/pk2cpt.init.R /Torsten/example-models/pk2cpt/pk2cpt_sim.R file <- file.path("/Torsten/example-models/pk2cpt/pk2cpt.stan") mod <- cmdstan_model(file) Compiling Stan program... / Semantic error in '/tmp/RtmpVlXMPy/model-54b0207fd422.stan', line 68, column 6 to line 69, column 43:

    66: // arrays abd returns a matrix with the predicted amount in each 67: // compartment at each event. 68: x = pmx_solve_twocpt(time, amt, rate, ii, evid, cmt, addl, ss, ^ 69: theta, biovar, tlag); 70:

A returning function was expected but an undeclared identifier 'pmx_solve_twocpt' was supplied.

make: *** [/tmp/RtmpVlXMPy/model-54b0207fd422.hpp] Error 1 Error: An error occured during compilation! See the message above for more information.

fit <- mod$sample(...) Error: object 'mod' not found

yizhang-yiz commented 3 years ago

@sundav05 you're using default installed cmdstan:

cmdstan_path() [1] "/root/.cmdstanr/cmdstan-2.25.0"

instead, use

set_cmdstan_path("Torsten/cmdstan")

to set cmdstan path to Torsten's version of cmdstan. You can check that by using cmdstan_path command.

Let me know if that works.

sundav05 commented 3 years ago

Will do. Thanks!

sundav05 commented 3 years ago

Here you go! I think we tried this before but got different (more) errors. Since cmdstan worked, thought that might be a better option. Anyway, I really don't know how the two are working together. Guessing that you are providing a customized cmdstan wrapper that uses libraries from a system installation of cmdstan?

Thanks,

-Vijay

R version 4.0.3 (2020-10-10) -- "Bunny-Wunnies Freak Out" Copyright (C) 2020 The R Foundation for Statistical Computing Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors. Type 'contributors()' for more information and 'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R.

[Previously saved workspace restored]

library("cmdstanr") This is cmdstanr version 0.2.0

  • Online documentation and vignettes at mc-stan.org/cmdstanr
  • CmdStan path set to: /root/.cmdstanr/cmdstan-2.25.0
  • Use set_cmdstan_path() to change the path set_cmdstan_path("cmdstan") CmdStan path set to: /Torsten/cmdstan file <- file.path("/Torsten/example-models/pk2cpt/pk2cpt.stan") mod <- cmdstan_model(file) Compiling Stan program... In file included from stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:12:0, from stan/lib/stan_math/stan/math/torsten/torsten.hpp:4, from stan/lib/stan_math/stan/math.hpp:21, from stan/src/stan/variational/advi.hpp:4, from stan/src/stan/services/experimental/advi/fullrank.hpp:11, from src/cmdstan/command.hpp:26, from src/cmdstan/main.cpp:1: stan/lib/stan_math/stan/math/torsten/pmx_solve_ode.hpp:22:16: error: template declaration of 'constexpr const bool torsten::last_is_ostream_ptr' bool constexpr last_is_ostream_ptr = ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_ode.hpp:26:35: error: expected initializer before '<' token bool constexpr last_is_ostream_ptr<> = false; ^ In file included from stan/lib/stan_math/stan/math/torsten/torsten.hpp:4:0, from stan/lib/stan_math/stan/math.hpp:21, from stan/src/stan/variational/advi.hpp:4, from stan/src/stan/services/experimental/advi/fullrank.hpp:11, from src/cmdstan/command.hpp:26, from src/cmdstan/main.cpp:1: stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:36:39: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:36:61: error: expected parameter pack before '...' typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:36:64: error: template argument 1 is invalid typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:36:66: error: expected identifier before '>' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:36:69: error: expected unqualified-id before '=' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:36:69: error: expected constructor, destructor, or type conversion before '=' token stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:61:40: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:61:62: error: expected parameter pack before '...' typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:61:65: error: template argument 1 is invalid typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:61:67: error: expected identifier before '>' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:61:70: error: expected unqualified-id before '=' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:61:70: error: expected constructor, destructor, or type conversion before '=' token stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:112:39: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:112:61: error: expected parameter pack before '...' typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:112:64: error: template argument 1 is invalid typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:112:66: error: expected identifier before '>' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:112:69: error: expected unqualified-id before '=' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:112:69: error: expected constructor, destructor, or type conversion before '=' token stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:119:40: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:119:62: error: expected parameter pack before '...' typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:119:65: error: template argument 1 is invalid typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:119:67: error: expected identifier before '>' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:119:70: error: expected unqualified-id before '=' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_bdf.hpp:119:70: error: expected constructor, destructor, or type conversion before '=' token In file included from stan/lib/stan_math/stan/math/torsten/torsten.hpp:5:0, from stan/lib/stan_math/stan/math.hpp:21, from stan/src/stan/variational/advi.hpp:4, from stan/src/stan/services/experimental/advi/fullrank.hpp:11, from src/cmdstan/command.hpp:26, from src/cmdstan/main.cpp:1: stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:36:39: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:36:61: error: expected parameter pack before '...' typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:36:64: error: template argument 1 is invalid typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:36:66: error: expected identifier before '>' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:36:69: error: expected unqualified-id before '=' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:36:69: error: expected constructor, destructor, or type conversion before '=' token stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:43:40: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:43:62: error: expected parameter pack before '...' typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:43:65: error: template argument 1 is invalid typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:43:67: error: expected identifier before '>' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:43:70: error: expected unqualified-id before '=' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:43:70: error: expected constructor, destructor, or type conversion before '=' token stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:94:39: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:94:61: error: expected parameter pack before '...' typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:94:64: error: template argument 1 is invalid typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:94:66: error: expected identifier before '>' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:94:69: error: expected unqualified-id before '=' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:94:69: error: expected constructor, destructor, or type conversion before '=' token stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:101:40: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:101:62: error: expected parameter pack before '...' typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:101:65: error: template argument 1 is invalid typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:101:67: error: expected identifier before '>' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:101:70: error: expected unqualified-id before '=' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_rk45.hpp:101:70: error: expected constructor, destructor, or type conversion before '=' token In file included from stan/lib/stan_math/stan/math/torsten/torsten.hpp:6:0, from stan/lib/stan_math/stan/math.hpp:21, from stan/src/stan/variational/advi.hpp:4, from stan/src/stan/services/experimental/advi/fullrank.hpp:11, from src/cmdstan/command.hpp:26, from src/cmdstan/main.cpp:1: stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:36:39: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:36:61: error: expected parameter pack before '...' typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:36:64: error: template argument 1 is invalid typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:36:66: error: expected identifier before '>' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:36:69: error: expected unqualified-id before '=' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:36:69: error: expected constructor, destructor, or type conversion before '=' token stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:61:40: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:61:62: error: expected parameter pack before '...' typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:61:65: error: template argument 1 is invalid typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:61:67: error: expected identifier before '>' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:61:70: error: expected unqualified-id before '=' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:61:70: error: expected constructor, destructor, or type conversion before '=' token stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:112:39: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:112:61: error: expected parameter pack before '...' typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:112:64: error: template argument 1 is invalid typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:112:66: error: expected identifier before '>' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:112:69: error: expected unqualified-id before '=' token typename std::enable_if_t<last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:112:69: error: expected constructor, destructor, or type conversion before '=' token stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:119:40: error: 'last_is_ostream_ptr' was not declared in this scope typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:119:62: error: expected parameter pack before '...' typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:119:65: error: template argument 1 is invalid typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:119:67: error: expected identifier before '>' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:119:70: error: expected unqualified-id before '=' token typename std::enable_if_t<!last_is_ostream_ptr > = nullptr> ^ stan/lib/stan_math/stan/math/torsten/pmx_solve_adams.hpp:119:70: error: expected constructor, destructor, or type conversion before '=' token cc1plus: warning: unrecognized command line option "-Wno-ignored-attributes" make: *** [src/cmdstan/main.o] Error 1 Error: An error occured during compilation! See the message above for more information. fit <- mod$sample(...) Error: '...' used in an incorrect context
yizhang-yiz commented 3 years ago

@sundav05 According to error msg you've likely downloaded an old version of Torsten. To use cmdstanr as Torsten's R interface, you need the latest version. You can either re-download

git clone -b develop git@github.com:metrumresearchgroup/Torsten.git; cd Torsten

or update

cd Torsten
git checkout develop
git pull

It may also help if you can share the platform & compiler information.

Guessing that you are providing a customized cmdstan wrapper that uses libraries from a system installation of cmdstan?

cmdstanr is Stan's to-be-released R interface, and yes it's a light-weight wrapper of cmdstan. Torsten provides customized version of the following libraries in the Stan family:

User will be able to find these components in Torsten folder after download. cmdstanr is installed from official Stan repo. So if a Torsten can be built by cmdstan, so should it be by cmdstanr.