[sagemath] 03/14: Delete patches for wrong versions of givaro, ipython and linbox.

Tobias Hansen thansen at moszumanska.debian.org
Tue Oct 25 00:51:24 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch sage-7.4
in repository sagemath.

commit 9bbe67795f512e45ba1d8af0cc78e3beaad68659
Author: Tobias Hansen <thansen at broeselmaschine.fc.up.pt>
Date:   Mon Oct 24 22:40:08 2016 +0000

    Delete patches for wrong versions of givaro, ipython and linbox.
---
 debian/patches/series                   |   3 -
 debian/patches/version-givaro-4.patch   |  38 ---
 debian/patches/version-ipython-5.patch  | 531 --------------------------------
 debian/patches/version-linbox-1.4.patch | 455 ---------------------------
 4 files changed, 1027 deletions(-)

diff --git a/debian/patches/series b/debian/patches/series
index d1cb350..08da36b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -17,11 +17,8 @@ fixsage-allow-override-sage-local.patch
 # we'll probably drop these when importing the next version of Sage
 version-python-2.7.11.patch
 version-ecm-7.patch
-version-linbox-1.4.patch
-version-ipython-5.patch
 version-singular-4.patch
 version-cddlib-094h.patch
-version-givaro-4.patch
 version-glpk-4.60.patch
 #version-planarity-3.patch #breaks tests
 
