<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Oct 6, 2015 at 6:14 PM, Nathaniel Smith <span dir="ltr"><<a href="mailto:njs@pobox.com" target="_blank">njs@pobox.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Oct 6, 2015 at 10:10 AM, David Cournapeau <<a href="mailto:cournape@gmail.com">cournape@gmail.com</a>> wrote:<br>
><br>
><br>
> On Tue, Oct 6, 2015 at 6:07 PM, Nathaniel Smith <<a href="mailto:njs@pobox.com">njs@pobox.com</a>> wrote:<br>
>><br>
>> On Tue, Oct 6, 2015 at 10:00 AM, Antoine Pitrou <<a href="mailto:solipsis@pitrou.net">solipsis@pitrou.net</a>><br>
>> wrote:<br>
>> > On Tue, 6 Oct 2015 09:40:43 -0700<br>
>> > Nathaniel Smith <<a href="mailto:njs@pobox.com">njs@pobox.com</a>> wrote:<br>
>> >><br>
>> >> If you need some npy_* function it'd be much better to let us know<br>
>> >> what it is and let us export it in an intentional way, instead of just<br>
>> >> relying on whatever stuff we accidentally exposed?<br>
>> ><br>
>> > Ok, we seem to be using only the complex math functions (npy_cpow and<br>
>> > friends, I could make a complete list if required).<br>
>><br>
>> And how are you getting at them? Are you just relying the way that on<br>
>> ELF systems, if two libraries are loaded into the same address space<br>
>> then they automatically get access to each other's symbols, even if<br>
>> they aren't linked to each other? What do you do on Windows?<br>
><br>
><br>
> It is possible (and documented) to use any of the npy_ symbols from npymath<br>
> from outside numpy:<br>
> <a href="http://docs.scipy.org/doc/numpy-dev/reference/c-api.coremath.html#linking-against-the-core-math-library-in-an-extension" rel="noreferrer" target="_blank">http://docs.scipy.org/doc/numpy-dev/reference/c-api.coremath.html#linking-against-the-core-math-library-in-an-extension</a><br>
><br>
> The design is not perfect (I was young and foolish :) ), but it has worked<br>
> fairly well and has been used in at least scipy since the 1.4/1.5 days IIRC<br>
> (including windows).<br>
<br>
</span>Okay, so just to confirm, it looks like this does indeed implement the<br>
static linking thing I just suggested (so perhaps I am also young and<br>
foolish ;-)) -- from looking at the output of get_info("npymath"), it<br>
seems to add -I.../numpy/core/include to the compiler flags, add<br>
-lnpymath -L.../numpy/core/lib to the linker flags, and then<br>
.../numpy/core/lib contains only libnpymath.a, so it's static linking.<br></blockquote><div><br></div><div>Yes, I was not trying to argue otherwise. If you thought I was, blame it on my poor English (which sadly does not get better as I get less young...).<br><br></div><div>My proposal is to extend this technique for *internal* API, but with the following differences:<br> * the declarations are not put in any public header<br></div><div> * we don't offer any way to link to this library, and name it something scary enough that people would have to be foolish (young or not) to use it.<br></div><div><br></div><div>David <br><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5"><br>
-n<br>
<br>
--<br>
Nathaniel J. Smith -- <a href="http://vorpus.org" rel="noreferrer" target="_blank">http://vorpus.org</a><br>
_______________________________________________<br>
NumPy-Discussion mailing list<br>
<a href="mailto:NumPy-Discussion@scipy.org">NumPy-Discussion@scipy.org</a><br>
<a href="https://mail.scipy.org/mailman/listinfo/numpy-discussion" rel="noreferrer" target="_blank">https://mail.scipy.org/mailman/listinfo/numpy-discussion</a><br>
</div></div></blockquote></div><br></div></div>