As a following up, I upgraded my Mac laptop to 10.8 and the problem continued. The problem seems to be combination LLVM GCC 4.2 in either MacOS 10.7 or 10.8 because LLVM GCC 4.2 in MacOS 10.6 works OK. And the problem is Apple not moving past 4.2 (and I hear they never will)
I solved it by:
1. Installing GCC 4.8 using MacPorts described well herehttp://www.ficksworkshop.com/blog/14-co ... gcc-on-mac
2. To continue using XCode (because I need Mac apps in the same project), you can induce it to allow GCC 4.8 with these excellent instructions:http://hamelot.co.uk/programming/add-cu ... -to-xcode/
and replacing 4.7 in the post with 4.8. I don't know what this change was made to take so much work.
Not only does the code now compile and run without OpenMP problems, it speeds up more that the number of processors on my laptop, which is likely due to GCC 4.8 improvements over GCC 4.2