[R-SIG-Mac] Compiling assembly instruction on GNU gcc/g++ 4.2.1 (Apple Inc. build 5531)

Simon Urbanek simon.urbanek at r-project.org
Wed May 7 16:28:22 CEST 2008


Boyd,

thanks for the hint that Apple released the 5553 sources.
FWIW if you apply the patch from
http://r.research.att.com/gfortran-5531.diff
and add gfortran sources from gcc-4.2.1 (or any later 4.2.x if you  
wish)* you will get gfortran for free with full Apple driver support  
(the patch is against 5531 but it works with 5553 as well).

Cheers,
Simon


* - you can extract gcc/fortran and libgfortran from the FSF gcc  
sources and copy/move it to the Apple's sources - something like:
cd gcc_42-5553
tar fvxj ~/gcc-4.2.3.tar.bz2 gcc-4.2.3/gcc/fortran gcc-4.2.3/libgfortran
mv gcc-4.2.3/gcc/fortran gcc/
mv gcc-4.2.3/libgfortran .
rm -rf gcc-4.2.3


On May 7, 2008, at 1:20 AM, Boyd Waters wrote:

>> Leopard$ g++-4.2 -arch x86_64 -g -O2 -march=nocona -fasm-blocks
>> hello.cpp
>> In file included from hello.cpp:2:
>> hello.hpp: In function 'int atomic_exchange_and_add(int*, int)':
>> hello.hpp:15: error: expected `)' before ':' token
>>
>
> It's a bug in Apple GCC, as near as I can tell.
>
> It might be fixed in the most recent Apple patches to GCC 4.2, which
> have been posted at:
> http://www.opensource.apple.com/darwinsource/DevToolsMar2008/
> gcc_42-5553/
>
> I cobbled up a MacPorts port file that plops these patches on top of
> a "mainline" GCC 4.2.1 and builds C,C++, and Objective-C
> compilers.It's a horrid hack, but it works, and you don't have to
> have an ADC membership to get it, and it works on Tiger, as well as
> Leopard.
>
> (I say "might" because I'm not sure.. I'll have to check, as I'm not
> at my work machine right now.)
>
> The most recent versions of Apple-GCC-4.2.1 -- released with their
> iPhone developer kit -- fix this problem (at least on Intel)... note
> that the iPhone is an ARM platform (not Intel or PowerPC), but as a
> side-effect of updating the compiler for iPhone platform support,
> they fixed the inline-assembly.
>
> Now I'm after them to un-break gfortran after applying their
> Objective-C-2.0 patches...
>
> I'm not sure this helps, but I suggest anyone interested in GCC 4.2
> on Mac to sign up for their (free) Apple ADC and (free) Apple iPhone
> SDK memberships, and download the iPhone SDK.
>
> Best of luck!
>
> - boyd
>
> Boyd Waters
> Scientific Programmer
> National Radio Astronomy Observatory
> (via my .Mac account on my stripped-down test machine...)
>
>
>
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-Mac mailing list
> R-SIG-Mac at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-mac
>
>



More information about the R-SIG-Mac mailing list