tags:

views:

268

answers:

2

Why? I want to do this because installation of SciPy recommends it, and I thought it would be a good learning experience. This question has been asked before (e.g. here). The preferred answer seems to be to use MacPorts, but as I say, I'd like to understand how it's done.

Anyway, I grab the source (Python-2.6.4.tgz) and unzip. I read the instructions on how to build a 64-bit "framework" build. As I understand it, I should run

./configure --enable-framework --enable-universalsdk=/ --with-univeral-archs=intel

configure runs for a while...and finishes. When I do make, it's obviously got a problem:

$ make
gcc -c -arch ppc -arch i386 -isysroot /  -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes  -I. -IInclude -I./Include   -DPy_BUILD_CORE -o Modules/python.o ./Modules/python.c
In file included from //usr/include/architecture/i386/math.h:626,
                 from //usr/include/math.h:28,
                 from Include/pyport.h:235,
                 from Include/Python.h:58,
                 from ./Modules/python.c:3:
//usr/include/AvailabilityMacros.h:108:14: warning: #warning Building for Intel with Mac OS X Deployment Target < 10.4 is invalid.

gcc is being called with the wrong arguments. Do I have the wrong arguments to configure, or should I set compiler flags in the environment, or what?

Edit: I don't see any errors in the output from configure...and I see this line:

checking for OSX 10.5 SDK or later... yes

it ends with

creating Modules/Setup
creating Modules/Setup.local
creating Makefile

Edit2: I thought I copied from the readme...

I did! There's a typo in the readme spec! My age-related dyslexia is acting up again. ;)

+1  A: 

Your ./configure option is not correct. --enable-universalsdk should be set to the correct SDK, not /! That's why gcc got confused, see the option -isysroot. So, check what SDKs you have in /Developer/SDKs, and set the correct one.

Moreover, your gcc is called only with -arch ppc -arch i386, which do not include -arch x86_64 which is the intel 64 bit flag.

Yuji
Thanks, Yuji. For the first comment, I'm just following the docs: specify ``/`` when building on a 10.5 system, especially when building 64-bit code. I've tried doing it explicityly too (I think). For the second: I didn't call gcc myself, and I'm pretty sure if I set a flag in the environment, it will be ignored by configure.
telliott99
Actually, --enable-universalsdk=/ is explicitly supported in the configure script. The real problem was the misspelled --with-universal-archs.
Ned Deily
Thanks for the follow-up comment, and sorry for my misguided reply :p
Yuji
A: 

In order to choose an answer as correct, I'm paraphrasing comments above:

As noticed by Virgil Dupras, there was a typo in this flag:

--with-universal-archs=intel

It originates from the file Mac/readme, but I should've caught it before posting. Also I recommend that you read Ned Deily's very helpful comments. Check out those guys and vote 'em up.

telliott99