Tackling setup.py - A bug??

  • Thread starter Alexander Petrov
  • Start date
A

Alexander Petrov

Hi,

I've successfully compiled p4python with modified setup.py
the key to success was to split extra_compile_args's argument '-arch'
into 2 args.

below is fixed part:

Code:
             ext_modules=[Extension("P4Client", [ "P4Clientmodule.cc"
],
                            include_dirs=[ os.path.join( p4_api_dir,
"include", "p4" ) ],
                            library_dirs=[ os.path.join( p4_api_dir,
"lib" ) ],
                            libraries=["client", "rpc", "supp"],    #
P4API libs
                            extra_compile_args=["-DCASE_INSENSITIVE",
"-fpascal-strings",
                                                "-isysroot",
"/Developer/SDKs/MacOSX10.4u.sdk",
                                                "-DOS_MACOSX",
"-DOS_MACOSX104"
                                                , "-arch", "ppc"
                                                ,"-D%s" % p4_api_ver],
                            extra_link_args=[
"-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk"
                                      , "-arch", "ppc"
                            , "-framework", "System"
                            , "-framework", "CoreFoundation"
                            , "-framework", "Carbon"
                            ],
                            )]

hope it will help


--- Original Message: ---
And this followed by an setup.py install seemed to work just fine. Ok
so now I need to backport these options into setup.py. Here is what I
came up with..

elif os.name == "posix":
setup(name=NAME,
version=VERSION,
description=DESCRIPTION,
author=AUTHOR,
author_email=AUTHOR_EMAIL,
maintainer=MAINTAINER,
maintainer_email=MAINTAINER_EMAIL,
license=LICENSE,
url=URL,
keywords=KEYWORDS,
classifiers = filter(None, classifiers.split("\n")),
long_description = "\n".join(doclines[2:]),
py_modules=PY_MODULES,
ext_modules=[Extension("P4Client", ["P4Clientmodule.cc"],
include_dirs=[p4_api_dir],
library_dirs=[p4_api_dir],
libraries=["client", "rpc", "supp"], #
P4API libs
extra_compile_args=["-DCASE_INSENSITIVE",
"-fpascal-strings",
"-isysroot/Developer/
SDKs/MacOSX10.4u.sdk",
"-DOS_MACOSX", "-
DOS_MACOSX104",
"-DOS_MACOSXPPC", "-
DOS_MACOSX104PPC" ,"-D%s" % p4_api_ver],
extra_link_args=[ "-Wl,-syslibroot,/
Developer/SDKs/MacOSX10.4u.sdk", "-arch ppc", "-framework Carbon" ],
)])

But low and behold it didn't work... In the course of debugging I
found that the compile works. The linking appears to be a problem.
In the link stage I see the command which is being run looks very
similar to my command

g++ -bundle -undefined dynamic_lookup build/temp.macosx-10.3-ppc-2.5/
P4Clientmodule.o \
-Lp4api6.1 -lclient -lrpc -lsupp -o build/lib.macosx-10.3-ppc-2.5/
P4Client.so \
-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch ppc -framework
Carbon

Not quite the same but close enough. HERE is where the bug shows
up........
If I rerun this same EXACT command at the command line - followed by a
setup.py install it works.

Can someone with a larger python brain than mine please help me figure
this out? It's bugging the crap out fo me...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,961
Messages
2,570,131
Members
46,689
Latest member
liammiller

Latest Threads

Top