#18450: Define library dependencies in .pxd files
-------------------------------------+-------------------------------------
       Reporter:  jdemeyer           |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  major              |    Milestone:  sage-6.8
      Component:  cython             |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Jeroen Demeyer     |    Reviewers:
Report Upstream:  Fixed upstream,    |  Work issues:
  but not in a stable release.       |       Commit:
         Branch:                     |  941fa7420f1942114f88bb3a03bd84bb1997d896
  u/jdemeyer/define_library_dependencies_in__pxd_files|     Stopgaps:
   Dependencies:  #18455             |
-------------------------------------+-------------------------------------
Changes (by jdemeyer):

 * status:  needs_review => needs_work
 * upstream:  Reported upstream. Developers deny it's a bug. => Fixed
     upstream, but not in a stable release.


Old description:

> Rather than defining libraries in `module_list.py` or in `.pyx` files, we
> should add them to the `.pxd` files where the declarations are.
>
> In this branch, we do this as proof-of-concept for `pari` and `gmp`.
> Other tickets can be opened later for other libraries. We still leave the
> libraries explicitly in `module_list.py` when needed as dependency of
> another library, for example `mpfr` depends on `gmp`.
>
> One annoying part is that the order of libraries is not defined, so we
> need to manually re-order them using one global library order. Since the
> order of libraries currently specified in `src/module_list.py` is far
> from a DAG, many extensions will be compiled with a different library
> order than before.
>
> To clean up, we also remove the explicit mention of `stdc++` for `c++`
> code (which is automatically added anyway).
>
> -----
>
> These are all modules where the list of libraries was actually changed:
>
> These were probably underlinked before:
> * `sage/rings/polynomial/pbori`: added `gmp`
> * `sage/rings/real_arb` (optional): added `gmp`
>
> These use inline functions or macros of libraries but don't use exported
> functions. So they don't need to link to the library, but it's added
> anyway:
> * `sage/rings/rational`: added `pari`
> * `sage/rings/padics/common_conversion`: added `pari`
>
> Modules using the Sage/PARI interface but not directly using PARI will
> now link against `pari`. Strictly speaking, this is a bug but it's hard
> to avoid:
> * `sage/rings/padics/padic_capped_absolute_element`: added `pari`
> * `sage/rings/padics/padic_capped_relative_element`: added `pari`
> * `sage/rings/padics/padic_fixed_mod_element`: added `pari`
> * `sage/rings/real_double`: added `pari`
>
> This branch adds `gmp` for all modules where bitsets are used. Some
> bitset functions require GMP, others do not. These modules were only
> using the ones not implemented using GMP:
> * `sage/combinat/debruijn_sequence`: added `gmp`
> * `sage/combinat/words/word_char`: added `gmp`
> * `sage/graphs/base/static_sparse_backend`: added `gmp`
> * `sage/graphs/weakly_chordal`: added `gmp`
>
> Unused libraries are removed:
> * `sage/combinat/partitions`: removed `gmp` and `mpfr`
> * `sage/graphs/graph_generators_pyx`: removed `gmp`
> * `sage/groups/semimonomial_transformations/semimonomial_transformation`:
> removed `gmp`
> * `sage/modular/modsym/p1list`: removed `gmp`
> * `sage/modules/vector_mod2_dense`: removed `gmp`
>
> -----
>
> We need 2 patches to upstream Cython to fix dependency handling:
> * [https://github.com/cython/cython/pull/381] (accepted)
> * [https://github.com/cython/cython/pull/392] (upstream doesn't like it)

New description:

 Rather than defining libraries in `module_list.py` or in `.pyx` files, we
 should add them to the `.pxd` files where the declarations are.

 In this branch, we do this as proof-of-concept for `pari` and `gmp`. Other
 tickets can be opened later for other libraries. We still leave the
 libraries explicitly in `module_list.py` when needed as dependency of
 another library, for example `mpfr` depends on `gmp`.

 One annoying part is that the order of libraries is not defined, so we
 need to manually re-order them using one global library order. Since the
 order of libraries currently specified in `src/module_list.py` is far from
 a DAG, many extensions will be compiled with a different library order
 than before.

 To clean up, we also remove the explicit mention of `stdc++` for `c++`
 code (which is automatically added anyway).

 -----

 These are all modules where the list of libraries was actually changed:

 These were probably underlinked before:
 * `sage/rings/polynomial/pbori`: added `gmp`
 * `sage/rings/real_arb` (optional): added `gmp`

 These use inline functions or macros of libraries but don't use exported
 functions. So they don't need to link to the library, but it's added
 anyway:
 * `sage/rings/rational`: added `pari`
 * `sage/rings/padics/common_conversion`: added `pari`

 Modules using the Sage/PARI interface but not directly using PARI will now
 link against `pari`. Strictly speaking, this is a bug but it's hard to
 avoid:
 * `sage/rings/padics/padic_capped_absolute_element`: added `pari`
 * `sage/rings/padics/padic_capped_relative_element`: added `pari`
 * `sage/rings/padics/padic_fixed_mod_element`: added `pari`
 * `sage/rings/real_double`: added `pari`

 This branch adds `gmp` for all modules where bitsets are used. Some bitset
 functions require GMP, others do not. These modules were only using the
 ones not implemented using GMP:
 * `sage/combinat/debruijn_sequence`: added `gmp`
 * `sage/combinat/words/word_char`: added `gmp`
 * `sage/graphs/base/static_sparse_backend`: added `gmp`
 * `sage/graphs/weakly_chordal`: added `gmp`

 Unused libraries are removed:
 * `sage/combinat/partitions`: removed `gmp` and `mpfr`
 * `sage/graphs/graph_generators_pyx`: removed `gmp`
 * `sage/groups/semimonomial_transformations/semimonomial_transformation`:
 removed `gmp`
 * `sage/modular/modsym/p1list`: removed `gmp`
 * `sage/modules/vector_mod2_dense`: removed `gmp`

 -----

 We need 1 patch to upstream Cython to fix dependency handling:
 * [https://github.com/cython/cython/pull/381] (accepted)

--

--
Ticket URL: <http://trac.sagemath.org/ticket/18450#comment:29>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to