[Pythonmac-SIG] Newbie Mac Question

Bob Ippolito bob at redivi.com
Fri Oct 8 23:42:42 CEST 2004


On Oct 8, 2004, at 5:38 PM, Karl Merkley wrote:

> On Oct 8, 2004, at 3:12 PM, Bob Ippolito wrote:
>
>>
>> On Oct 8, 2004, at 5:01 PM, Karl Merkley wrote:
>>
>>> On Oct 8, 2004, at 2:50 PM, Bob Ippolito wrote:
>>>
>>>>
>>>> On Oct 8, 2004, at 4:42 PM, Karl Merkley wrote:
>>>>
>>>>> I have an application that I am porting to the Mac.  On Linux it 
>>>>> requires that I link against libpython.so.  It  appears that Mac 
>>>>> OS X 10.3 does not include a libpython.dylib.   I _think_ I would 
>>>>> like to stay compatible with the native python on the Mac.  What 
>>>>> is the correct method for getting the shared library?  Assuming 
>>>>> that I have to build it myself, what set of source do I download 
>>>>> and build?  Are there any gotchas that I need to be aware of?
>>>>
>>>> Python on the Mac is built as a framework, which is linked to with 
>>>> -framework Python rather than -lpython.  You should be asking 
>>>> distutils how to link against Python.  Take a look at:
>>>>
>>>> >>> import distutils.sysconfig
>>>> >>> distutils.sysconfig.get_config_vars()
>>>>
>>>> I believe the keys used for embedding python are LINKFORSHARED and 
>>>> CFLAGSFORSHARED.
>>> Thanks.  I'll take a look at that.  Like I said "newbie."  I don't 
>>> even know what questions to ask yet!
>>
>> Well, from experience, I can say that porting software from a 
>> language you're not terribly familiar with to a platform that you 
>> don't know inside and out has quite a steep learning curve! :)  I've 
>> been at it for over three and a half years (doesn't seem like that 
>> long, though) and I still run into things that confuse me every now 
>> and again.
>
> I have should have just trusted my build system.  CMake rocks! 
> (www.cmake.org)  I had already gotten Qt and vtk installed and I had 
> to tell it where vtk lived but it found all the correct python and Qt 
> settings all on its own.  Very cool.  I've already got it built and 
> running.

Excellent!  One thing that would definitely help the community is to 
write an email, create a wiki page at http://pythonmac.org/wiki/, or a 
blog entry (if you have one) that goes through what you needed to do in 
order to get VTK+Python running.  I think VTK is something that a bunch 
of people would like to use.. I tried to build it at some point a long 
time ago, but it wasn't quite ported and the sheer amount of time it 
takes to do a build of VTK discouraged me from finishing with it :)

-bob


More information about the Pythonmac-SIG mailing list