[IPython-User] cython magic library search path

Chris Laumann claumann@physics.harvard....
Thu Sep 6 15:34:07 CDT 2012


Hi Fernando-

I just submitted a PR adding -L library path support to cythonmagic. Works like a charm for me now.

One issue which I haven't fixed tho: I don't think the -la mechanism for passing additional arguments to the linker works. The reason is that you generally want to pass an argument which begins with a hyphen but the magic argument parser appears to interpret that as the next argument to the magic command, not as the option for -la. I didn't dig into the magic parser to see if there's a way to fix this, and it seems to me that the most obvious fixes would change the parsing precedence significantly from what it currently does.

I think the -L argument covers most use cases, although I could certainly imagine wanting to use -framework on OS X, for example. Probably that would be better handled by a fixed -la than adding more hard-coded (and platform dependent) options.

Best, Chris

On Sep 6, 2012, at 3:08 AM, Fernando Perez <fperez.net@gmail.com> wrote:

> On Wed, Sep 5, 2012 at 3:59 PM, Chris Laumann
> <claumann@physics.harvard.edu> wrote:
>> Hi all-
>> 
>> I've just been playing with the cython magic trying to use it to quickly use functions defined in the GSL. Since my libgsl is installed in a nondefault location, I assume I need to add it to the library search path for the linker. I found -I for extending the include path but, following gcc, -L doesn't seem to extend the library path. Is there a way to do this from the %%cython magic?
>> 
> 
> It seems I forgot to add -L to the default options, though I'm not
> sure (I just don't remember right now) if I looked into it and it
> wasn't supported by the underlying distutils machinery or I simply
> failed to look into it.
> 
> But it does support the -la/--link-args flag to pass extra flags to
> the linker, try `-la -L/your/path` and see if that helps.
> 
> Cheers,
> 
> f
> 
> ps - obviously a PR adding -L to the default flags, if it works, would
> be the ideal solution :)
> _______________________________________________
> IPython-User mailing list
> IPython-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-user



More information about the IPython-User mailing list