[SciPy-Dev] Beginning work on robustly allowing function pointers in integrate - quad

Ralf Gommers ralf.gommers at gmail.com
Sat Oct 12 01:17:17 EDT 2013


On Fri, Oct 11, 2013 at 5:41 PM, Nathan Woods <charlesnwoods at gmail.com>wrote:

>
>
>
> On Fri, Oct 11, 2013 at 3:38 AM, Pauli Virtanen <pav at iki.fi> wrote:
>
>> The quad callback would be `double f(double *a, void *params)`.
>> The call signatures of course depends on the routine. Perhaps it should
>> also be standardized.
>>
>> What I mean here is that while in Python, you can do `f(arg1, arg2, *a,
>> **kw)`
>> there's no way in C to make calls with `*a` and `**kw` without on-the-fly
>> code generation. Which we don't want to do --- too complicated.
>> The best option is to keep it simple.
>>
>
> All right, I have a better handle on what you're describing now.
>
>
>> [clip]
>> > I guess I thought that we were talking about replacing most of the
>> > code in quad(). As far as I can tell, the integrate library uses the
>> > C/Python API to communicate with the underlying Quadpack code. One of
>> > the main difficulties I see is that the C/Python API is fairly complex,
>> > and therefore the wrapper code is difficult to modify. I'd be a lot
>> > happier if this could be done with one of the simpler tools
>> > (probably Cython, since that seems to be the way the community is
>> > leaning), so that the interface doesn't become a magic black box.
>>
>> The quadpack wrappers could probably be done with f2py without too
>> many problems.
>>
>
> It was mentioned on here a few weeks ago that there were problems
> associated with using new Fortran code, particularly with  mingw. Looking
> over the build instructions for mingw, I would assume that the difficulty
> is the g77 compiler, which would limit all new fortran code to Fortran77.
> Is that correct? Are there any other difficulties to be aware of?
>

That's correct. I'm hoping we can drop g77 in the near future, but for the
0.13 release we still depend on it. We should have one release with recent
gfortran without issues before dropping g77 imho.

Ralf
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scipy-dev/attachments/20131012/c666a864/attachment.html>


More information about the SciPy-Dev mailing list