Building packages under Snow Leopard and Python 2.6.x

View: New views
5 Messages — Rating Filter:   Alert me  

Building packages under Snow Leopard and Python 2.6.x

by Jerry LeVan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi

I have the community version of Python 2.6.2 installed on my
MacBook Pro running 10.6.1.

I am trying to build psycopg2  ( 2.0.12) on my mac and am
no having much luck...

[mbp:~/python/psycopg2-2.0.12]$ python setup.py build
running build
running build_py
running build_ext
building 'psycopg2._psycopg' extension
gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -
DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.0.12 (dt dec ext  
pq3)" -DPG_VERSION_HEX=0x080401 -DPSYCOPG_EXTENSIONS=1 -
DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/
Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I.  
-I/usr/local/pgsql/include -I/usr/local/pgsql/include/server -c  
psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/
psycopgmodule.o
In file included from /Library/Frameworks/Python.framework/Versions/
2.6/include/python2.6/unicodeobject.h:4,
                  from /Library/Frameworks/Python.framework/Versions/
2.6/include/python2.6/Python.h:85,
                  from psycopg/psycopgmodule.c:23:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
stdarg.h: No such file or directory
In file included from /Library/Frameworks/Python.framework/Versions/
2.6/include/python2.6/unicodeobject.h:4,
                  from /Library/Frameworks/Python.framework/Versions/
2.6/include/python2.6/Python.h:85,
                  from psycopg/psycopgmodule.c:23:
/Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
stdarg.h: No such file or directory
lipo: can't figure out the architecture type of: /var/folders/5N/
5N7bzOiYF3ONFPRhfGuq3k+++TI/-Tmp-//ccch66qm.out
error: command 'gcc' failed with exit status 1

***************************
It looks like it is trying to build against a very old toolkit  
( 10.4)...

The error messages are not clear to me.. the stdarg.h file exists in  
the 10.4u directory and
includes the 'standard' stdarg.h

I have built a 32 bit i386 only version of postgresql ( 8.4.1)

Any suggestions?

Jerry
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: Building packages under Snow Leopard and Python 2.6.x

by Emanuele Santos :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Try using gcc 4.0, Snow Leopard is using gcc-4.2 by default.

export CC=/usr/bin/gcc-4.0
export CXX=/usr/bin/g++-4.0

-- Emanuele.

On Sep 16, 2009, at 7:31 AM, Jerry LeVan wrote:

> Hi
>
> I have the community version of Python 2.6.2 installed on my
> MacBook Pro running 10.6.1.
>
> I am trying to build psycopg2  ( 2.0.12) on my mac and am
> no having much luck...
>
> [mbp:~/python/psycopg2-2.0.12]$ python setup.py build
> running build
> running build_py
> running build_ext
> building 'psycopg2._psycopg' extension
> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
> fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -
> DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.0.12 (dt dec ext  
> pq3)" -DPG_VERSION_HEX=0x080401 -DPSYCOPG_EXTENSIONS=1 -
> DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/
> Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -
> I. -I/usr/local/pgsql/include -I/usr/local/pgsql/include/server -c  
> psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/
> psycopgmodule.o
> In file included from /Library/Frameworks/Python.framework/Versions/
> 2.6/include/python2.6/unicodeobject.h:4,
>                 from /Library/Frameworks/Python.framework/Versions/
> 2.6/include/python2.6/Python.h:85,
>                 from psycopg/psycopgmodule.c:23:
> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
> stdarg.h: No such file or directory
> In file included from /Library/Frameworks/Python.framework/Versions/
> 2.6/include/python2.6/unicodeobject.h:4,
>                 from /Library/Frameworks/Python.framework/Versions/
> 2.6/include/python2.6/Python.h:85,
>                 from psycopg/psycopgmodule.c:23:
> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
> stdarg.h: No such file or directory
> lipo: can't figure out the architecture type of: /var/folders/5N/
> 5N7bzOiYF3ONFPRhfGuq3k+++TI/-Tmp-//ccch66qm.out
> error: command 'gcc' failed with exit status 1
>
> ***************************
> It looks like it is trying to build against a very old toolkit  
> ( 10.4)...
>
> The error messages are not clear to me.. the stdarg.h file exists in  
> the 10.4u directory and
> includes the 'standard' stdarg.h
>
> I have built a 32 bit i386 only version of postgresql ( 8.4.1)
>
> Any suggestions?
>
> Jerry
> _______________________________________________
> Pythonmac-SIG maillist  -  Pythonmac-SIG@...
> http://mail.python.org/mailman/listinfo/pythonmac-sig

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: Building packages under Snow Leopard and Python 2.6.x

