Re: [cython-users] Re: Building related extensions.

14 views
Skip to first unread message

Stefan Behnel

unread,
Aug 7, 2012, 9:38:17 AM8/7/12
to cython...@googlegroups.com
Lukasz, 07.08.2012 15:15:
> Just figured out how to resolve my problem. There's the recipe:
>
> ext_modules=[Extension('ctypes.libctypes', ['ctypes/ctypes.c']),
> Extension("ctypes.ctypes_ext",
> ["ctypes/ctypes_ext.pyx"],
> libraries=["ctypes"],
> library_dirs=["./build/lib/ctypes"])],
>
> Here i could use extra_link_args but this is cleaner, then I just needed to
> set the correct options in setup.cfg:
>
> [build_py]
> build-lib=build/lib
> [build_ext]
> build-lib=build/lib
> [install_lib]
> build-dir=build/lib

I still don't know what you're after. Is this "libcytpes" an extension
module or a plain C library? If the first, why do you link against it? If
the latter, why do you build it as an extension?

Stefan

Stefan Behnel

unread,
Aug 7, 2012, 9:50:33 AM8/7/12
to cython...@googlegroups.com
Lukasz, 07.08.2012 15:47:
>> I still don't know what you're after. Is this "libcytpes" an extension
>> module or a plain C library? If the first, why do you link against it? If
>> the latter, why do you build it as an extension?
>
> It's a library containing data structures which are used by my cython
> extension. I compile it as an extension to build both in one run using
> setup.py.

Ok, then why don't you use this?

ext_modules=[
Extension("ctypes.ctypes_ext",
["ctypes/ctypes_ext.pyx", 'ctypes/ctypes.c'])
]

Stefan

Reply all
Reply to author
Forward
0 new messages