Closed syclik closed 2 years ago
@dmuck, can you check to see that this works for you? We can always upgrade some of the make stuff later. I didn't pass through the compiler all the way to building the TBB library.
This worked on my Linux machine. Thanks for putting this together!
This PR adds rules to the Makefile that will enable building an executable from a Stan file. This should work on both Linux and Mac.
Rules added to the Makefile:
.cpp
from.stan
fileLINK.o
make variable toLINK.cpp
to enable the correct linker.install
target to also require the TBB librariesThis allows an executable to be created and runable.
I didn't include an example in the code, but as an example, you can copy any
.stan
program into the working directory. Let's call itmodel.stan
for example. We should be able to install it by typing:make install
. This will installbin/stanc
, get the submodules, build the TBB libraries, and buildsrc/main.o
fromsrc/main.cpp
.make model
. This will build themodel
executable by first generating the.cpp
file from.stan
file, compile a.o
from the.cpp
file, then linking it all together into an executable.Note: if we get fancy, we could load the library dynamically at runtime instead of creating a new executable.