On 11/2/12 5:25 PM, Jiqiang Guo wrote:
> It is not a big deal,
I get the same problem on my machine (g++ segfaulting)
with the same config (Xcode 4.5.2 + OS X Mountain Lion).
Here's a fuller report:
options | result
--------------------------
-O0 | OK
-O0 -DNEBUG | OK
--------------------------
-O2 | OK
-O2 -DNEBUG | fail
--------------------------
-O3 | OK
-O3 -DNEBUG | OK
Oddly, it's only -O2 -DNDEBUG failing.
So I guess we can work around this, but it's annoying.
Is -O2 -DNEBUG the default for R before fiddling?
If so, it's probably going to frustrate a lot of users.
> but it might be good to know that g++ 4.2.1 in Xcode 4.5.2 on Mountain Lion will fail to compile
> the following file under flag -O2 and -DNDEBUG. I came across this when I failed to build rstan because I forgot to
> call set_cppo() again after I used set_cppo('presentation2'), in which -O2 and -DNDEBUG are used.
The failure is in agrad/matrix.hpp, which is the most
problematic of all of our files because it involves
auto-dif templating on top of Eigen's templating.
- Bob