473,385 Members | 1,753 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,385 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 1314

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...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.