Re: Compiling on Mac OS Snow Leopard

Jerry LeVan <[email protected]>
Newsgroups gmane.comp.python.db.psycopg.devel
Message-ID <[email protected]>
On Sep 13, 2009, at 4:39 PM, Charlie Clark wrote:

> Now that Python 2.6 builds properly all the ports are being updated  
> for it. py26-psycopg has already been done and I've submitted  
> patches based on that Portfile for Python 2.4 and Python 2.5
>
> I'd don't have commit rights so it's moot when these will be adopted  
> but the patches have been tested
>
> http://trac.macports.org/ticket/21348
>
> As the README says Psycopg2 does nothing fancy and all the Portfiles  
> do is set the correct path for pg_config
>

Charlie,

Is there any way I can use the above to build my own version of  
psycop2 2.0.12  with
the community version 2.6.2 of python installed? I have built a 32bit  
i386 only version
of postgresql 8.4.1.

This is what happens if I use the tried and true 'python setup.py  
build' command

[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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.