cython extension thinks it's up to date

38 views
Skip to first unread message

Joe Jordan

unread,
Nov 5, 2012, 9:14:46 AM11/5/12
to cython...@googlegroups.com
Hiya,

I have a project which is set up with one or two cython files and then
a whole set of C and C++ files. When I try to rebuild after changing
the cython, everything goes as expected. But when I change the C or
C++ only, cython decides that everything is already up to date.

In setup.py I pass in all the relevant source file names in the
Extension's sources list, so why doesn't the cython compiler detect
that the files have changed and rebuild? One solution is to delete the
build folder and try again, but this rebuilds all modules rather than
just the one I've changed, which is much slower.

Is this a bug in cython, or am I doing something wrong?

Joe

mark florisson

unread,
Nov 5, 2012, 9:28:34 AM11/5/12
to cython...@googlegroups.com
It works here if I list my C files under 'sources', maybe something is
amiss. Could you paste your script? If some parts of the project, such
as header files, are not part of the source, you can also list them
under 'depends'.

Chris Barker

unread,
Nov 5, 2012, 1:11:24 PM11/5/12
to cython...@googlegroups.com
I"m pretty sure I've had the same issues with distutils not pickjing
up changes to the C sources I added to the sources list.

IIUC, to get distutils do this sort of thing right, you need to use
"cythonize". Not as well documented as I'd like, but it does help it
all work better.

A nice complex example with cythonize would be a nice thing to have in
the Wiki...

-Chris



On Mon, Nov 5, 2012 at 7:31 AM, tehwalrus <joe.jo...@gmail.com> wrote:
> attached is a (redacted) setup file. it also contains some fortran hacking
> (http://stackoverflow.com/a/12706377/393816), but that shouldn't be relevant
> to the setup() calls.
>
> (I tried to add the code inline, but the google groups editor messes up the
> formatting something awful.)
>
> Joe
--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris....@noaa.gov
Reply all
Reply to author
Forward
0 new messages