Problem installing Torsten 0.90

I downloaded Torsten 0.90 earlier today with just a git clone call. I then went into the cmdstan directory and did the usual make build:

cd Torsten/cmdstan
make build

That ran just fine and I got the message that cmdstan and Torsten were built successfully. Unfortunately, when I went to run an example I got the following error:

make examples/bernoulli/bernoulli
bin/stanc: line 1: Not: command not found

When I retry these steps but instead clone the old 0.89.1 tag of Torsten instead of the newest version, I’m able to run the bernoulli example just fine.

@yizhang any idea what could be going on here? I didn’t know whether to post here or on github but figured I’d make a topic in case anyone was running into the same thing.

I’m on travel and doesn’t have access a win machine. I’ll do my best to figure this out.

It could be that stanc3 binary was not downloaded correctly. What you can do is to try to download
https://github.com/metrumresearchgroup/stanc3/releases/download/torsten_v0.90.0rc2/windows-stanc
and copy it to Torsten/cmdstan/bin/stanc.exe, before remake a model. If it doesn’t work, please let me know the output of using that downloaded binary to translate a stan model, say
Torsten/cmdstan/bin/stanc.exe path/to/the/model.stan
which should generate
path/to/the/model.hpp
If it doesn’t, then we have a bug of the stanc3 binary.

Thanks Yi. No rush. I’m doing fine with 0.89.1 for now.

This is actually not on my Windows machine. This is on a Metworx machine that’s running Linux.

Long-due update. This issue may have been resolved here. Basically see you can build models after rebuilding cmdstan, which will downloads the updated stanc3 binary. Let me know if it works.

1 Like

I just recently got a new Macbook Pro with an M3 chip and am trying to install Torsten using the same sequence of commands as @arya did above. I’ve also done the sequence of commands in the link referenced above, and I’ve also done a cmdstanr::rebuild_cmdstan(). Everything gives me at the end

48 warnings and 14 errors generated.
make: *** [src/cmdstan/main.o] Error 1

and then it won’t compile either the bernoulli or the pk2cpt example (I’m happy to show more of the error message if you need).

@yizhang and @billgillespie I’m able to compile the bernoulli example with CmdStan v2.33.1 that I just installed on the M3, and I also did the same sequence of commands as above on an M1 again just to check, and it worked fine, so is this something going on with a Torsten incompatibility with the M3 chip?

Hi Casey, please share the error msg. Thanks.

Hey, Yi, it’s a TON of text, so I’ve attached a .txt file.

torsten_installation_error.txt (161.0 KB)

Let me know if you need any other info. Thanks.

Thanks. I’ve added issue here. If this is M3 incompatibility hopefully it will resolve when I finish upgrading torsten to stan 2.33.1.

@cbdavis33 Casey could you let me know your c++ compiler and OS platform information? I suspect it’s similar to the compiler and c++ lib issue reported here.

@WardBrian Brian are you aware of any M3-related to compiling issues? Thanks.

@yizhang

  • OS platform: Sonoma 14.1
  • C++ compiler: Apple clang version 15.0.0 (clang-1500.1.0.2.5)

Thanks for looking into this.

@yizhang looks like that might be the issue that was fixed by Add overloads for complex multiply to fix clang16 by andrjohns · Pull Request #2892 · stan-dev/math · GitHub ?

1 Like

Hi Casey, can you try the release candidate GitHub - metrumresearchgroup/Torsten: library of C++ functions that support applications of Stan in Pharmacometrics that I just put up? This version is based on Stan 2.33.1 so should have what the fix @WardBrian mentioned.

Hey, Yi, I’ve cloned the repo and built it. Now there are no errors, but 45 warnings
torsten_build_messages.txt (604.0 KB):

45 warnings generated.

--- CmdStan v2.33.1 built ---
--- Torsten v0.91.0 built ---

Then when I try to compile either the bernoulli or the pk2cpt example with this installation, I get an error:

Compiling Stan program...
bin/stanc: line 1: Not: command not found

In the Torsten/cmdstan/bin directory I have:

drwxr-xr-x  5 cbdavis33  staff     160 Jan  2 13:24 cmdstan
-rwxr-xr-x  1 cbdavis33  staff  256168 Jan  2 13:24 diagnose
-rwxr-xr-x  1 cbdavis33  staff  272616 Jan  2 13:24 print
-rwxr-xr-x  1 cbdavis33  staff       9 Jan  2 13:23 stanc
-rwxr-xr-x  1 cbdavis33  staff  582680 Jan  2 13:24 stansummary

stanc is only 9 bytes, so it seems like it wasn’t built properly.

if you rm bin/stanc and then make bin/stanc, what is the output?

curl -L https://github.com/metrumresearchgroup/stanc3/releases/download/torsten_v0.91.0rc1/mac-stanc -o bin/stanc --retry 5 --retry-delay 10
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100     9  100     9    0     0     41      0 --:--:-- --:--:-- --:--:--    41
chmod +x bin/stanc

Then the result is the same:

drwxr-xr-x  5 cbdavis33  staff     160 Jan  2 13:24 cmdstan
-rwxr-xr-x  1 cbdavis33  staff  256168 Jan  2 13:24 diagnose
-rwxr-xr-x  1 cbdavis33  staff  272616 Jan  2 13:24 print
-rwxr-xr-x  1 cbdavis33  staff       9 Jan  2 15:32 stanc
-rwxr-xr-x  1 cbdavis33  staff  582680 Jan  2 13:24 stansummary

I’ve updated the artifact name. Can you try make bin/stanc again?

From the compilation side that worked! Thanks for getting that sorted out. There are some bugs on the Torsten side, so I’m going to move the thread to the Torsten issues on Github .

1 Like