See my earlier answer in this thread.
Ah yes, I didn’t take it seriously last time. But I tested it out and it does work.
I create these functions inside a .sh file, which I source inside ~/.bash_profile. After that I can call
stan_make my model
inside my working directory.
as a side note, I wonder if this can be release as a legitimate executable along side stanc.
The problem with these is making them cross-platform and reliable. If somebody is willing to take that on it would be great to release something like this but otherwise it’s just a bag of tricks.
I completely agree with @sakrejda here. Shipping additional scripts that aren’t well-tested with different boundary conditions will just add to the maintenance burden and confusion. If anyone can actually write scripts that will work (and really list the conditions under which it won’t), we can distribute those.
@bhomass, here’s how a Stan program is compiled on my Mac using clang++:
clang++ -I src -I stan/src -isystem stan/lib/stan_math/ -isystem stan/lib/stan_math/lib/eigen_3.3.3 -isystem stan/lib/stan_math/lib/boost_1.62.0 -isystem stan/lib/stan_math/lib/cvodes_2.9.0/include -Wall -DEIGEN_NO_DEBUG -DBOOST_RESULT_OF_USE_TR1 -DBOOST_NO_DECLTYPE -DBOOST_DISABLE_ASSERTS -DFUSION_MAX_VECTOR_SIZE=12 -DNO_FPRINTF_OUTPUT -pipe -Wno-unused-function -ftemplate-depth-256 -O3 -o examples/bernoulli/bernoulli src/cmdstan/main.cpp -include examples/bernoulli/bernoulli.hpp stan/lib/stan_math/lib/cvodes_2.9.0/lib/libsundials_nvecserial.a stan/lib/stan_math/lib/cvodes_2.9.0/lib/libsundials_cvodes.a
The C++ compilers that we work with (clang++, g++) don’t have issues with spaces, so you can adjust that line to have it compile from an arbitrary directory. All you would have to do is change paths for all the includes and the input and output filenames.
Ok, then I would generally recommend that, unless you have a really good reason to do otherwise, if you are asking for help you should: a) respond to requests like when @ahartikainen asked for output for your CmdStan path and model path; b) if you ignore somebody’s suggestion please say something about why; and c) post the command you ran and the output you got as cut-and-paste from the terminal so that what you tried is clear.