@mitzimorris, I was thinking about what you’re trying to do for CmdStanPy and thought we could discuss here.
We don’t need make to build the executable. make has the restriction that doesn’t allow spaces in make targets (the executable to build).
We can have our makefiles produce the C++ compiler invocation that will compile an executable. If we had that, we can have any script call the compiler directly to build an executable. Think it’s worth pursuing?
It’s a make option (also available in git) that makes the command pretend to run in the provided directory. My package installs cmdstan in a configured location and copies the model file to a working directory. Then runs make -C $CMDSTAN_DIR $WORK_DIR/$MODEL_NAME
D’oh, I’m right about the shell stuff but not make itself. The package controls where cmdstan is installed although the user could change it to somewhere with spaces, I haven’t tested that. I didn’t even think of spaces in the filename being passed on to make but that could be worked around by copying the model to a standard filename and copying the binary back to the work directory. I’m not sure if the paths used by -C are used directly in the makefile…
I realized that’s the only place where it’s really applicable. Stan doesn’t generate executables and we can control the test model locations so there are no spaces. Math also doesn’t generate executables. So it’s only in CmdStan.
I don’t know if there’s an easy way to pipe that output from make. If there’s a more convenient form, we can fix it.