Stan's ./ src/test/unit failing with g++/works with clang++

Ubuntu 16.04, g++ 5.4.0 (the default one)

If I run ./ src/test/unit with g++ in the stan repo (develop branch), it fails on:
make test/unit/mcmc/hmc/integrators/impl_leapfrog2

I was trying to add a few lines to Stan and got these errors on the tests, so I pulled down a clean copy of the repo and got the same thing.

Logs here:

I switched to clang++ (3.8.0) and everything magically works. Any ideas?


@bbbales2, we might have run into either a compiler bug with g++ 5.4.0 or a non-standard way we wrote some of the code. I think this is related to @seantalts post here: Probability test broken locally in unspecified way

Hopefully we can figure this out.

I don’t think it’s related to my bug; I’m not using G++ and I’m running a different type of test.

@bbbales2 are using Linux? If I recall correctly, Linux g++ math unit tests are failing in kind of a similar way for the past 6 months or so…

Yup. Ignore my last comment.

Oh yeah, Ubuntu 16.04. For the Math stuff I’d already changed over to clang just for the cleaner error messages, so maybe I missed them there.