On Tue, Dec 29, 2009 at 1:31 AM, Nathann Cohen <[email protected]> wrote:
> Hello everybody !!!
>
> There is some Cython code used for Linear Programs in sage that
> require optional packages/libraries to be installed ( they can not
> become standard because of licence issues ) to compile without error.
> For the moment, this code is included in the packages themselves,
> which is not their place.
> This code frequently has to be modified. Besides, when it is modified
> ( and so, when the packages themselves have to be modified ), it often
> happens that other parts of Sage's own code has to be modified too to
> make it all work. It mean ( a problem we met recently ) that if some
> user downloads the latest version of the package, and does not have
> the latest version of Sage, his code will not work as the package is
> more "recent" than the version of Sage available on the website.
>
> To avoid this, the best option we have is to find a way to move this
> code out of the package and find it a place in Sage's own code. We
> would then have Cython files that cannot be compiled until the correct
> libraries are installed :
Yes, we need to solve this problem.
> Do we know how to do this ?
No, we currently don't.
> / it is possible to write it if it is not ?
Yes, it is possible to fix. The first potential solution that pops
into my mind is to modify devel/sage/module_list.py so that elements
in the ext_modules list can be automatically removed if some library
isn't present. I.e., we modify the Extension command so that it has
an additional option which is a list of libraries (or something) that
have to be installed -- if that condition isn't met, then some code we
add to module_list.py will just delete that extension. In other
words:
(1) Make a new class like Extension that allows for an additional keyword.
(2) After creating the list ext_modules in module_list.py, write some
snippet of new code that does:
def really_include(E):
return True
ext_modules = [really_include(E) for E in ext_modules]
(3) Change really_include to be more clever.
-- William
>
> This would also fix the problem that, for the moment, the user has to
> install packages like CBC or GLPK in each BRANCH of Sage to make it
> work ( and he has to force the install as Sage does not want to do it
> ). This comes from the fact that when the user installs the package,
> Sage compiles the Cython files included in it which will only be
> present in the branch where the user was as this moment.
>
> Thank you for your help ! :-)
>
> Nathann
>
> --
> To post to this group, send an email to [email protected]
> To unsubscribe from this group, send an email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/sage-devel
> URL: http://www.sagemath.org
>
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
--
To post to this group, send an email to [email protected]
To unsubscribe from this group, send an email to
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org