Hi friends,
Background: I'm on r3061 of the SVN depot, and I'm on Mac OSX 10.8.3. I have a few different versions of GCC installed, but the default one that gets invoked when I type "gcc" or "g++" on the command line is the latest version of GCC that ships with the XCode Command Line Tools.
dn5221dj:starter mike$ g++ --version
i686-apple-darwin11-llvm-g++-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)
Quick side note: iCompile's strategy of using the latest version of GCC available on the system causes build errors for me when building G3D. I have GCC 4.8 installed on my system, but for all intents and purposes, it is disabled. GCC 4.2.1 is the version that gets invoked when I type gcc. See the build error above. Of course, I can sidestep this issue by specifying "g++" (with no path or anything) as the default compiler in my ~/.icompile file, but is the default behavior intended? Intuitively, I would expect the default compiler used by iCompile to be the compiler that gets invoked by typing "g++" on the command-line.
dn5221dj:G3D9 mike$ ./buildg3d update
Adding iCompile options: ['--verbosity', '1']
../bin/icompile --verbosity 1 --noprompt
_______________________________________________________________________
Building libfreeimaged.a
Computing dependencies
g++-mp-4.8: error: unrecognized command line option '-fasm-blocks'
1s
Main Bug: Ok, now onto the main bug. When I was on r3055, I encountered the following bug when I tried to compile the "starter" sample project.
/Users/mike/Work/Subversion/g3d-code/G3D9/build/include/G3D/GMutex.h:51:25:
error: 'usleep' was not declared in this scope
A straightforward fix is simply to #include <unistd.h> in GMutex.h when compiling on OSX. Interestingly, I couldn't reproduce this bug on r3061, even though GMutex.h still isn't including <unistd.h>. This suggests that <unistd.h> wasn't getting included at all in r3055, but is somehow getting indirectly included in r3061. As a matter of taste, I believe that GMutex.h should #include <unistd.h>, rather than relying on an indirect inclusion from some other header. After all, GMutex.h makes use of the usleep function which is declared in <unistd.h>.
There might be good reasons for not doing this though. I figured I'd mention my findings in case this was an oversight :)
Cheers,
Mike