[Cython] cross project cimport

Robert Bradshaw robertwb at math.washington.edu
Wed Jun 18 00:25:46 CEST 2008


On Jun 17, 2008, at 3:17 PM, Brian Granger wrote:

> On Tue, Jun 17, 2008 at 3:59 PM, Robert Bradshaw
> <robertwb at math.washington.edu> wrote:
>> Copying over the .pxd file should work fine (that's what they're for)
>> but you should also be able to set an include directory.
>
> But copying it over is a bit messy:

I agree, this was the short term solution.

> 1) If mpi4py changes its pxd file, we have to re-copy it over.  Also,
> when there are changes like this, it become very difficult for us to
> write code that works under both versions.
>
> 2) The pxd file includes other things (mpi.pxi) that will also have to
> be copied over.
>
> It would be nice if mpi4py could install its MPI.pxd and mpi.pxi files
> and then we could do:
>
> cimport mpi4py.MPI
>
> And that cython could resolve the paths simply based on the installed
> location of mpi4py.  That might be too magic though.

Perhaps the -I option will do what you want. This is certainly an  
area for improvement, and I think the best would be to handle it  
using the exact same framework that resolves the .py files.

>
> Cheers,
>
> Brian
>
>> On Jun 17, 2008, at 12:56 PM, Brian Granger wrote:
>>
>>> Hi,
>>>
>>> I am wondering if cross project cimports will work or if any thought
>>> has gone into making this work.  Basically, mpi4py has a pxd file I
>>> need to cimport it in a completely different project.  One option is
>>> to copy it over to the other project, but that is quite annoying  
>>> as it
>>> includes a bunch of pxi files and these would need to be copied over
>>> as well.  Any thoughts on this?
>>>
>>> Thanks
>>>
>>> Brian
>>> _______________________________________________
>>> Cython-dev mailing list
>>> Cython-dev at codespeak.net
>>> http://codespeak.net/mailman/listinfo/cython-dev
>>
>> _______________________________________________
>> Cython-dev mailing list
>> Cython-dev at codespeak.net
>> http://codespeak.net/mailman/listinfo/cython-dev
>>
> _______________________________________________
> Cython-dev mailing list
> Cython-dev at codespeak.net
> http://codespeak.net/mailman/listinfo/cython-dev



More information about the Cython-dev mailing list