<div dir="ltr">Hi Göran,<br><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Sep 26, 2013 at 12:21 AM, Göran Krampe <span dir="ltr">&lt;<a href="mailto:goran@krampe.se" target="_blank">goran@krampe.se</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hey!<br>
<br>
(nice to meet at ESUG btw)<br>
<br>
On 08/15/2013 08:06 PM, Guillermo Polito wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
So, after digging a bit I&#39;ve got some results and conclusions:<br>
<br>
- The CMake configurations were using gcc to compile, which in mac is<br>
llvm-gcc<br>
- Xcode uses clang compiler, not gcc (and some different compiling flags<br>
also)<br>
- I&#39;ve played changing the configuration to use clang compiler<br>
</blockquote>
<br>
Mmmmm... this is all slightly confusing, so many combos of compilers here (I am a Mac n00b), this is what I have (or more?):<br>
<br>
gcc --version<br>
Configured with: --prefix=/Applications/Xcode.<u></u>app/Contents/Developer/usr --with-gxx-include-dir=/usr/<u></u>include/c++/4.2.1<br>
Apple LLVM version 5.0 (clang-500.2.76) (based on LLVM 3.3svn)<br>
Target: x86_64-apple-darwin12.5.0<br>
Thread model: posix<br>
<br>
gcc-4.2 --version<br>
i686-apple-darwin11-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3)<br>
<br>
llvm-gcc --version<br>
i686-apple-darwin11-llvm-gcc-<u></u>4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)<br>
<br>
llvm-gcc-4.2 --version<br>
i686-apple-darwin11-llvm-gcc-<u></u>4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)<br>
<br>
clang --version<br>
Apple LLVM version 5.0 (clang-500.2.75) (based on LLVM 3.3svn)<br>
Target: x86_64-apple-darwin12.5.0<br>
Thread model: posix<br>
<br>
(I removed some copyright notices from the above)<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
setGlobalOptions: maker<br>
<br>
    super setGlobalOptions: maker.<br>
    maker set: &#39;CMAKE_C_COMPILER&#39; to: &#39;clang&#39;.<br>
    maker set: &#39;CMAKE_CXX_COMPILER&#39; to: &#39;clang&#39;.<br>
</blockquote>
<br>
AFAICT &quot;clang&quot; is the same as &quot;gcc&quot;, no? See my printouts above. The only difference seem to be the added prefix/include-dir config.<br></blockquote><div><br></div><div>No; very different.  I&#39;m not an expert but I think essentially clang is Apple&#39;s C compiler that uses the LLVM backend, and gcc is good old gcc.  Right now Cog doesn&#39;t run if compiled with clang.  Only gcc will do.  No time to debug this right now, and annoyingly clang compiles all static functions with a non-standard calling convention which means one can;t call these functions in gdb, hence lots of debugging functions aren&#39;t available without either a) turning off the optimization or b) changing the VM source so they&#39;re not static.  I prefer a). If anyone knows of a flag to do this *please* let me know asap.</div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
And to make it work as in gcc I added the following also (in some<br>
plugins such as mp3plugin there are functions with return type and<br>
return statements with no values specified).<br>
<br>
compilerFlagsRelease<br>
<br>
    ^super compilerFlagsRelease, #( &#39;-Wno-return-type&#39; )<br>
</blockquote>
<br>
Aaaah!! Perfect. I just went through this yesterday and also failed at the mpeg3plugin.<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
And it compiled with the following results in the tinyBenchmarks:<br>
<br>
&#39;510723192 bytecodes/sec; -142407 sends/sec&#39;<br>
</blockquote>
&gt;<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Which is, in the bytecode part, pretty much close to what we expect, and<br>
in the sends, looks buggy :).<br>
But the overall performance using the image is far better<br>
</blockquote>
<br>
Ok, I will try to get the build to use gcc-4.2 (the non LLVM gcc) and compare it to the clang (=gcc) VM.<br>
<br>
regards, Göran<br>
<br>
PS. I am on Mountain Lion and have Xcode 5 installed + CLI tools + brew apple-gcc4.2.<br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br>best,<div>Eliot</div>
</div></div>