[Numpy-discussion] incorporating C/C++ code
Christopher Barker
Chris.Barker at noaa.gov
Thu Jun 29 15:18:25 EDT 2006
Louis Cordier wrote:
>> At this point I would not use SWIG or Instant.
In general, SWIG makes sense if you have a substantial existing library
that you need access to, and particularly if that library is evolving
and needs to be used directly from C/C++ code as well.
If you are writing C/C++ code specifically to be used as a python
extension, pyrex and boost::python are good choices. There was a Numeric
add-on to boost::python at one point, I don't know if anyone has
modified it for numpy.
> I was wondering if there where any issues with say using Psyco
> with NumPy ? http://psyco.sourceforge.net/
Psyco knows nothing of numpy arrays, and thus can only access them as
generic Python objects -- so it won't help.
A couple years ago, someone wrote a micro-Numeric package that used
python arrays as the base storage, and ran it with psyco with pretty
impressive results. What that tells me is that if psyco could be taught
to understand numpy arrays, (or at least the generic array interface) it
could work well. It would be a lot of work, however.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chris.Barker at noaa.gov
More information about the NumPy-Discussion
mailing list