Mac porting advice?
Todd Miller
jmiller at stsci.edu
Tue Oct 8 15:35:51 EDT 2002
Porting numarray to the Macintosh has been on our TODO list at STSCI for
a while and we're finally doing it. Right now, I have a shell account
on a Mac running OS-X down the hall. Installing the "UNIX version" of
Python and using the distutils to re-compile and install numarray,
almost everything "just works." But since I'm not a Mac developer, I
have a ton of questions:
1. If I build a binary distribution of numarray using the "UNIX version"
of Python under Mac OS-X, can it be used with a native Mac version of
Python? Looked at as a package, numarray includes both native python
code and C extension modules.
2. The only hard part porting numarray to the Mac was floating point
exception handling. On Linux, we use "fenv.h" to provide the FP
exception handling functions. I found an "fenv.h" in the FlatCarbon
header directory. Using that, and -framework Carbon in a manual link,
everything worked. But...
a. Should I be using Carbon? Are there any other ways to get the
equivalent of fenv.h?
b. Assuming I want to, how do I build a Python that just uses Carbon
automatically in distutils?
c. How do I "trick" the distutils into using "-framework Carbon" to link
for any Mac Python? The extension options I know about *append* to the
command line, which doesn't seem to work for -framework Carbon.
3. What are the CPP macros for detecting Mac-hood? I see "darwin" used
in the Python source, but I had to add it to distutils myself as an
extra_compile_arg: -Ddarwin
4. How good is the free C development IDE for the Mac? (Am I wasting my
time in a shell account?) Is OS-X 10.2 worth getting? We have 10.1 now.
Thanks in advance,
Todd
--
Todd Miller jmiller at stsci.edu
STSCI / SSB
More information about the Python-list
mailing list