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?
> 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
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'.
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.)
On Monday, 5 November 2012 14:28:36 UTC, mark florisson wrote:
> On 5 November 2012 14:14, Joe Jordan <joe.jo...@gmail.com <javascript:>> > wrote: > > 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
> 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'.
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...
On Mon, Nov 5, 2012 at 7:31 AM, tehwalrus <joe.jorda...@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
> On Monday, 5 November 2012 14:28:36 UTC, mark florisson wrote:
>> On 5 November 2012 14:14, Joe Jordan <joe.jo...@gmail.com> wrote:
>> > 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
>> 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'.
--
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