Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
Re: Correct steps for *optimizing* a build of recent GCC/Gfortran on OSX?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Correct steps for *optimizing* a build of recent GCC/Gfortran on OSX?



Doug,

The reference to prebuilt binaries is much appreciated!  Still, I need to get to the point of being competent to build from source with the flexibility to tweak/change options etc.  And, hopefully, to understand how to deal with Apple's non-standard  "Apple Local" customizations -- or if they're ven required anymore for GCC>= v42x.

Nonetheless, I've contacted the author (GuaravKhanna) at HPC directly, to see if I might beg/borrow/steal some guidance.

Thanks again for the reference.

Regards,

Bob Tompkins

On Dec 5, 2007 1:16 PM, Doug Reeder <email@hidden> wrote:
Bob,

The easiest way is to go to hpc.sourceforge.net and download the prebuilt binaries (gcc-4.3)  for leopard.

Doug Reeder
On Dec 5, 2007, at 1:01 PM, Bob Tomkins wrote:

Hi,

I've a goal of building an autovectoring/optimized GCC/GFortran v4.2.1 (& newer) on OSX 10.5.1.

I'm starting with source trees pulled from,

    http://www.opensource.apple.com/darwinsource/10.5/gcc_42-5531/
    svn://gcc.gnu.org/svn/gcc/tags/gcc_4_2_1_release/gcc/fortran

Per instructions, I invoke the build simply with,

    mkdir -p build/obj build/dst build/sym
    gnumake install RC_OS=macos RC_ARCHS=ppc TARGETS=ppc \
    SRCROOT=`pwd` OBJROOT=`pwd`/build/obj \
    DSTROOT=`pwd`/build/dst SYMROOT=`pwd`/build/sym

That works perfectly for Out-of-the-Box GCC/GFortran.

Next, to turn on auto-vectorization, reading here,

    http://gcc.gnu.org/projects/tree-ssa/vectorization.html

I understand that I must assign

    CFLAGS =... -O3 -ftree-vectorize -ftree-vectorizer-verbose=1 ...

Building the "Apple way", so as to include the apple-driver, etc., my understanding is that all configuration occurs in the "APPLE LOCAL",

    build_gcc

My questions about this are,

(1) Is that true?

(2) If so, is this a sufficient patch to do the trick, and correctly propagate the CFLAGS through the entire multi-stage build of gcc?

    =====================================================
    --- build_gcc_ORIG    2007-12-04 12:31:50.000000000 -0800
    +++ build_gcc    2007-12-04 12:32:59.000000000 -0800
    @@ -33,7 +33,7 @@
     # $RC_NONARCH_CFLAGS (and mysteriously prepends '-pipe' thereto).
     # We will allow this to override the default $CFLAGS and $CXXFLAGS.
     
    -CFLAGS="-g -O2 ${RC_NONARCH_CFLAGS/-pipe/}"
    +CFLAGS="-g -O3 -ftree-vectorize -ftree-vectorizer-verbose=1 ${RC_NONARCH_CFLAGS/-pipe/}"
     
     # This isn't a parameter; it is the architecture of the current machine.
     BUILD=`arch | $TRANSLATE_ARCH`
    @@ -103,10 +103,12 @@
     CONFIGFLAGS="--disable-checking -enable-werror \
       --prefix=$DEST_ROOT \
       --mandir=\${prefix}/share/man \
    -  --enable-languages=c,objc,c++,obj-c++ \
    +  --enable-languages=c,objc,c++,obj-c++,fortran \
       --program-transform-name=/^[cg][^.-]*$/s/$/-$MAJ_VERS/ \
       --with-gxx-include-dir=\${prefix}/include/c++/$LIBSTDCXX_VERSION \
       --with-slibdir=/usr/lib \
    +  --with-gmp=/usr/local/gmp \
    +  --with-mpfr=/usr/local/mpfr \
       --build=$BUILD-apple-darwin$DARWIN_VERS"
     
     # Figure out how many make processes to run.
    =====================================================

(3) Given OSX' recent UNIX-compliance certification, is this Apple-localized building of GCC still needed/recommended?

Or is there a more straighforward, generic process that can now be adopted so as to be able to more easily track progress in the GCC Trunk?

I'd appreciate any advice!

Bob Tompkins
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list       (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Unix-porting mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Correct steps for *optimizing* a build of recent GCC/Gfortran on OSX? (From: "Bob Tomkins" <email@hidden>)
 >Re: Correct steps for *optimizing* a build of recent GCC/Gfortran on OSX? (From: Doug Reeder <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.