[SciPy-Dev] sparsetools C++ code size

Jaime Fernández del Río jaime.frio at gmail.com
Wed Mar 5 11:33:39 EST 2014


On Mar 5, 2014 7:44 AM, "Pauli Virtanen" <pav at iki.fi> wrote:
>
> Ralf Gommers <ralf.gommers <at> gmail.com> writes:
> > In preparing the beta I've run into a practical issue.
> > My build machine is not my regular (linux) one but an
> > old one running OS X 10.6 - needed for the Mac binaries -
> > with 1 Gb of RAM. I just figured out that it's basically
> > impossible to compile the SWIG-generated C++ sparsetools
> > code with it. This is due to the source code size more than
> > doubling (see below) and everything just grinding to a halt
> > when it hits the first sparsetools extension (csr_wrap.cxx).
>
> There are two possible causes:
>
> - template instantiation over many type permutations
> - the crazy C++ wrapper code SWIG generates
>
> My guess would be on the latter. The .cxx source file sizes
> are completely crazy, and contain *only* Python wrapping code.
> The code that does the actual computations is in the .h files.
>
> It is certainly possible to do the wrapping much tighter by
> just writing the code manually.
>

I am asking out of ignorance here: if you have a templated C++ function,
how do you go about wrapping it to be accessible from Python?

> I wouldn't go rewriting sparsetools in templated C, as it is
> not clear that this would be any superior to C++ template
> instantiation.
>
> --
> Pauli Virtanen
>
> _______________________________________________
> SciPy-Dev mailing list
> SciPy-Dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20140305/39def277/attachment.html>


More information about the SciPy-Dev mailing list