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

Remove the FLINT include directory from module_list.py #14603

Closed
novoselt opened this issue May 17, 2013 · 13 comments
Closed

Remove the FLINT include directory from module_list.py #14603

novoselt opened this issue May 17, 2013 · 13 comments

Comments

@novoselt
Copy link
Member

Upon the upgrade of FLINT from 1.5.2 to 2.3 (#12173), its include directory in $SAGE_LOCAL/include was changed from all upper to all lower case (FLINT/-> flint/), and Sage library files including stuff from there were changed accordingly.

But, as originally reported on #14600, $SAGE_SRC/module_list.py still contained references to the old name, which led to continual unnecessary rebuilds of 23 extension modules having depends = flint_depends, because the latter was still [SAGE_INC + '/FLINT/flint.h'], a now non-existing file.


It seems the many include_dirs = [SAGE_INC + '/FLINT'] in module_list.py were (and still are) superfluous anyway; i.e., apparently all files using FLINT already #include "flint/foo.h" rather than just foo.h, so we should remove those entries as well.


For backwards compatibility, it might be worth keeping a symbolic link $SAGE_LOCAL/include/FLINT -> flint, but that should be created in an updated FLINT spkg (more precisely, its spkg-install).

Depends on #12173

Component: build

Keywords: sage -b rebuilds

Author: Volker Braun

Reviewer: Nathann Cohen, Leif Leonhardy, Jeroen Demeyer

Merged: sage-5.10.beta4

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

@novoselt novoselt added this to the sage-5.10 milestone May 17, 2013
@vbraun
Copy link
Member

vbraun commented May 17, 2013

Updated patch

@vbraun
Copy link
Member

vbraun commented May 17, 2013

comment:1

Attachment: trac_14600_lowercase_FLINT.patch.gz

I've stripped out the wrong and unnecessary flint include_dir

@vbraun vbraun changed the title Rename the FLINT include directory consistently Remove the FLINT include directory May 17, 2013
@vbraun vbraun changed the title Remove the FLINT include directory Remove the FLINT include directory from module_list.py May 17, 2013
@nexttime
Copy link
Mannequin

nexttime mannequin commented May 17, 2013

comment:6

In fact, we could just let all modules linking to FLINT automatically depend on flint.h, like we do for GMP/MPIR; no need to "manually" specifiy flint_depends. (See $SAGE_SRC/setup.py, lib_headers = ...).

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented May 17, 2013

comment:7

In fact, we could just let all modules linking to FLINT automatically depend on flint.h,

So is this patch still waiting for a review ? It does the job and it looks good to me, but if you think that it should be done in a different way...

Nathann

@nexttime
Copy link
Mannequin

nexttime mannequin commented May 17, 2013

comment:8

Replying to @nathanncohen:

In fact, we could just let all modules linking to FLINT automatically depend on flint.h,

So is this patch still waiting for a review ? It does the job and it looks good to me, but if you think that it should be done in a different way...

Nathann

Patch "Looks good to me."TM.

What I suggested is just one more step forward... (making it more modular and less error-prone by removing even more from module_list.py).

@nexttime
Copy link
Mannequin

nexttime mannequin commented May 17, 2013

comment:9

P.S.: The code in setup.py I was referring to is

# Do not put all, but only the most common libraries and their headers
# (that are likely to change on an upgrade) here:
# [At least at the moment. Make sure the headers aren't copied with "-p",
# or explicitly touch them in the respective spkg's spkg-install.]
lib_headers = { "gmp":     [ os.path.join(SAGE_INC,'gmp.h') ],   # cf. #8664, #9896
                "gmpxx":   [ os.path.join(SAGE_INC,'gmpxx.h') ]
              }

for m in ext_modules:

    for lib in lib_headers.keys():
        if lib in m.libraries:
            m.depends += lib_headers[lib]

    # FIMXE: Do NOT link the following libraries to each and
    #        every module (regardless of the language btw.):
    m.libraries = ['csage'] + m.libraries + ['stdc++', 'ntl']

    m.extra_compile_args += extra_compile_args
    m.extra_link_args += extra_link_args
    m.library_dirs += ['%s/lib' % SAGE_LOCAL]

We'd just have to add

                "flint":   [ os.path.join(SAGE_INC,"flint","flint.h") ]

there.

@nathanncohen
Copy link
Mannequin

nathanncohen mannequin commented May 17, 2013

comment:10

Well, if you feel like adding a reviewer's patch that does that then I will review both :-)

Nathann

@nexttime
Copy link
Mannequin

nexttime mannequin commented May 17, 2013

comment:11

Replying to @nathanncohen:

Well, if you feel like adding a reviewer's patch that does that then I will review both :-)

Nathann

Yes, later today.

@nexttime
Copy link
Mannequin

nexttime mannequin commented May 17, 2013

Reviewer: Nathann Cohen, Leif Leonhardy

@jdemeyer
Copy link

comment:12

Looks good to me.

@jdemeyer
Copy link

Changed reviewer from Nathann Cohen, Leif Leonhardy to Nathann Cohen, Leif Leonhardy, Jeroen Demeyer

@jdemeyer
Copy link

Merged: sage-5.10.beta4

@vbraun
Copy link
Member

vbraun commented May 19, 2013

comment:13

Thanks. Leif's followup will be another ticket, then.

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

3 participants