Just another note for anyone that will go the route of your cmdstan including binaries directly and want to make your binaries be actually portable.
On a mac its
dune build @install
On linux run
dune build @install --profile static
otherwise you get a version GLIBC_2.29 not found (require... error.
On windows run
dune build -x windows
This is all taken from how jenkins build the binaries, see https://github.com/stan-dev/stanc3/blob/master/Jenkinsfile#L162 and lines below.
This really should be more notably written down somewhere…