473,378 Members | 1,457 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Tackling setup.py - A bug??

Hi Folks,

I use p4python for all of my perforce and python related needs. I'm
on a Mac (OSX 10.4). p4python relies on a perforce provided API which
gets compiled when I run the setup.py. The setup.py by default does
not support macs so I figured what better way to spend a night than to
figure out how to add in the neccesary hooks for mac support...

So the problem I am seeing is when I do an import of the module I get
the following error:
>>import p4
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.5/site-packages/p4.py", line 17, in
<module>
import P4Client
ImportError: dlopen(/usr/local/lib/python2.5/site-packages/
P4Client.so, 2): Symbol not found: _CFStringCompare
Referenced from: /usr/local/lib/python2.5/site-packages/P4Client.so
Expected in: dynamic lookup

First I figured out how to compile the thing at the command line so it
worked. ( No the default did not - I tried various derivations on it
to no avail. However at long last I was able to manually compile and
link this so it did work. To get it to compile I used the following
two lines (compile / link)
g++ -c -o build/temp.macosx-10.3-ppc-2.5/P4Clientmodule.o -
DCASE_INSENSITIVE \
-fpascal-strings -isysroot/Developer/SDKs/MacOSX10.4u.sdk -arch
ppc -DCASE_INSENSITIVE \
-O2 -DOS_MACOSX -DOS_MACOSX104 -DOS_MACOSXPPC -DOS_MACOSX104PPC
\
-Ip4api6.1 -I/usr/local/include/python2.5 P4Clientmodule.cc
# Followed by linking using:
g++ -bundle -undefined dynamic_lookup -Wl,-syslibroot,/
Developer/SDKs/MacOSX10.4u.sdk \
-arch ppc \
-o build/lib.macosx-10.3-ppc-2.5/P4Client.so build/
temp.macosx-10.3-ppc-2.5/P4Clientmodule.o\
-Lp4api6.1 p4api6.1/libclient.a p4api6.1/librpc.a p4api6.1/
libsupp.a -framework Carbon

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...

ARGGGGHHHHH!!!

Feb 27 '07 #1
0 1312

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: pbj | last post by:
my application was created in vb.net, vs 2003. the setup project was also created in vs 2003. one of my application reviewers reported this: The .Net link that is included in the setup is not the...
5
by: paul kölle | last post by:
hi all, I noticed that setUp() and tearDown() is run before and after *earch* test* method in my TestCase subclasses. I'd like to run them *once* for each TestCase subclass. How do I do that. ...
0
by: Adam Clauss | last post by:
I have a C++ COM Addin I wrote for Outlook (2002) using VS.Net 2002. Having completed it, I am now looking to create a setup project and install it on another machine. I created a setup project...
4
by: Howard Kaikow | last post by:
When I build a setup project, the dependency in the setup project is tied to the version in which it was built. Is there a way to build a setup project that can be used in both versions of the...
2
by: A.Carter | last post by:
I am developing a windows application with Visual Studio 2003 using C#. The application is complete so naturally I went to create a setup package. I added a setup project to the solution and I went...
1
by: rohan_from_mars | last post by:
I have a windows service and am also using Enterprise Library June 2005 version. Now i have created Setup and Deployment Project which installs the service. but how do i add EL dlls-...
6
by: andrewbb | last post by:
I want to deploy a service with a windows app and the setup program must conform to the Vista certification requirements. Can that be done with the standard .net setup project? Assuming cost is...
0
by: Alexander Petrov | last post by:
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: ext_modules=,
6
by: Srini | last post by:
Hi, I am facing a problem in localizing the setup file and .NET framework redistributable. I am trying to deploy c# winform application. I have created a setup project. I need to...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.