Stan Math Library
5.0.0
Automatic Differentiation
|
It seems to be challenging these days to get a working Unix compilation toolchain on Windows, moreso than it was in the past. Here are some notes on what worked for one developer.
The complilation shell environment is MSYS2 MinGW 32-bit. However, any git commands are executed separately in git for Windows' git bash. All commands herein have been run from the top-most math
folder of this repo.
This compiler came from the MinGW-W64 builds project. To get the compiler to invoke with just g++
, one may have to edit the environment variables for the local account to append USERPROFILE%\AppData\Local\mingw32\bin
to the PATH
, set MSYS2_PATH_TYPE=inherit
, and follow with a reboot.
The make and python based build structure referenced in the stan developer overview is replicated in the stan-math repo, so one can use the instructions there to get an idea of what commands the build system supports, like make test-headers
or runTests.py
. Be aware that these commands can take a long time, and that stan-math's automated build system, Travis, is running older compilers like GCC 4.9. Therefore, new compiler bugs may be encountered deep in the middle of the tests.
The shebang at the beginning of runTests.py
may need to be shortened to just say python
, rather than a full path.
The build system supports making and running individual tests.
Autodetection in the build system may fail, so one may need to create a local
file under make
to help. The wiki authors do recognize that technically CC
should be gcc
.
If the test suite isn't built first, client code using numerical integration routines such as integrate_ode_bdf
may fail to link because the libraries haven't been built yet. Obviously these files and directories would need to be added to the downstream project makefile's LDLIBS variable, or equivalent.