by William Kyngesburye :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I used this without any problems:

export PATH="/usr/local/pgsql/bin:$PATH"
export ARCHFLAGS="-arch i386"

python setup.py build


Compilation is correctly using gcc-4.2 and the 10.6 sdk.  This is with  
the system python.

Did you install Python from python.org?  They probably have the  
distutils using the 10.4 SDK and ppc+intel.  This needs gcc-4.0, but  
'gcc' will run 4.2, as Emanuele pointed out.

On Sep 16, 2009, at 2:21 PM, Emanuele Santos wrote:

> Try using gcc 4.0, Snow Leopard is using gcc-4.2 by default.
>
> export CC=/usr/bin/gcc-4.0
> export CXX=/usr/bin/g++-4.0
>
> -- Emanuele.
>
> On Sep 16, 2009, at 7:31 AM, Jerry LeVan wrote:
>
>> Hi
>>
>> I have the community version of Python 2.6.2 installed on my
>> MacBook Pro running 10.6.1.
>>
>> I am trying to build psycopg2  ( 2.0.12) on my mac and am
>> no having much luck...
>>
>> [mbp:~/python/psycopg2-2.0.12]$ python setup.py build
>> running build
>> running build_py
>> running build_ext
>> building 'psycopg2._psycopg' extension
>> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
>> fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -
>> DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.0.12 (dt dec ext  
>> pq3)" -DPG_VERSION_HEX=0x080401 -DPSYCOPG_EXTENSIONS=1 -
>> DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/
>> Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -
>> I. -I/usr/local/pgsql/include -I/usr/local/pgsql/include/server -c  
>> psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/
>> psycopgmodule.o
>> In file included from /Library/Frameworks/Python.framework/Versions/
>> 2.6/include/python2.6/unicodeobject.h:4,
>>                from /Library/Frameworks/Python.framework/Versions/
>> 2.6/include/python2.6/Python.h:85,
>>                from psycopg/psycopgmodule.c:23:
>> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
>> stdarg.h: No such file or directory
>> In file included from /Library/Frameworks/Python.framework/Versions/
>> 2.6/include/python2.6/unicodeobject.h:4,
>>                from /Library/Frameworks/Python.framework/Versions/
>> 2.6/include/python2.6/Python.h:85,
>>                from psycopg/psycopgmodule.c:23:
>> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
>> stdarg.h: No such file or directory
>> lipo: can't figure out the architecture type of: /var/folders/5N/
>> 5N7bzOiYF3ONFPRhfGuq3k+++TI/-Tmp-//ccch66qm.out
>> error: command 'gcc' failed with exit status 1
>>
>> ***************************
>> It looks like it is trying to build against a very old toolkit  
>> ( 10.4)...
>>
>> The error messages are not clear to me.. the stdarg.h file exists  
>> in the 10.4u directory and
>> includes the 'standard' stdarg.h
>>
>> I have built a 32 bit i386 only version of postgresql ( 8.4.1)
>>
>> Any suggestions?

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

"History is an illusion caused by the passage of time, and time is an  
illusion caused by the passage of history."

- Hitchhiker's Guide to the Galaxy


_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: Building packages under Snow Leopard and Python 2.6.x

by Jerry LeVan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


On Sep 16, 2009, at 4:38 PM, William Kyngesburye wrote:

