@bhomass, it's easy enough to build a script to build CmdStan executables from the command line. Here are the steps necessary:
- Build the Stan compiler (
- Optional: build the CVODES library.
- Use the Stan compiler to compile a Stan program to a C++ header file.
- Compile an executable using the generated C++ header file and the
src/cmdstan/main.cpp, optionally linking with the CVODES library.
The makefile in CmdStan currently handles all of that for you. It makes it seamless if you wanted to jump straight to 4 without going through all of the steps individually.
GNU make does not handle spaces in target names. (There's no way to escape the space either!) Space separates targets in make, so there's just no way around it.
If you're never going to have spaces anywhere in your paths, you should be able to do this:
make -f <path to CmdStan>/make <Stan program dropping the .stan extension>
This may not work if we haven't used the right root path everywhere.
What @sakrejda looks promising, but once again, is restricted to paths without spaces.
If you do what @aaronjg suggests and look at the output of the
-n option, you should be able to directly write the calls to the compiler with the right options. That will work with spaces as long as it's escaped properly. That's the part that you can actually script if you're inclined to do so.
In CmdStan, we could have scripts instead of make, but it's actually a technical challenge and burden to maintain a custom build system. If anyone has ways to do it better and robustly across enough of our users, please let us know. I don't think any of the devs claim to be build system experts.