diff --git a/debian/patches/version-givaro-4.patch b/debian/patches/version-givaro-4.patch
deleted file mode 100644
index 4e2050a..0000000
--- a/debian/patches/version-givaro-4.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-Description: Fix coercion bug: raise a TypeError exception whenever an ArithmeticError is caught, while trying to reduce an element mod the characteristic.
- This fixes a test in src/sage/crypto/block_cipher/miniaes.py
-Author: Clement Pernet <clement.pernet at imag.fr>
-Applied-Upstream: commit:b7233c9cb64829f3c8a64b04aa744bdbb007ed27
----
-This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
---- a/sage/src/sage/rings/finite_rings/element_givaro.pyx
-+++ b/sage/src/sage/rings/finite_rings/element_givaro.pyx
-@@ -351,6 +351,14 @@
-             sage: k(-2^100)
-             2
- 
-+        Check coercion of incompatible fields::
-+
-+            sage: x=GF(7).random_element()
-+            sage: k(x)
-+            Traceback (most recent call last):
-+            ...
-+            TypeError: unable to coerce from a finite field other than the prime subfield
-+
-         For more examples, see
-         ``finite_field_givaro.FiniteField_givaro._element_constructor_``
-         """
-@@ -375,9 +383,11 @@
-         elif isinstance(e, int) or \
-              isinstance(e, Integer) or \
-              isinstance(e, long) or is_IntegerMod(e):
--            e_int = e % self.characteristic()
--            res = self.objectptr.initi(res, e_int)
--
-+            try:
-+                e_int = e % self.characteristic()
-+                res = self.objectptr.initi(res, e_int)
-+            except ArithmeticError:
-+                raise TypeError("unable to coerce from a finite field other than the prime subfield")
-         elif e is None:
-             e_int = 0
-             res = self.objectptr.initi(res, e_int)
diff --git a/debian/patches/version-ipython-5.patch b/debian/patches/version-ipython-5.patch
deleted file mode 100644
index d16abbd..0000000
--- a/debian/patches/version-ipython-5.patch
+++ /dev/null
@@ -1,531 +0,0 @@
-Description: Necessary changes to work with ipython 5.
-Origin: https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/sagemath
-
---- a/sage/src/sage/doctest/forker.py
-+++ b/sage/src/sage/doctest/forker.py
-@@ -116,10 +116,6 @@
-     from sage.structure.debug_options import debug
-     debug.refine_category_hash_check = True
- 
--    # Disable IPython colors during doctests
--    from sage.repl.interpreter import DEFAULT_SAGE_CONFIG
--    DEFAULT_SAGE_CONFIG.TerminalInteractiveShell.colors = 'NoColor'
--
-     # We import readline before forking, otherwise Pdb doesn't work
-     # os OS X: http://trac.sagemath.org/14289
-     import readline
-@@ -1088,15 +1084,13 @@
-             sage: _ = sage0.eval("import doctest, sys, os, multiprocessing, subprocess")
-             sage: _ = sage0.eval("from sage.doctest.parsing import SageOutputChecker")
-             sage: _ = sage0.eval("import sage.doctest.forker as sdf")
--            sage: _ = sage0.eval("sdf.init_sage()")
-             sage: _ = sage0.eval("from sage.doctest.control import DocTestDefaults")
-             sage: _ = sage0.eval("DD = DocTestDefaults(debug=True)")
-             sage: _ = sage0.eval("ex1 = doctest.Example('a = 17', '')")
-             sage: _ = sage0.eval("ex2 = doctest.Example('2*a', '1')")
-             sage: _ = sage0.eval("DT = doctest.DocTest([ex1,ex2], globals(), 'doubling', None, 0, None)")
-             sage: _ = sage0.eval("DTR = sdf.SageDocTestRunner(SageOutputChecker(), verbose=False, sage_options=DD, optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS)")
--            sage: sage0._prompt = r"debug: "
--            sage: print(sage0.eval("DTR.run(DT, clear_globs=False)")) # indirect doctest
-+            sage: print(sage0.eval("sdf.init_sage(); DTR.run(DT, clear_globs=False)")) # indirect doctest
-             **********************************************************************
-             Line 1, in doubling
-             Failed example:
-@@ -1110,7 +1104,6 @@
-             ...
-             sage: sage0.eval("a")
-             '...17'
--            sage: sage0._prompt = "sage: "
-             sage: sage0.eval("quit")
-             'Returning to doctests...TestResults(failed=1, attempted=2)'
-         """
-@@ -1144,13 +1137,14 @@
-                         print(src)
-                         if ex.want:
-                             print(doctest._indent(ex.want[:-1]))
--                    from sage.repl.interpreter import DEFAULT_SAGE_CONFIG
-+                    from sage.repl.configuration import sage_ipython_config
-+                    from sage.repl.prompts import DebugPrompts
-                     from IPython.terminal.embed import InteractiveShellEmbed
--                    import copy
--                    cfg = copy.deepcopy(DEFAULT_SAGE_CONFIG)
--                    prompt_config = cfg.PromptManager
--                    prompt_config.in_template = 'debug: '
--                    prompt_config.in2_template = '.....: '
-+                    cfg = sage_ipython_config.default()
-+                    # Currently this doesn't work: prompts only work in pty
-+                    # We keep simple_prompt=True, prompts will be "In [0]:"
-+                    # cfg.InteractiveShell.prompts_class = DebugPrompts
-+                    # cfg.InteractiveShell.simple_prompt = False
-                     shell = InteractiveShellEmbed(config=cfg, banner1='', user_ns=dict(globs))
-                     shell(header='', stack_depth=2)
-                 except KeyboardInterrupt:
-@@ -1248,6 +1242,7 @@
-             sage: _ = sage0.eval("ex = doctest.Example('E = EllipticCurve([0,0]); E', 'A singular Elliptic Curve')")
-             sage: _ = sage0.eval("DT = doctest.DocTest([ex], globals(), 'singular_curve', None, 0, None)")
-             sage: _ = sage0.eval("DTR = sdf.SageDocTestRunner(SageOutputChecker(), verbose=False, sage_options=DD, optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS)")
-+            sage: old_prompt = sage0._prompt
-             sage: sage0._prompt = r"\(Pdb\) "
-             sage: sage0.eval("DTR.run(DT, clear_globs=False)") # indirect doctest
-             '... ArithmeticError("invariants " + str(ainvs) + " define a singular curve")'
-@@ -1257,7 +1252,7 @@
-             '...EllipticCurve_field.__init__(self, K, ainvs)'
-             sage: sage0.eval("p ainvs")
-             '(0, 0, 0, 0, 0)'
--            sage: sage0._prompt = "sage: "
-+            sage: sage0._prompt = old_prompt
-             sage: sage0.eval("quit")
-             'TestResults(failed=1, attempted=1)'
-         """
---- a/sage/src/sage/doctest/test.py
-+++ b/sage/src/sage/doctest/test.py
-@@ -360,7 +360,7 @@
-         s...: b = 5
-         s...: a + b
-         8
--    debug:
-+    In [1]:
-     <BLANKLINE>
-     Returning to doctests...
-     **********************************************************************
---- a/sage/src/sage/interfaces/sage0.py
-+++ b/sage/src/sage/interfaces/sage0.py
-@@ -18,6 +18,7 @@
- 
- import cPickle
- import os
-+import re
- 
- from .expect import Expect, ExpectElement, FunctionElement
- import sage.repl.preparse
-@@ -146,10 +147,17 @@
-             if init_code is None:
-                 init_code = ['from sage.all import *', 'import cPickle']
-         else:
--            # Disable the IPython history (implemented as SQLite database)
--            # to avoid problems with locking.
--            command = "sage-ipython --HistoryManager.hist_file=:memory: --colors=NoColor"
--            prompt = "sage: "
-+            command = ' '.join([
-+                'sage-ipython',
-+                # Disable the IPython history (implemented as SQLite database)
-+                # to avoid problems with locking.
-+                '--HistoryManager.hist_file=:memory:',
-+                # Disable everything that prints ANSI codes
-+                '--colors=NoColor',
-+                '--no-term-title',
-+                '--simple-prompt',
-+            ])
-+            prompt = re.compile('In \[\d+\]: ')
-             if init_code is None:
-                 init_code = ['import cPickle']
- 
---- a/sage/src/sage/misc/trace.py
-+++ b/sage/src/sage/misc/trace.py
-@@ -54,6 +54,7 @@
-         sage: import pexpect
-         sage: s = pexpect.spawn('sage')
-         sage: _ = s.sendline("trace('print(factor(10))'); print(3+97)")
-+        sage: _ = s.expect('ipdb>', timeout=90)
-         sage: _ = s.sendline("s"); _ = s.sendline("c");
-         sage: _ = s.expect('100', timeout=90)
- 
---- /dev/null
-+++ b/sage/src/sage/repl/configuration.py
-@@ -0,0 +1,152 @@
-+r"""
-+Sage's IPython Configuration
-+"""
-+
-+#*****************************************************************************
-+#       Copyright (C) 2016 Volker Braun <vbraun.name at gmail.com>
-+#
-+#  Distributed under the terms of the GNU General Public License (GPL)
-+#  as published by the Free Software Foundation; either version 2 of
-+#  the License, or (at your option) any later version.
-+#                  http://www.gnu.org/licenses/
-+#*****************************************************************************
-+
-+from __future__ import absolute_import
-+
-+import sys
-+import copy
-+from traitlets.config.loader import Config
-+
-+from sage.repl.prompts import SagePrompts
-+
-+
-+# Name of the Sage IPython extension
-+SAGE_EXTENSION = 'sage'
-+
-+
-+class SageIpythonConfiguration(object):
-+
-+    def _doctest_mode(self):
-+        """
-+        Whether we are in doctest mode
-+
-+        This returns ``True`` during doctests.
-+
-+        EXAMPLES::
-+        
-+            sage: from sage.repl.configuration import sage_ipython_config
-+            sage: sage_ipython_config._doctest_mode()
-+            True
-+        """
-+        from sage.doctest import DOCTEST_MODE
-+        return DOCTEST_MODE
-+    
-+    def _allow_ansi(self):
-+        """
-+        Whether to allow ANSI escape sequences
-+
-+        This returns ``False`` during doctests to avoid ANSI escape 
-+        sequences.
-+
-+        EXAMPLES::
-+        
-+            sage: from sage.repl.configuration import sage_ipython_config
-+            sage: sage_ipython_config._allow_ansi()
-+            False
-+        """
-+        return (not self._doctest_mode()) and sys.stdout.isatty()
-+
-+    def colors(self):
-+        """
-+        Return the IPython color palette
-+
-+        This returns ``'NoColor'`` during doctests to avoid ANSI escape 
-+        sequences.
-+
-+        EXAMPLES::
-+        
-+            sage: from sage.repl.configuration import sage_ipython_config
-+            sage: sage_ipython_config.simple_prompt()
-+            True
-+        """
-+        return 'LightBG' if self._allow_ansi() else 'NoColor'
-+
-+    def simple_prompt(self):
-+        """
-+        Return whether to use the simple prompt
-+
-+        This returns ``True`` during doctests to avoid ANSI escape sequences.
-+
-+        EXAMPLES::
-+        
-+            sage: from sage.repl.configuration import sage_ipython_config
-+            sage: sage_ipython_config.simple_prompt()
-+            True
-+        """
-+        return not self._allow_ansi()
-+
-+    def term_title(self):
-+        """
-+        Return whether to set the terminal title
-+
-+        This returns false during doctests to avoid ANSI escape sequences.
-+
-+        EXAMPLES::
-+        
-+            sage: from sage.repl.configuration import sage_ipython_config
-+            sage: sage_ipython_config.term_title()
-+            False
-+        """
-+        return self._allow_ansi()
-+
-+    def default(self):
-+        """
-+        Return a new default configuration object
-+
-+        EXAMPLES::
-+        
-+            sage: from sage.repl.configuration import sage_ipython_config
-+            sage: sage_ipython_config.default()
-+            {'InteractiveShell': {'colors': ...
-+        """
-+        from sage.repl.interpreter import SageTerminalInteractiveShell
-+        cfg = Config(
-+            TerminalIPythonApp=Config(
-+                display_banner=False,
-+                verbose_crash=True,
-+                test_shell=False,
-+                shell_class=SageTerminalInteractiveShell,
-+            ),
-+            InteractiveShell=Config(
-+                prompts_class=SagePrompts,
-+                ast_node_interactivity='all',
-+                colors=self.colors(),
-+                simple_prompt=self.simple_prompt(),
-+                term_title=self.term_title(),
-+                confirm_exit=False,
-+                separate_in=''
-+            ),
-+            InteractiveShellApp=Config(extensions=[SAGE_EXTENSION]),
-+        )
-+        if self._doctest_mode():
-+            # Using the file-backed history causes problems in parallel tests
-+            cfg.HistoryManager = Config(hist_file=':memory:')
-+        return cfg
-+
-+    def copy(self):
-+        """
-+        Return a copy of the current configuration
-+
-+        EXAMPLES::
-+        
-+            sage: from sage.repl.configuration import sage_ipython_config
-+            sage: sage_ipython_config.copy()
-+            {'InteractiveShell': {'colors': ...
-+        """
-+        try:
-+            return copy.deepcopy(get_ipython().config)
-+        except NameError:
-+            return self.default()
-+
-+
-+sage_ipython_config = SageIpythonConfiguration()
---- a/sage/src/sage/repl/interpreter.py
-+++ b/sage/src/sage/repl/interpreter.py
-@@ -102,18 +102,15 @@
- #*****************************************************************************
- 
- 
--import copy
- import os
- import re
--import sys
- from sage.repl.preparse import preparse
-+from sage.repl.prompts import SagePrompts, InterfacePrompts
- 
--from traitlets.config.loader import Config
- from traitlets import Bool, Type
- 
- from sage.env import SAGE_LOCAL
--
--SAGE_EXTENSION = 'sage'
-+from sage.repl.configuration import sage_ipython_config, SAGE_EXTENSION
- 
- def embedded():
-     """
-@@ -370,31 +367,7 @@
-         rc = super(SageTestShell, self).run_cell(*args, **kwds)
- 
- 
--###################################################################
--# Default configuration
--###################################################################
--
--DEFAULT_SAGE_CONFIG = Config(
--    PromptManager = Config(
--        in_template = 'sage: ',
--        in2_template = '....: ',
--        justify = False,
--        out_template = ''),
--    TerminalIPythonApp = Config(
--        display_banner = False,
--        verbose_crash = True,
--        test_shell = False,
--        shell_class = SageTerminalInteractiveShell,
--    ),
--    InteractiveShell = Config(
--        ast_node_interactivity = 'all',
--        colors = 'LightBG' if sys.stdout.isatty() else 'NoColor',
--        confirm_exit = False,
--        separate_in = ''),
--    InteractiveShellApp = Config(extensions=[SAGE_EXTENSION]),
--)
--
--
-+    
- ###################################################################
- # Transformers used in the SageInputSplitter
- ###################################################################
-@@ -614,19 +587,17 @@
-         sage: shell = interface_shell_embed(gap)
-         sage: shell.run_cell('List( [1..10], IsPrime )')
-         [ false, true, true, false, true, false, true, false, false, false ]
--        <IPython.core.interactiveshell.ExecutionResult object at 0x...>
--    """
--    try:
--        cfg = copy.deepcopy(get_ipython().config)
--    except NameError:
--        cfg = copy.deepcopy(DEFAULT_SAGE_CONFIG)
--    cfg.PromptManager['in_template'] = interface.name() + ': '
--    cfg.PromptManager['in2_template'] = len(interface.name())*'.' + ': '
-+        <repr(<IPython.core.interactiveshell.ExecutionResult at 0x...>) failed: 
-+        AttributeError: type object 'ExecutionResult' has no attribute '__qualname__'>
- 
-+    Note that the repr error is https://github.com/ipython/ipython/issues/9756
-+    """
-+    cfg = sage_ipython_config.copy()
-     ipshell = InteractiveShellEmbed(config=cfg,
-                                     banner1='\n  --> Switching to %s <--\n\n'%interface,
--                                    exit_msg = '\n  --> Exiting back to Sage <--\n')
-+                                    exit_msg='\n  --> Exiting back to Sage <--\n')
-     ipshell.interface = interface
-+    ipshell.prompts = InterfacePrompts(interface.name())
- 
-     while ipshell.prefilter_manager.transformers:
-         ipshell.prefilter_manager.transformers.pop()
-@@ -669,7 +640,7 @@
-         sage: out + err
-         ''
-     """
--    config = copy.deepcopy(DEFAULT_SAGE_CONFIG)
-+    config = sage_ipython_config.default()
-     config.TerminalIPythonApp.test_shell = True
-     config.TerminalIPythonApp.shell_class = SageTestShell
-     app = SageTerminalApp.instance(config=config)
-@@ -748,12 +719,9 @@
-             sage: os.environ['IPYTHONDIR'] = IPYTHONDIR
-         """
-         super(SageTerminalApp, self).load_config_file(*args, **kwds)
--
--        newconfig = copy.deepcopy(DEFAULT_SAGE_CONFIG)
--
-+        newconfig = sage_ipython_config.default()
-         # merge in the config loaded from file
-         newconfig.merge(self.config)
--
-         self.config = newconfig
- 
-     def init_shell(self):
-@@ -767,7 +735,7 @@
- 
-         EXAMPLES::
- 
--            sage: from sage.repl.interpreter import SageTerminalApp, DEFAULT_SAGE_CONFIG
-+            sage: from sage.repl.interpreter import SageTerminalApp
-             sage: app = SageTerminalApp.instance()
-             sage: app.shell
-             <sage.repl.interpreter.SageTestShell object at 0x...>
-@@ -776,7 +744,6 @@
-         self.shell = self.shell_class.instance(
-             parent=self,
-             config=self.config,
--            display_banner=False,
-             profile_dir=self.profile_dir,
-             ipython_dir=self.ipython_dir)
-         self.shell.configurables.append(self)
---- a/sage/src/sage/repl/ipython_tests.py
-+++ b/sage/src/sage/repl/ipython_tests.py
-@@ -100,6 +100,12 @@
-     ...
-     File:   .../sage/tests/stl_vector.pyx
-     Type:   type
-+
-+Test that there are no warnings being ignored internally::
-+
-+    sage: import warnings
-+    sage: warnings.simplefilter('error');  get_test_shell()
-+    <sage.repl.interpreter.SageTestShell object at 0x...>
- '''
- 
- 
---- /dev/null
-+++ b/sage/src/sage/repl/prompts.py
-@@ -0,0 +1,92 @@
-+r"""
-+Sage Commandline Prompts
-+"""
-+
-+#*****************************************************************************
-+#       Copyright (C) 2016 Volker Braun <vbraun.name at gmail.com>
-+#
-+# This program is free software: you can redistribute it and/or modify
-+# it under the terms of the GNU General Public License as published by
-+# the Free Software Foundation, either version 2 of the License, or
-+# (at your option) any later version.
-+#                  http://www.gnu.org/licenses/
-+#*****************************************************************************
-+
-+from pygments.token import Token
-+from IPython.terminal.prompts import Prompts
-+
-+
-+class SagePrompts(Prompts):
-+
-+    def in_prompt_tokens(self, cli=None):
-+        return [
-+            (Token.Prompt, 'sage: '),
-+        ]
-+
-+    def continuation_prompt_tokens(self, cli=None, width=None):
-+        return [
-+            (Token.Prompt, '....: '),
-+        ]
-+
-+    def rewrite_prompt_tokens(self):
-+        return [
-+            (Token.Prompt, '----> '),
-+        ]
-+
-+    def out_prompt_tokens(self):
-+        return [
-+            (Token.OutPrompt, ''),
-+        ]
-+
-+    
-+class InterfacePrompts(Prompts):
-+
-+    def __init__(self, interface_name):
-+        self.__name = interface_name
-+        self.__width = len(interface_name)
-+    
-+    def in_prompt_tokens(self, cli=None):
-+        return [
-+            (Token.Prompt, self.__name + ': '),
-+        ]
-+
-+    def continuation_prompt_tokens(self, cli=None, width=None):
-+        return [
-+            (Token.Prompt, '.' * self.__width + ': '),
-+        ]
-+
-+    def rewrite_prompt_tokens(self):
-+        return [
-+            (Token.Prompt, '-' * self.__width + '> '),
-+        ]
-+
-+    def out_prompt_tokens(self):
-+        return [
-+            (Token.OutPrompt, ''),
-+        ]
-+
-+
-+class DebugPrompts(Prompts):
-+
-+    def in_prompt_tokens(self, cli=None):
-+        return [
-+            (Token.Prompt, 'debug: '),
-+        ]
-+
-+    def continuation_prompt_tokens(self, cli=None, width=None):
-+        return [
-+            (Token.Prompt, '.....: '),
-+        ]
-+
-+    def rewrite_prompt_tokens(self):
-+        return [
-+            (Token.Prompt, '-----> '),
-+        ]
-+
-+    def out_prompt_tokens(self):
-+        return [
-+            (Token.OutPrompt, ''),
-+        ]
-+
-+    
-+    
---- a/sage/src/sage/tests/cmdline.py
-+++ b/sage/src/sage/tests/cmdline.py
-@@ -385,7 +385,7 @@
-         **********************************************************************
-         Previously executed commands:
-             s...: assert True == False
--        debug:
-+        In [1]:
-         <BLANKLINE>
-         Returning to doctests...
-         **********************************************************************
diff --git a/debian/patches/version-linbox-1.4.patch b/debian/patches/version-linbox-1.4.patch
deleted file mode 100644
index 80472da..0000000
--- a/debian/patches/version-linbox-1.4.patch
+++ /dev/null
@@ -1,455 +0,0 @@
-Description: Necessary changes to work with linbox 1.4.
-Origin: https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/sagemath
-
---- a/sage/src/module_list.py
-+++ b/sage/src/module_list.py
-@@ -27,6 +27,18 @@
- lapack_library_dirs = list(lapack_pc['library_dirs'])
- lapack_include_dirs = list(lapack_pc['include_dirs'])
- 
-+# FFLAS-FFPACK
-+fflas_ffpack_pc = pkgconfig.parse('fflas-ffpack')
-+fflas_ffpack_libs = list(fflas_ffpack_pc['libraries'])
-+fflas_ffpack_library_dirs = list(fflas_ffpack_pc['library_dirs'])
-+fflas_ffpack_cflags = pkgconfig.cflags('fflas-ffpack').split()
-+
-+# Givaro
-+givaro_pc = pkgconfig.parse('givaro')
-+givaro_libs = list(givaro_pc['libraries'])
-+givaro_library_dirs = list(givaro_pc['library_dirs'])
-+givaro_cflags = pkgconfig.cflags('givaro').split()
-+
- # GNU Scientific Library
- # Note we replace the built-in gslcblas with the above cblas
- gsl_pc = pkgconfig.parse('gsl')
-@@ -40,6 +52,12 @@
- gd_library_dirs = list(gd_pc['library_dirs'])
- gd_include_dirs = list(gd_pc['include_dirs'])
- 
-+# LinBox
-+linbox_pc = pkgconfig.parse('linbox')
-+linbox_libs = list(linbox_pc['libraries'])
-+linbox_library_dirs = list(linbox_pc['library_dirs'])
-+linbox_cflags = pkgconfig.cflags('linbox').split()
-+
- # PNG image library
- png_pc = pkgconfig.parse('libpng')
- png_libs = list(png_pc['libraries'])
-@@ -58,9 +76,18 @@
- #########################################################
- 
- aliases = dict(
-+    FFLASFFPACK_CFLAGS=fflas_ffpack_cflags,
-+    FFLASFFPACK_LIBRARIES=fflas_ffpack_libs,
-+    FFLASFFPACK_LIBDIR=fflas_ffpack_library_dirs,
-+    GIVARO_CFLAGS=givaro_cflags,
-+    GIVARO_LIBRARIES=givaro_libs,
-+    GIVARO_LIBDIR=givaro_library_dirs,
-     GSL_LIBRARIES=gsl_libs,
-     GSL_LIBDIR=gsl_library_dirs,
-     GSL_INCDIR=gsl_include_dirs,
-+    LINBOX_CFLAGS=linbox_cflags,
-+    LINBOX_LIBRARIES=linbox_libs,
-+    LINBOX_LIBDIR=linbox_library_dirs,
- )
- 
- #########################################################
-@@ -91,12 +118,6 @@
- singular_libs = ['singular', 'flint', 'ntl', 'gmpxx', 'gmp', 'readline', 'm']
- 
- #########################################################
--### Givaro flags
--#########################################################
--
--givaro_extra_compile_args =['-D__STDC_LIMIT_MACROS']
--
--#########################################################
- ### Library order
- #########################################################
- 
-@@ -111,8 +132,7 @@
- # at the very end of the list.
- library_order_list = [
-     "singular", "ec", "ecm",
--    "linboxsage", "ntl", "iml", "linbox", "givaro",
--] + gsl_libs + [
-+] + linbox_libs  + gsl_libs + [
-     "pari", "flint", "ratpoints", "ecl", "glpk", "ppl",
-     "arb", "fplll", "mpfi", "mpfr", "mpc", "gmp", "gmpxx",
-     "brial",
-@@ -611,13 +631,10 @@
- 
-     Extension('sage.libs.linbox.linbox',
-               sources = ['sage/libs/linbox/linbox.pyx'],
--              libraries = ['linboxsage', 'ntl', 'iml', 'linbox',
--                           'givaro', 'mpfr', 'gmp', 'gmpxx'] + cblas_libs,
-+              libraries = linbox_libs,
-               language = 'c++',
-               library_dirs = cblas_library_dirs,
--              include_dirs = cblas_include_dirs,
--              extra_compile_args = givaro_extra_compile_args,
--              depends = [os.path.join(SAGE_INC, 'givaro', 'givconfig.h')]),
-+              include_dirs = cblas_include_dirs),
- 
-     Extension('sage.libs.lcalc.lcalc_Lfunction',
-               sources = ['sage/libs/lcalc/lcalc_Lfunction.pyx'],
-@@ -665,9 +682,8 @@
- 
-     Extension('sage.libs.singular.singular',
-               sources = ['sage/libs/singular/singular.pyx'],
--              libraries = ['givaro'] + singular_libs,
--              language="c++",
--              extra_compile_args = givaro_extra_compile_args),
-+              libraries = singular_libs,
-+              language="c++"),
- 
-     Extension('sage.libs.singular.polynomial',
-               sources = ['sage/libs/singular/polynomial.pyx'],
-@@ -687,8 +703,7 @@
-     Extension('sage.libs.singular.function',
-               sources = ['sage/libs/singular/function.pyx'],
-               libraries = singular_libs,
--              language="c++",
--              extra_compile_args = givaro_extra_compile_args),
-+              language="c++"),
- 
-     Extension('sage.libs.singular.option',
-               sources = ['sage/libs/singular/option.pyx'],
-@@ -944,19 +959,17 @@
-     Extension('sage.matrix.matrix_modn_dense_float',
-               sources = ['sage/matrix/matrix_modn_dense_float.pyx'],
-               language="c++",
--              libraries = ['ntl', 'linbox', 'givaro', 'mpfr', 'gmpxx', 'gmp'] + cblas_libs,
-+              libraries = linbox_libs + cblas_libs,
-               library_dirs = cblas_library_dirs,
--              include_dirs = cblas_include_dirs,
--              extra_compile_args = nocxx11_args + ['-DDISABLE_COMMENTATOR'] + givaro_extra_compile_args),
-+              include_dirs = cblas_include_dirs),
- 
-     Extension('sage.matrix.matrix_modn_dense_double',
-               sources = ['sage/matrix/matrix_modn_dense_double.pyx'],
-               language="c++",
--              libraries = ['ntl', 'linbox', 'givaro', 'mpfr', 'gmpxx', 'gmp'] + cblas_libs,
-+              libraries = linbox_libs + cblas_libs,
-               library_dirs = cblas_library_dirs,
-               include_dirs = cblas_include_dirs,
--              extra_compile_args = nocxx11_args + ["-D_XPG6", "-DDISABLE_COMMENTATOR"]
--                    + m4ri_extra_compile_args + givaro_extra_compile_args),
-+              extra_compile_args = ["-D_XPG6"]),
- 
-     Extension('sage.matrix.matrix_modn_sparse',
-               sources = ['sage/matrix/matrix_modn_sparse.pyx']),
-@@ -1400,8 +1413,7 @@
-     Extension('sage.rings.finite_rings.element_givaro',
-               sources = ["sage/rings/finite_rings/element_givaro.pyx"],
-               libraries = ['givaro', 'ntl', 'gmpxx', 'gmp', 'm'],
--              language='c++',
--              extra_compile_args = givaro_extra_compile_args),
-+              language='c++'),
- 
-     Extension('sage.rings.finite_rings.element_ntl_gf2e',
-               sources = ['sage/rings/finite_rings/element_ntl_gf2e.pyx'],
-@@ -1421,8 +1433,7 @@
-               sources = ["sage/rings/finite_rings/hom_finite_field_givaro.pyx"],
-               # this order is needed to compile under windows.
-               libraries = ['givaro', 'ntl', 'gmpxx', 'gmp', 'm'],
--              language='c++',
--              extra_compile_args = givaro_extra_compile_args),
-+              language='c++'),
- 
-     ################################
-     ##
-@@ -1574,8 +1585,7 @@
-     Extension('sage.rings.polynomial.plural',
-               sources = ['sage/rings/polynomial/plural.pyx'],
-               libraries = ['m', 'readline', 'singular', 'givaro', 'gmpxx', 'gmp'],
--              language="c++",
--              extra_compile_args = givaro_extra_compile_args),
-+              language="c++"),
- 
-     Extension('sage.rings.polynomial.multi_polynomial_libsingular',
-               sources = ['sage/rings/polynomial/multi_polynomial_libsingular.pyx'],
---- a/sage/src/sage/libs/linbox/echelonform.pxd
-+++ b/sage/src/sage/libs/linbox/echelonform.pxd
-@@ -1,23 +1,27 @@
-+# distutils: extra_compile_args = LINBOX_CFLAGS
-+# distutils: libraries = LINBOX_LIBRARIES
-+# distutils: library_dirs = LINBOX_LIBDIR
-+
- from sage.libs.linbox.modular cimport ModDoubleField, ModDoubleFieldElement, ModFloatField, ModFloatFieldElement
- from libc.stdint cimport uint64_t
- 
--cdef extern from "linbox/matrix/blas-matrix.h" namespace "LinBox":
--    cdef cppclass BlasMatrixDouble "LinBox::BlasMatrix<LinBox::Modular<double> >":
-+cdef extern from "linbox/matrix/dense-matrix.h" namespace "LinBox":
-+    cdef cppclass BlasMatrixDouble "LinBox::DenseMatrix<Givaro::Modular<double> >":
-         BlasMatrixDouble(ModDoubleField F, uint64_t nrows, uint64_t ncols)
-         void setEntry(size_t i, size_t j, ModDoubleFieldElement t)
-         ModDoubleFieldElement &getEntry(size_t i, size_t j)
- 
--    cdef cppclass BlasMatrixFloat "LinBox::BlasMatrix<LinBox::Modular<float> >":
-+    cdef cppclass BlasMatrixFloat "LinBox::DenseMatrix<Givaro::Modular<float> >":
-         BlasMatrixFloat(ModFloatField F, uint64_t nrows, uint64_t ncols)
-         void setEntry(size_t i, size_t j, ModFloatFieldElement t)
-         ModFloatFieldElement &getEntry(size_t i, size_t j)
- 
- cdef extern from "linbox/algorithms/echelon-form.h":
--    cdef cppclass EchelonFormDomainDouble "LinBox::EchelonFormDomain<LinBox::Modular<double> >":
-+    cdef cppclass EchelonFormDomainDouble "LinBox::EchelonFormDomain<Givaro::Modular<double> >":
-         EchelonFormDomainDouble(ModDoubleField)
-         int rowReducedEchelon(BlasMatrixDouble, BlasMatrixDouble)
- 
--    cdef cppclass EchelonFormDomainFloat "LinBox::EchelonFormDomain<LinBox::Modular<float> >":
-+    cdef cppclass EchelonFormDomainFloat "LinBox::EchelonFormDomain<Givaro::Modular<float> >":
-         EchelonFormDomainFloat(ModFloatField)
-         int rowReducedEchelon(BlasMatrixFloat, BlasMatrixFloat)
- 
---- a/sage/src/sage/libs/linbox/fflas.pxd
-+++ b/sage/src/sage/libs/linbox/fflas.pxd
-@@ -1,3 +1,7 @@
-+# distutils: extra_compile_args = FFLASFFPACK_CFLAGS
-+# distutils: libraries = FFLASFFPACK_LIBRARIES
-+# distutils: library_dirs = FFLASFFPACK_LIBDIR
-+
- from .modular cimport ModDoubleField, ModFloatField, ModDoubleFieldElement, ModFloatFieldElement
- 
- cdef extern from "fflas-ffpack/fflas-ffpack.h" namespace "std":
---- a/sage/src/sage/libs/linbox/linbox.pyx
-+++ b/sage/src/sage/libs/linbox/linbox.pyx
-@@ -1,3 +1,7 @@
-+# distutils: extra_compile_args = LINBOX_CFLAGS
-+# distutils: libraries = LINBOX_LIBRARIES
-+# distutils: library_dirs = LINBOX_LIBDIR
-+
- r"""
- Linbox interface
- """
---- a/sage/src/sage/libs/linbox/modular.pxd
-+++ b/sage/src/sage/libs/linbox/modular.pxd
-@@ -1,10 +1,10 @@
--cdef extern from "linbox/field/modular.h":
-+cdef extern from "givaro/modular.h":
-     # double
- 
--    cdef cppclass ModDoubleFieldElement "LinBox::Modular<double>::Element":
-+    cdef cppclass ModDoubleFieldElement "Givaro::Modular<double>::Element":
-         pass
- 
--    cdef cppclass ModDoubleField "LinBox::Modular<double>":
-+    cdef cppclass ModDoubleField "Givaro::Modular<double>":
-         ModDoubleField(int modulus)
-         ModDoubleFieldElement init(ModDoubleFieldElement res, int v)
-         ModDoubleFieldElement init(ModDoubleFieldElement res, double v)
-@@ -20,10 +20,10 @@
- 
- 
-     # float
--    cdef cppclass ModFloatFieldElement "LinBox::Modular<float>::Element":
-+    cdef cppclass ModFloatFieldElement "Givaro::Modular<float>::Element":
-         pass
- 
--    cdef cppclass ModFloatField "LinBox::Modular<float>":
-+    cdef cppclass ModFloatField "Givaro::Modular<float>":
-         ModFloatField(int modulus)
-         ModFloatFieldElement init(ModFloatFieldElement res, int v)
-         ModFloatFieldElement init(ModFloatFieldElement res, double v)
---- a/sage/src/sage/libs/singular/singular.pyx
-+++ b/sage/src/sage/libs/singular/singular.pyx
-@@ -23,6 +23,7 @@
- 
- import os
- 
-+from libc.stdint cimport int64_t
- from sage.libs.singular.decl cimport intvec
- from sage.libs.singular.decl cimport SR_HDL, SR_INT, SR_TO_INT
- from sage.libs.singular.decl cimport singular_options, singular_verbose_options
-@@ -156,7 +157,7 @@
-     order = cache.objectptr.cardinality() - 1
- 
-     while z:
--        c = cache.objectptr.initi(c, <long>napGetCoeff(z))
-+        c = cache.objectptr.initi(c, <int64_t>napGetCoeff(z))
-         e = napGetExpFrom(z,1, _ring)
-         if e == 0:
-             ret = cache.objectptr.add(ret, c, ret)
---- a/sage/src/sage/rings/finite_rings/element_givaro.pxd
-+++ b/sage/src/sage/rings/finite_rings/element_givaro.pxd
-@@ -1,9 +1,15 @@
--from sage.structure.element cimport Element, RingElement, ModuleElement
--from sage.rings.finite_rings.element_base cimport FinitePolyExtElement
-+# distutils: extra_compile_args = GIVARO_CFLAGS
-+
-+from libcpp.vector cimport vector
-+ctypedef vector[int] intvec
-+
-+from libc.stdint cimport int64_t
- 
--from sage.structure.parent  cimport Parent
-+from sage.rings.finite_rings.element_base cimport FinitePolyExtElement
-+from sage.structure.parent cimport Parent
- from sage.structure.sage_object cimport SageObject
- 
-+
- cdef extern from "givaro/givconfig.h":
-     pass
- 
-@@ -13,16 +19,7 @@
- 
-     GivRandom GivRandomSeeded  "Givaro::GivRandom"(unsigned long seed)
- 
--cdef extern from "givaro/givgfq.h":
--    ctypedef struct intvec "std::vector<unsigned int>":
--        void (* push_back)(int elem)
--
--    ctypedef struct constintvec "const std::vector<unsigned int>"
--
--    intvec intvec_factory "std::vector<unsigned int>"(int len)
--
--cdef extern from "givaro/givgfq.h":
--
-+cdef extern from "givaro/gfq.h":
-     ctypedef struct GivaroGfq "Givaro::GFqDom<int>":
-         #attributes
-         unsigned int one
-@@ -40,10 +37,10 @@
-         unsigned int (* cardinality)()
-         int (* exponent)()
-         int (* random)(GivRandom gen, int res)
--        int (* initi "init")(int res, int e)
-+        int (* initi "init")(int res, int64_t e)
-         int (* initd "init")(int res, double e)
-         int (* indeterminate)()
--        int (* convert)(int r, int p)
-+        int (* convert)(int64_t r, int p)
-         int (* read)(int r, int p)
-         int (* axpyin)(int r, int a, int x)
-         int (* axpy)(int r, int a, int b, int c)
-@@ -60,7 +57,12 @@
-     void delete "delete "(void *o)
-     int gfq_element_factory "Givaro::GFqDom<int>::Element"()
- 
--cdef class FiniteField_givaroElement(FinitePolyExtElement) #forward declaration
-+
-+cdef class FiniteField_givaroElement(FinitePolyExtElement):
-+    cdef int element
-+    cdef Cache_givaro _cache
-+    cdef object _multiplicative_order
-+    cdef FiniteField_givaroElement _new_c(self, int value)
- 
- cdef class Cache_givaro(SageObject):
-     cdef GivaroGfq *objectptr # C++ object
-@@ -85,11 +87,4 @@
-     cdef int iterator
-     cdef Cache_givaro _cache
- 
--cdef class FiniteField_givaroElement(FinitePolyExtElement):
--    cdef int element
--    cdef Cache_givaro _cache
--    cdef object _multiplicative_order
--    cdef FiniteField_givaroElement _new_c(self, int value)
--
--
- cdef inline FiniteField_givaroElement make_FiniteField_givaroElement(Cache_givaro cache, int x)
---- a/sage/src/sage/rings/finite_rings/element_givaro.pyx
-+++ b/sage/src/sage/rings/finite_rings/element_givaro.pyx
-@@ -59,8 +59,9 @@
- from sage.rings.finite_rings.finite_field_base cimport FiniteField
- from sage.rings.ring cimport Ring
- from element_ext_pari import FiniteField_ext_pariElement
--from element_pari_ffelt import FiniteFieldElement_pari_ffelt
-+from element_pari_ffelt cimport FiniteFieldElement_pari_ffelt
- from sage.structure.sage_object cimport SageObject
-+from sage.structure.element cimport Element, ModuleElement, RingElement
- import operator
- import sage.arith.all
- import finite_field_constructor as finite_field
-@@ -374,18 +375,16 @@
-         elif isinstance(e, int) or \
-              isinstance(e, Integer) or \
-              isinstance(e, long) or is_IntegerMod(e):
--            try:
--                e_int = e
--            except OverflowError:
--                e_int = e % self.characteristic()
-+            e_int = e % self.characteristic()
-             res = self.objectptr.initi(res, e_int)
- 
-         elif e is None:
-             e_int = 0
--            res = self.objectptr.initi(res,e_int)
-+            res = self.objectptr.initi(res, e_int)
- 
-         elif isinstance(e, float):
--            res = self.objectptr.initd(res,e)
-+            e_int = int(e) % self.characteristic()
-+            res = self.objectptr.initd(res, e_int)
- 
-         elif isinstance(e, str):
-             return self.parent(eval(e.replace("^","**"),self.parent.gens_dict()))
-@@ -395,8 +394,8 @@
-                 raise TypeError("e.parent must match self.vector_space")
-             ret = self._zero_element
-             for i in range(len(e)):
--                e_entry = e[i] % self.characteristic()
--                res = self.objectptr.initi(res, int(e_entry))
-+                e_int = e[i] % self.characteristic()
-+                res = self.objectptr.initi(res, e_int)
-                 to_add = make_FiniteField_givaroElement(self, res)
-                 ret = ret + to_add*self.parent.gen()**i
-             return ret
-@@ -435,8 +434,8 @@
-                 raise ValueError("list is too long")
-             ret = self._zero_element
-             for i in range(len(e)):
--                e_entry = e[i] % self.characteristic()
--                res = self.objectptr.initi(res, int(e_entry))
-+                e_int = e[i] % self.characteristic()
-+                res = self.objectptr.initi(res, e_int)
-                 to_add = make_FiniteField_givaroElement(self, res)
-                 ret = ret + to_add*self.parent.gen()**i
-             return ret
-@@ -573,19 +572,17 @@
-         cdef int ret = k.zero
-         cdef int a = k.indeterminate()
-         cdef int at = k.one
--        cdef unsigned int ch = k.characteristic()
--        cdef int _n, t, i
-+        cdef int ch = k.characteristic()
-+        cdef int t, i
- 
-         if n<0 or n>k.cardinality():
-             raise TypeError("n must be between 0 and self.order()")
- 
--        _n = n
--
-         for i from 0 <= i < k.exponent():
--            t = k.initi(t, _n%ch)
-+            t = k.initi(t, n % ch)
-             ret = k.axpy(ret, t, at, ret)
-             at = k.mul(at,at,a)
--            _n = _n/ch
-+            n //= ch
-         return make_FiniteField_givaroElement(self, ret)
- 
-     def _element_repr(self, FiniteField_givaroElement e):
---- a/sage/src/sage/rings/finite_rings/finite_field_givaro.py
-+++ b/sage/src/sage/rings/finite_rings/finite_field_givaro.py
-@@ -270,7 +270,8 @@
-             sage: k(2) # indirect doctest
-             0
- 
--            Floats coerce in:
-+        Floats are converted like integers::
-+
-             sage: k(float(2.0))
-             0
- 
-@@ -344,7 +345,7 @@
-             sage: k(pari('Mod(1,2)'))
-             1
-             sage: k(pari('Mod(2,3)'))
--            0
-+            a
-             sage: k(pari('Mod(1,3)*a^20'))
-             a^7 + a^5 + a^4 + a^2
- 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/sagemath.git



More information about the debian-science-commits mailing list