Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with SAGE_INC in module_list.py when using system packages #28349

Closed
embray opened this issue Aug 13, 2019 · 26 comments
Closed

Problem with SAGE_INC in module_list.py when using system packages #28349

embray opened this issue Aug 13, 2019 · 26 comments

Comments

@embray
Copy link
Contributor

embray commented Aug 13, 2019

I noticed in a recent build of Sage on a Debian buster VM, using many system packages, a problem:

Every time I try to re-build, whether I run make build, sage -b, etc. two Python modules get recompiled (from their Cython-generated C sources, though Cython itself is not being re-run). Specifically,

src/build/cythonized/sage/modules/vector_mod2_dense.c
src/build/cythonized/sage/matrix/matrix_mod2_dense.c

One of the things that these two modules have in common, and unique from other modules (as listed in src/module_list.py) is their dependency on SAGE_INC + '/png.h'. But since I'm using the system libpng, this file does not exist, so those modules constantly get rebuilt.

I'm not really sure the best thing to do about this right now. Maybe we should only add those headers to the depends list if they actually exist (and just assume that system headers won't be updated often...)

CC: @dimpase

Component: build

Author: Erik Bray

Branch/Commit: u/embray/ticket-28349 @ c775407

Reviewer: Dima Pasechnik

Issue created by migration from https://trac.sagemath.org/ticket/28349

@embray embray added this to the sage-8.9 milestone Aug 13, 2019
@embray

This comment has been minimized.

@dimpase
Copy link
Member

dimpase commented Aug 13, 2019

comment:2

good catch. I noticed this too, and was wondering what it is...

@jdemeyer
Copy link

comment:3

This file doesn't actually depend on png.h in any way that I can see, so we should just drop that dependency (regardless of whether it fixes the issue on this ticket).

@jdemeyer
Copy link

Author: Jeroen Demeyer

@embray
Copy link
Contributor Author

embray commented Aug 14, 2019

Branch: u/embray/ticket-28349

@embray
Copy link
Contributor Author

embray commented Aug 14, 2019

New commits:

ec2a458Trac #28349: Move include files from Extension.depends into kwds
c775407Trac #28349: Don't explicit use SAGE_INC for most header paths

@embray
Copy link
Contributor Author

embray commented Aug 14, 2019

Changed author from Jeroen Demeyer to Erik Bray

@embray
Copy link
Contributor Author

embray commented Aug 14, 2019

Commit: c775407

@embray
Copy link
Contributor Author

embray commented Aug 14, 2019

comment:6

Replying to @jdemeyer:

This file doesn't actually depend on png.h in any way that I can see, so we should just drop that dependency (regardless of whether it fixes the issue on this ticket).

It does depend indirectly through gd.h, which it does depend on directly. But I agree it's a bit odd to include png.h in that list explicitly.

@embray
Copy link
Contributor Author

embray commented Aug 14, 2019

comment:7

Sorry--pressed submit without seeing you had added to this. Maybe you were going to change something?

Nevertheless, the problem is still more general than png.h. It would be better not to use SAGE_INC in this way (e.g. the same problem applies for m4ri, I just don't have a system package for that yet).

@dimpase
Copy link
Member

dimpase commented Aug 14, 2019

comment:8
+from sage.env import SAGE_LOCAL, SAGE_INC

would surely be inconvenient for distributions that don't use sage.env.

@jdemeyer
Copy link

Changed branch from u/embray/ticket-28349 to u/jdemeyer/ticket-28349

@embray
Copy link
Contributor Author

embray commented Aug 14, 2019

Changed commit from c775407 to 7100fa7

@embray
Copy link
Contributor Author

embray commented Aug 14, 2019

comment:10

Apparently in the depends = ['png.h] traces back to #5265, and didn't really make sense then either. When vector_mod2_dense was added it was just carried over as cargo cult.


New commits:

7100fa7Fix dependencies on png.h and m4ri.h

@jdemeyer
Copy link

New commits:

ec2a458Trac #28349: Move include files from Extension.depends into kwds
c775407Trac #28349: Don't explicit use SAGE_INC for most header paths

@jdemeyer
Copy link

Changed branch from u/jdemeyer/ticket-28349 to u/embray/ticket-28349

@jdemeyer
Copy link

Changed commit from 7100fa7 to c775407

@embray
Copy link
Contributor Author

embray commented Aug 14, 2019

comment:12

Heh, perhaps we can merge these two fixes? I think Jeroen's branch makes sense in its own right.

@jdemeyer
Copy link

comment:13

I created #28352 with my fix.

@jdemeyer
Copy link

comment:14

Replying to @embray:

It does depend indirectly through gd.h, which it does depend on directly.

My gd.h does not depend on png.h

@jdemeyer
Copy link

comment:15

The gd library does depend on the png library, but that's independent of the header files.

@kiwifb
Copy link
Member

kiwifb commented Aug 14, 2019

comment:16

Replying to @dimpase:

+from sage.env import SAGE_LOCAL, SAGE_INC

would surely be inconvenient for distributions that don't use sage.env.

Some of us are phasing out sage-env but we do love sage.env.

@embray
Copy link
Contributor Author

embray commented Dec 30, 2019

comment:17

Ticket retargeted after milestone closed

@embray embray modified the milestones: sage-8.9, sage-9.1 Dec 30, 2019
@mkoeppe
Copy link
Contributor

mkoeppe commented Apr 27, 2020

comment:18

If I'm not mistaken, this was fixed by #28352?

@mkoeppe mkoeppe removed this from the sage-9.1 milestone Apr 27, 2020
@dimpase
Copy link
Member

dimpase commented Apr 28, 2020

comment:19

this one has been fixed, but similar problems pop up elsewhere, e.g. I saw similar parasite rebuilds with
the branch of #29369 (currently disabled) - apparently

    Extension('sage.rings.polynomial.pbori',
              sources = ['sage/rings/polynomial/pbori.pyx'],
              libraries=['brial', 'brial_groebner'] + m4ri_libs + png_libs,
              library_dirs = m4ri_library_dirs + png_library_dirs,
              include_dirs = m4ri_include_dirs + png_include_dirs,
              depends = [SAGE_INC + "/polybori/" + hd + ".h" for hd in ["polybori", "config"]],
              extra_compile_args = m4ri_extra_compile_args),

is to blame

@dimpase
Copy link
Member

dimpase commented Apr 28, 2020

Reviewer: Dima Pasechnik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants