To cut a long story short: The Stan-math library tests only pass successfully with the Intel 14 compiler, when the options
-fp-model precise -fp-model source
are turned on. Intel is so liberal to ignore a couple of floating point standards in favor for more optimization by default. The above options make sure these optimization are not used and FP math is more conservative. Specifically, the test/unit/math/fwd/core/operator_minus_equal_test.cpp fails otherwise!
The Intel 15 compiler, however, does not work with the stan-math library tests. The issue is in Eigen which has not integrated all those needed changes due to Intel 15 into their library (albeit they have fixed the stuff since over a year):
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=874
Apparently they have never merged this into Eigen (it's also not in 3.2.5).
Cheers,
Sebastian
-DEIGEN_USE_MKL_ALL -DMKL_BLAS=1 -DNDEBUG -fp-model precise -fp-model source
The important bit is MKL_BLAS=1 which is the value of this macro as it used to be in earlier versions of the Intel MKL (it is a deprecated macro and got removed in Intel15).
No guarantees(!!!!), but the tests do work.
Sebastian
I created a bug report at Eigen and ask them to merge the forgotten patch:
http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1041
Let's hope they merge this quickly with stable to make Eigen out-of-the box compatible with MKL 11/Intel 15.
Sebastian