On Mon, Feb 16, 2009 at 5:04 PM, Brian Granger <[email protected]> wrote:
>> Ok, thanks. So if my project uses C++ .cpp and .h files, then it has
>> some C++ library, then it has some .pyx and .pxd files and some .so
>> files as a result of cythonzing it, then:
>>
>> C++ .so should go to /usr/lib/
>> C++ .h files should go to /usr/include
>
> This is only if you want the library available outside of Python.
> Otherwise, these things can go with the .py files in the package as
> well.

Yes, I think I want my C++ library to behave like a regular C++ library.

>
>> .pxd and other .py files and the .so as a result of cythonizing should
>> go along the .py files
>
> As I understand it, there are two things that are relevant about the
> location of the .pxd files:
>
> * When you are building your own project, the .pxd files need to be
> "findable" by Cython.  In your case, this finding happens when cmake
> is used to build call Cython and build extensions to begin with.

My own project builds fine, there is no problem with that.

>
> * When external projects want to use your .pxd files in a cimport
> statement, they need to know where they are.  For that, it is really
> helpful if your package can provide a get_pxd_include() function that
> returns the include directory for your  pxd files.  Something like
> (for your hermes2d project):
>
> hermes2d.get_pxd_include()
>
> Another issue for your project, is that people who want to link to it
> will want to know where the .so and .h files are installed (the actual
> C++ library).  Again, I would simply provide top-level functions for
> this:
>
> hermes2d.get_lib()
> hermes2d.get_include()
>
> With these 3 functions, anyone building Cython package based on your
> code can quickly find out where everything is installed.

That's a good idea, I'll do that.

> The only other thing that could complicate this is if there are any
> other dependencies that end users need to build against your project.
>
> Cheers,
>
> Brian
>
> ps - I know this is answering more than your initial question and is
> slightly off topic for this list.

Thanks a lot for answering, in fact, this is exactly what I wanted to know. :)

I'll implement the functions above, that way it will be easy for
anyone to build against my project. There should be no other
dependencies, after I fix everything.

Ondrej
_______________________________________________
Cython-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/cython-dev

Reply via email to