> I used this without any problems:
>
> export PATH="/usr/local/pgsql/bin:$PATH"
> export ARCHFLAGS="-arch i386"
>
> python setup.py build
>
>
> Compilation is correctly using gcc-4.2 and the 10.6 sdk.  This is with
> the system python.
>
> Did you install Python from python.org?  They probably have the
> distutils using the 10.4 SDK and ppc+intel.  This needs gcc-4.0, but
> 'gcc' will run 4.2, as Emanuele pointed out.
>
> On Sep 16, 2009, at 2:21 PM, Emanuele Santos wrote:
>
>> Try using gcc 4.0, Snow Leopard is using gcc-4.2 by default.
>>
>> export CC=/usr/bin/gcc-4.0
>> export CXX=/usr/bin/g++-4.0
>>
>> -- Emanuele.
>>

Thank you Emanuele and William :)

I did the  gcc-4.0 thingee and it appears to be working...

I do have the 2.6.2 from python.org.

I will try to build the psycopg for the apple 2.6 version after I run  
through
some more tests with the python.org version.

Jerry
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig

Re: Building packages under Snow Leopard and Python 2.6.x

by Ned Deily :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

In article <7FD54A88-9D22-46C8-B25E-7D21EFCCF6A5@...>,
 Jerry LeVan <jerry.levan@...> wrote:

> I have the community version of Python 2.6.2 installed on my
> MacBook Pro running 10.6.1.
>
> I am trying to build psycopg2  ( 2.0.12) on my mac and am
> no having much luck...
>
> [mbp:~/python/psycopg2-2.0.12]$ python setup.py build
> running build
> running build_py
> running build_ext
> building 'psycopg2._psycopg' extension
> gcc -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -
> fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -
> DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.0.12 (dt dec ext  
> pq3)" -DPG_VERSION_HEX=0x080401 -DPSYCOPG_EXTENSIONS=1 -
> DPSYCOPG_NEW_BOOLEAN=1 -DHAVE_PQFREEMEM=1 -DHAVE_PQPROTOCOL3=1 -I/
> Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -I.  
> -I/usr/local/pgsql/include -I/usr/local/pgsql/include/server -c  
> psycopg/psycopgmodule.c -o build/temp.macosx-10.3-fat-2.6/psycopg/
> psycopgmodule.o
> In file included from /Library/Frameworks/Python.framework/Versions/
> 2.6/include/python2.6/unicodeobject.h:4,
>                   from /Library/Frameworks/Python.framework/Versions/
> 2.6/include/python2.6/Python.h:85,
>                   from psycopg/psycopgmodule.c:23:
> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
> stdarg.h: No such file or directory
> In file included from /Library/Frameworks/Python.framework/Versions/
> 2.6/include/python2.6/unicodeobject.h:4,
>                   from /Library/Frameworks/Python.framework/Versions/
> 2.6/include/python2.6/Python.h:85,
>                   from psycopg/psycopgmodule.c:23:
> /Developer/SDKs/MacOSX10.4u.sdk/usr/include/stdarg.h:4:25: error:  
> stdarg.h: No such file or directory
> lipo: can't figure out the architecture type of: /var/folders/5N/
> 5N7bzOiYF3ONFPRhfGuq3k+++TI/-Tmp-//ccch66qm.out
> error: command 'gcc' failed with exit status 1

BTW, this is an unfortunate general problem on 10.6 when building
packages containing C extension modules using pythons installed by any
of the more recent python.org installers.  (It's not a problem if you
are using one of the Apple-supplied pythons.)  The workarounds are (1)
if necessary install the optional 10.4 SDK from the Xcode package
included with Snow Leopard, then (2) use gcc-4.0 for the build rather
than gcc-4.2 by setting CC=/usr/bin/gcc-4.0.

I've opened an issue on the Python bug tracker for this; there are more
details there:

  http://bugs.python.org/issue6957

--
 Ned Deily,
 nad@...

_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@...
http://mail.python.org/mailman/listinfo/pythonmac-sig