Yggdrasil icon indicating copy to clipboard operation
Yggdrasil copied to clipboard

Add binaries for CmdStan and Stan

Open ChrisRackauckas opened this issue 5 years ago • 11 comments

This would be nice to have since many PPLs want to test and benchmark against Stan.

Xref: https://github.com/StanJulia/CmdStan.jl/issues/92 @goedman @yebai @sethaxen

ChrisRackauckas avatar May 13 '20 06:05 ChrisRackauckas

Yes, this would be quite nice. Mostly for installing CmdStan.jl, as in the issue you linked. It would be nice for testing too, but caching a cmdstan build for CI isn't that hard.

sethaxen avatar May 13 '20 06:05 sethaxen

I'm looking into this, so far it seems that these tools don't like being cross-compiled.

christopher-dG avatar May 13 '20 16:05 christopher-dG

it seems that these tools don't like being cross-compiled

Nor Python does, we had to lie to convince it to cross-compiler :joy:

What kind of problems are you seeing?

giordano avatar May 13 '20 16:05 giordano

I'll know more after I finish looking through the 80,000 line stderr... but most of the errors seem to be "this thing isn't defined in std" or other errors in their vendored boost. Also on Windows it seems to expect you to build with Rtools, but I haven't really tried much there yet.

christopher-dG avatar May 13 '20 16:05 christopher-dG

or other errors in their vendored boost

:sob:

Ok, what you said doesn't sound particularly encouraging :disappointed:

giordano avatar May 13 '20 16:05 giordano

It's been at least 10 years since I touched C++, but a couple of reasons why I have always hesitated to go there:

  1. Supporting cmdstan on many different platforms has taken several years of effort and is still far from simple (e.g. the recent experiences with MacOS Catalina, on-going Windows Rtools chain issues and even occasionally versions of Linux).

  2. Since cmdstan 2.21.0, compilation of a Stan Language program occurs in 2 steps. For C++ both the precompiled parts (on the first run) and the back-end parts require the same toolchain (at least on MacOS).

  3. User defined functions still need to be compiled.

  4. In the upcoming Stanc3, the Stan Language to C++ part of this process will be switched from C++ to OCaml. But I still expect all libraries need to be compiled with a matching compiler.

Are there other examples in the artifacts of a C++/Boost based binary that needs further linking? R clearly did it (and uses a more difficult setup than cmdstan as it uses Rcpp) but with very strict tool chain restrictions.

goedman avatar May 13 '20 21:05 goedman

Are there other examples in the artifacts of a C++/Boost based binary that needs further linking?

With a quick search I fond the following builders using Boost: CGAL, HELICS, and mlpack

giordano avatar May 13 '20 22:05 giordano

If anyone is interested in following along, @Wimmerer started the effort to build Stan in #2830.

giordano avatar Apr 13 '21 19:04 giordano

It's been a while but recently someone (on Windows) asked questions about the conda route to install cmdstan and we've tested it and it works.

Not sure where this issue ended. The conda route is of course not a binary, but hopefully can help in some cases.

goedman avatar Dec 03 '21 22:12 goedman

Cross compilation just wasn't a goal for the Stan devs. It might've been possible to get it building with an absolute ton of patches, but it wasn't feasible without upstream support.

rayegun avatar Dec 04 '21 00:12 rayegun