Ticket #13770: singular-3-1-5.p9.diff

File singular-3-1-5.p9.diff, 25.6 KB (added by jdemeyer, 8 years ago)
  • .hgignore

    # HG changeset patch
    # User Jeroen Demeyer <jdemeyer@cage.ugent.be>
    # Date 1377525255 -7200
    # Node ID 271f6f11713ad23d4a35ddebdd6961369c3030b4
    # Parent  dc7fdc440e65d5b1aa6806b2872500cd765e9588
    Trac #13770: Add upstream pull request 215 for multivariate factorisation
    
    diff --git a/.hgignore b/.hgignore
    a b  
    1 ^src/
    2 
     1^src/latest
     2^src/shared
  • SPKG.txt

    diff --git a/SPKG.txt b/SPKG.txt
    a b  
    4545   http://www.singular.uni-kl.de:8002/trac/ticket/441
    4646 * singular_trac_443.patch: fix taken from upstream for
    4747   http://www.singular.uni-kl.de:8002/trac/ticket/443
    48  * sage_trac_12089.patch: fix (also reported upstream) from 
    49    https://github.com/alexanderdreyer/SingularSources/commit/7902222 
     48 * sage_trac_12089.patch: fix (also reported upstream) from
     49   https://github.com/alexanderdreyer/SingularSources/commit/7902222
    5050 * slibdir.patch: set default slibdir to ${datarootdir}/singular
    5151   instead of ${prefix}/LIB, see #13344.
    5252 * singular_15435.patch: Backport of
     
    6464 * osx_link.patch: #14415: Fixes linker problems on OS X PPC.
    6565 * sanitize_gmp_header_hack.patch:
    6666   Fix and simplify generation of `factory/cf_gmp.h` (cf. #14737).
    67    
    68 Other notes
    69  * The option '--without-dynamic-kernel' is used on *all*
    70    systems with the exception of Linux. The online README at
     67 * pullrequest215.patch: Backport of first 3 patches from
     68   https://github.com/Singular/Sources/pull/215
     69
     70Other notes
     71 * The option '--without-dynamic-kernel' is used on *all*
     72   systems with the exception of Linux. The online README at
    7173   http://www.singular.uni-kl.de/svn/trunk/README says this should
    7274   be used on Solaris, with no mention of it being necessary for
    73    OS X, or any other platform except Solaris. 
     75   OS X, or any other platform except Solaris.
    7476 * The online readme says that CONFIG_SHELL should be set to /bin/bash
    7577   on Solaris. This is not done currently. Since this does not build
    76    fully as a 64-bit application on Solaris, CONFIG_SHELL should be 
    77    investigated as a possible cause later. 
     78   fully as a 64-bit application on Solaris, CONFIG_SHELL should be
     79   investigated as a possible cause later.
    7880 * Be sure that Singular/Singular.rc.in is present, as occasionally this
    7981   was missing, which caused problems on Cygwin (e.g., see #10235)
    8082 * Due to http://www.singular.uni-kl.de:8002/trac/ticket/438, we
     
    9193
    9294== ChangeLog ==
    9395
     96=== singular-3-1-5.p9 (Paul Zimmermann, Jeroen Demeyer, 26 August 2013) ===
     97 * #13770: Add upstream pull request 215 for multivariate factorisation.
     98 * spkg-install: split apply_patches step in 2 steps: choose_patches and
     99   apply_patches; add a few small fixes.
     100 * Remove install-sh which is no longer needed.
     101
    94102=== singular-3-1-5.p8 (Leif Leonhardy, Volker Braun, 10 July 2013) ===
    95103 * #14737: Fix and simplify generation of `factory/cf_gmp.h`
    96104   (by adding `patches/sanitize_gmp_header_hack.patch`).
     
    124132 * Trac #13731
    125133 * Optionally replace omalloc with xalloc (a thin compatibility layer
    126134   on top of malloc) so that debugging of memory corruptions becomes
    127    easier. 
     135   easier.
    128136 * Include two upstream fixes for memory corruptions.
    129137
    130138=== singular-3-1-5.p1 (Simon King, 29 August 2012) ===
     
    301309
    302310=== singular-3.1.0.4.p8  (David Kirkby, 30th June 2010) ===
    303311 * #9397 "Resolve corrupted patches to permit Singular to build on Solaris x86/x64"
    304    A previous patch made to add a Singular target x86-SunOS has been overwritten 
     312   A previous patch made to add a Singular target x86-SunOS has been overwritten
    305313   by a later patch. I resolved these two issues, so the patch contained both changes
    306    A patch file, and a diff made from it were removed, so the patches directory has two 
    307    less files than before. 
    308  * #9397 Set CC="$CC -m64" and CXX="$CXX-m64" to force the -m64 flag to fully propogate 
    309    thoughtout the Singular build process - otherwise it fails to do so. Setting 
    310    CFALGS/CXXFLAGS is insufficient. 
    311  
     314   A patch file, and a diff made from it were removed, so the patches directory has two
     315   less files than before.
     316 * #9397 Set CC="$CC -m64" and CXX="$CXX-m64" to force the -m64 flag to fully propogate
     317   thoughtout the Singular build process - otherwise it fails to do so. Setting
     318   CFALGS/CXXFLAGS is insufficient.
     319
    312320=== singular-3.1.0.4.p7  (Mitesh Patel, 8th June 2010) ===
    313321 * #9185: Set an empty MAKEFLAGS variable before "make".  On OS X, at
    314322   least, this fixes building multiple spkgs in parallel (cf. #8306).
    315323
    316324=== singular-3.1.0.4.p6  (David Kirkby and Willem Jan Palenstijn, 6th June 2010) ===
    317  * All changes relate to ticket #9160 
    318  * Added sections to SPKG.txt which the Sage Developers Guide should be 
    319    present, but were not. These include Description, License, 
    320    PKG Maintainers, Upstream Contact, Dependencies and 
    321    Special Update/Build Instructions. 
    322  * Added a couple of comments in the new "Special Update/Build 
    323    Instructions" section about Solaris and the use of 
    324    --without-dynamic-kernel option and CONFIG_SHELL. 
    325  * Changed the name of package to singular-$version.$patchversion, 
    326    as is common Sage practice, and not have a date of any 
     325 * All changes relate to ticket #9160
     326 * Added sections to SPKG.txt which the Sage Developers Guide should be
     327   present, but were not. These include Description, License,
     328   PKG Maintainers, Upstream Contact, Dependencies and
     329   Special Update/Build Instructions.
     330 * Added a couple of comments in the new "Special Update/Build
     331   Instructions" section about Solaris and the use of
     332   --without-dynamic-kernel option and CONFIG_SHELL.
     333 * Changed the name of package to singular-$version.$patchversion,
     334   as is common Sage practice, and not have a date of any
    327335   update. Since this should be patch level 6, I've called it that.
    328336 * Touched the file src/Singular/libparse.cc
    329337   (Willem Jan Palenstijn)
    330  * Touched the file src/factory/configure   
     338 * Touched the file src/factory/configure
    331339 * Removed the restriction that the OS needs to be OS X before
    332340   a 64-bit build is attempted. (This still does not fully build
    333341   64-bit on OpenSolaris, though it is closer to doing so.)
    334  * Move code associated with SAGE64 outside of the code for debugging. 
    335  * Ensured $SAGE_LOCAL/include is the first CPPFLAG, so the 
     342 * Move code associated with SAGE64 outside of the code for debugging.
     343 * Ensured $SAGE_LOCAL/include is the first CPPFLAG, so the
    336344   Sage include files are included before others.
    337  * Removed code which attempted to disable the dynamic kernel on 
     345 * Removed code which attempted to disable the dynamic kernel on
    338346   OS X in 64-bit mode, since the dynamic kernel was already disabled
    339    on all platforms except Linux. It was pointless doing it twice. 
     347   on all platforms except Linux. It was pointless doing it twice.
    340348
    341349=== singular-3-1-0-4-20100214 (William Stein, February 14, 2010) ===
    342350 * patch for Cygwin (trac 7338)
     
    354362 * added three missing /patches/*.diff files
    355363 * change -O2 to -O0 on ia64 (see trac #6360 and #6240),
    356364   original change: singular-3-1-0-2-20090618 (Craig Citro, June 18th, 2009)
    357  * Make a copy of install-sh and put in the same directory as spkg-install, 
    358    SPKG.txt etc. For some reason, I believe one of the makefiles is looking 
    359    in the wrong directory for install-sh. There are about 5 identical copies 
     365 * Make a copy of install-sh and put in the same directory as spkg-install,
     366   SPKG.txt etc. For some reason, I believe one of the makefiles is looking
     367   in the wrong directory for install-sh. There are about 5 identical copies
    360368   of this in the source. I'm not sure why there needs to be so many, and why
    361    even with 5 or so copile, one can't be found. 
     369   even with 5 or so copile, one can't be found.
    362370   Original change: singular-3-1-0-2-20090620.p0 (David Kirkby, July 19th, 2009)
    363371 * (don't include singular-3-1-0-2-20090620 patch, since no longer necessary:
    364372    Andrzej Giniewicz' fix GCC 4.4 compilation problem)
     
    382390=== singular-3-0-4-4-20080711.p4 (Michael Abshoff, January 23rd, 2009) ===
    383391 * Integrate two patches by Georg Weber (#4181 and #5344)
    384392 * update SPKG.txt
    385  * delete MacOSX junk added in singular-3-0-4-4-20080711.p3 
     393 * delete MacOSX junk added in singular-3-0-4-4-20080711.p3
    386394
    387395=== singular-3-0-4-4-20080711.p3 (Michael Abshoff, January 20th, 2009) ===
    388396 * use "--with-malloc=system" for 64 bit OSX
     
    392400 * delete old singular headers in $SAGE_LOCAL/include/singular
    393401
    394402=== singular-3-0-4-4-20080711.p1 (Michael Abshoff, September 1st, 2008) ===
    395  * Fix three Solaris issues: libsingular build options, tail POSIX issue and install missing on Solaris 
    396  
     403 * Fix three Solaris issues: libsingular build options, tail POSIX issue and install missing on Solaris
     404
    397405=== singular-3-0-4-4-20080711.p0 (Michael Abshoff, August 19th, 2008) ===
    398406 * add 64 bit OSX support
    399407 * Fix mv-factoprization bug reported by Tom Boothby
     
    454462   you move the install directory.
    455463
    456464* Martin Albrecht -- add fix to libcf:
    457 Yes, It's a (new?) bug in libcf I've fixed just yesterday but got no word from 
    458 the Singular people yet. They free a char ptr they are not supposed to free 
    459 if I understand the ostrstring docs correctly. I've attached the 
    460 one-line-fixed int_poly.cc which belongs in the factory subdirectory of 
     465Yes, It's a (new?) bug in libcf I've fixed just yesterday but got no word from
     466the Singular people yet. They free a char ptr they are not supposed to free
     467if I understand the ostrstring docs correctly. I've attached the
     468one-line-fixed int_poly.cc which belongs in the factory subdirectory of
    461469Singular.
    462470
    463471 * Martin Albrecht -- 2006-09-17:
    464472This looks to me as if I didn't remove all references to boost:
    465473/usr/include/boost/dynamic_bitset/dynamic_bitset.hpp:1098: error: exception
    466 I've attached an updated configure.in and configure (created with autoconf 
    467 2.60) with Boost checks disabled which should fix the problem. These belong 
     474I've attached an updated configure.in and configure (created with autoconf
     4752.60) with Boost checks disabled which should fix the problem. These belong
    468476in the Singular subdirectory:
    469477   singular-3-0-2-2006-09-09/Singular
  • deleted file install-sh

    diff --git a/install-sh b/install-sh
    deleted file mode 100755
    + -  
    1 #!/bin/sh
    2 #
    3 # install - install a program, script, or datafile
    4 # This comes from X11R5.
    5 #
    6 # Calling this script install-sh is preferred over install.sh, to prevent
    7 # `make' implicit rules from creating a file called install from it
    8 # when there is no Makefile.
    9 #
    10 # This script is compatible with the BSD install script, but was written
    11 # from scratch.
    12 #
    13 
    14 
    15 # set DOITPROG to echo to test this script
    16 
    17 # Don't use :- since 4.3BSD and earlier shells don't like it.
    18 doit="${DOITPROG-}"
    19 
    20 
    21 # put in absolute paths if you don't have them in your path; or use env. vars.
    22 
    23 mvprog="${MVPROG-mv}"
    24 cpprog="${CPPROG-cp}"
    25 chmodprog="${CHMODPROG-chmod}"
    26 chownprog="${CHOWNPROG-chown}"
    27 chgrpprog="${CHGRPPROG-chgrp}"
    28 stripprog="${STRIPPROG-strip}"
    29 rmprog="${RMPROG-rm}"
    30 mkdirprog="${MKDIRPROG-mkdir}"
    31 
    32 tranformbasename=""
    33 transform_arg=""
    34 instcmd="$mvprog"
    35 chmodcmd="$chmodprog 0755"
    36 chowncmd=""
    37 chgrpcmd=""
    38 stripcmd=""
    39 rmcmd="$rmprog -f"
    40 mvcmd="$mvprog"
    41 src=""
    42 dst=""
    43 dir_arg=""
    44 
    45 while [ x"$1" != x ]; do
    46     case $1 in
    47         -c) instcmd="$cpprog"
    48             shift
    49             continue;;
    50 
    51         -d) dir_arg=true
    52             shift
    53             continue;;
    54 
    55         -m) chmodcmd="$chmodprog $2"
    56             shift
    57             shift
    58             continue;;
    59 
    60         -o) chowncmd="$chownprog $2"
    61             shift
    62             shift
    63             continue;;
    64 
    65         -g) chgrpcmd="$chgrpprog $2"
    66             shift
    67             shift
    68             continue;;
    69 
    70         -s) stripcmd="$stripprog"
    71             shift
    72             continue;;
    73 
    74         -t=*) transformarg=`echo $1 | sed 's/-t=//'`
    75             shift
    76             continue;;
    77 
    78         -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
    79             shift
    80             continue;;
    81 
    82         *)  if [ x"$src" = x ]
    83             then
    84                 src=$1
    85             else
    86                 # this colon is to work around a 386BSD /bin/sh bug
    87                 :
    88                 dst=$1
    89             fi
    90             shift
    91             continue;;
    92     esac
    93 done
    94 
    95 if [ x"$src" = x ]
    96 then
    97         echo "install:  no input file specified"
    98         exit 1
    99 else
    100         true
    101 fi
    102 
    103 if [ x"$dir_arg" != x ]; then
    104         dst=$src
    105         src=""
    106        
    107         if [ -d $dst ]; then
    108                 instcmd=:
    109         else
    110                 instcmd=mkdir
    111         fi
    112 else
    113 
    114 # Waiting for this to be detected by the "$instcmd $src $dsttmp" command
    115 # might cause directories to be created, which would be especially bad
    116 # if $src (and thus $dsttmp) contains '*'.
    117 
    118 # obachman 6/15/98
    119 # Here is an ugly fix for a bug in cygwin
    120 # '[ test -f $src ]' evaluates to true, even if only $src.exe exists
    121 # However 'cp $src $dst' can  not find $src, if only $src.exe exists
    122         if test -f "$src.exe" && test -x "$src.exe"; then
    123                 src="$src.exe"
    124                 true
    125         elif [ -f $src -o -d $src ]
    126         then
    127                 true
    128         else
    129                 echo "install:  $src does not exist"
    130                 exit 1
    131         fi
    132        
    133         if [ x"$dst" = x ]
    134         then
    135                 echo "install:  no destination specified"
    136                 exit 1
    137         else
    138                 true
    139         fi
    140 
    141 # If destination is a directory, append the input filename; if your system
    142 # does not like double slashes in filenames, you may need to add some logic
    143 
    144         if [ -d $dst ]
    145         then
    146                 dst="$dst"/`basename $src`
    147         else
    148                 true
    149         fi
    150 fi
    151 
    152 ## this sed command emulates the dirname command
    153 dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
    154 
    155 # Make sure that the destination directory exists.
    156 #  this part is taken from Noah Friedman's mkinstalldirs script
    157 
    158 # Skip lots of stat calls in the usual case.
    159 if [ ! -d "$dstdir" ]; then
    160 defaultIFS='   
    161 '
    162 IFS="${IFS-${defaultIFS}}"
    163 
    164 oIFS="${IFS}"
    165 # Some sh's can't handle IFS=/ for some reason.
    166 IFS='%'
    167 set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
    168 IFS="${oIFS}"
    169 
    170 pathcomp=''
    171 
    172 while [ $# -ne 0 ] ; do
    173         pathcomp="${pathcomp}${1}"
    174         shift
    175 
    176         if [ ! -d "${pathcomp}" ] ;
    177         then
    178                 $mkdirprog "${pathcomp}"
    179         else
    180                 true
    181         fi
    182 
    183         pathcomp="${pathcomp}/"
    184 done
    185 fi
    186 
    187 if [ x"$dir_arg" != x ]
    188 then
    189         $doit $instcmd $dst &&
    190 
    191         if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
    192         if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
    193         if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
    194         if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
    195 else
    196 
    197 # If we're going to rename the final executable, determine the name now.
    198 
    199         if [ x"$transformarg" = x ]
    200         then
    201                 dstfile=`basename $dst`
    202         else
    203                 echo "basename $dst $transformbasename | sed $transformarg$transformbasename"
    204                 dstfile=`basename $dst $transformbasename |
    205                         sed $transformarg`$transformbasename
    206         fi
    207 
    208 # don't allow the sed command to completely eliminate the filename
    209 
    210         if [ x"$dstfile" = x ]
    211         then
    212                 dstfile=`basename $dst`
    213         else
    214                 true
    215         fi
    216 
    217 # Make a temp file name in the proper directory.
    218 
    219         dsttmp=$dstdir/#inst.$$#
    220 
    221 # Move or copy the file name to the temp name
    222 
    223         $doit $instcmd $src $dsttmp &&
    224 
    225         trap "rm -f ${dsttmp}" 0 &&
    226 
    227 # and set any options; do chmod last to preserve setuid bits
    228 
    229 # If any of these fail, we abort the whole thing.  If we want to
    230 # ignore errors from any of these, just make sure not to ignore
    231 # errors from the above "$doit $instcmd $src $dsttmp" command.
    232 
    233         if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
    234         if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
    235         if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
    236         if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
    237 
    238 # Now rename the file to the real destination.
    239 
    240         $doit $rmcmd -f $dstdir/$dstfile &&
    241         $doit $mvcmd $dsttmp $dstdir/$dstfile
    242 
    243 fi &&
    244 
    245 
    246 exit 0
  • new file patches/pullrequest215.patch

    diff --git a/patches/pullrequest215.patch b/patches/pullrequest215.patch
    new file mode 100644
    - +  
     1diff -ru latest/factory/facFqBivar.cc b/factory/facFqBivar.cc
     2--- latest/factory/facFqBivar.cc        2012-07-12 16:24:57.000000000 +0200
     3+++ b/factory/facFqBivar.cc     2013-08-26 14:09:25.479601121 +0200
     4@@ -403,7 +403,9 @@
     5                 delete [] v;
     6                 if (recombination)
     7                 {
     8-                  appendTestMapDown (result, buf (y - eval, y), info, source,
     9+                  buf= buf (y-eval,y);
     10+                  buf /= Lc (buf);
     11+                  appendTestMapDown (result, buf, info, source,
     12                                       dest);
     13                   F= 1;
     14                   return result;
     15@@ -430,7 +432,9 @@
     16       delete [] v;
     17       if (recombination)
     18       {
     19-        appendTestMapDown (result, buf (y - eval, y), info, source, dest);
     20+        buf= buf (y-eval,y);
     21+        buf /= Lc (buf);
     22+        appendTestMapDown (result, buf, info, source, dest);
     23         F= 1;
     24         return result;
     25       }
     26@@ -1616,6 +1620,8 @@
     27     buf= mod (buf, yToL);
     28     buf /= content (buf, x);
     29     buf2= buf (y-evaluation, y);
     30+    buf2 /= Lc (buf2);
     31+    buf2 /= Lc (buf2);
     32     if (!k && beta == x)
     33     {
     34       if (degree (buf2, alpha) < 1)
     35@@ -1738,6 +1744,8 @@
     36     {
     37       tmp1= tmp1 (y - evaluation, y);
     38       tmp2= tmp2 (y - evaluation, y);
     39+      tmp1 /= Lc (tmp1);
     40+      tmp2 /= Lc (tmp2);
     41       if (!k && beta == x && degree (tmp2, alpha) < 1 &&
     42           degree (tmp1, alpha) < 1)
     43       {
     44@@ -1792,6 +1800,8 @@
     45     buf= mod (buf, yToL);
     46     buf /= content (buf, x);
     47     buf2= buf (y - evaluation, y);
     48+    buf2 /= Lc (buf2);
     49+    buf2 /= Lc (buf2);
     50     if (!k && beta == x)
     51     {
     52       if (degree (buf2, alpha) < 1)
     53@@ -2650,9 +2660,12 @@
     54   if (isIrreducible)
     55   {
     56     delete [] bounds;
     57-    CanonicalForm G= F;
     58+    Variable y= Variable (2);
     59+    CanonicalForm tmp= F (y - evaluation, y);
     60+    CFList source, dest;
     61+    tmp= mapDown (tmp, info, source, dest);
     62     F= 1;
     63-    return CFList (G);
     64+    return CFList (tmp);
     65   }
     66 
     67   CFArray * A= new CFArray [factors.length()];
     68@@ -4327,11 +4340,11 @@
     69   else
     70   {
     71     i= 1;
     72-    while ((degree (F,y)/4)*i + 4 <= smallFactorDeg)
     73+    while ((degree (F,y)/4+1)*i + 4 <= smallFactorDeg)
     74       i++;
     75     while (i < 5)
     76     {
     77-      dummy= tmin (degree (F,y)+1, (degree (F,y)/4)*i+4);
     78+      dummy= tmin (degree (F,y)+1, (degree (F,y)/4+1)*i+4);
     79       if (l < dummy)
     80       {
     81         factors.insert (LCF);
     82@@ -4471,11 +4484,11 @@
     83   else
     84   {
     85     i= 1;
     86-    while ((degree (F,y)/4)*i + 4 <= smallFactorDeg)
     87+    while ((degree (F,y)/4+1)*i + 4 <= smallFactorDeg)
     88       i++;
     89     while (i < 5)
     90     {
     91-      dummy= tmin (degree (F,y)+1, (degree (F,y)/4)*i+4);
     92+      dummy= tmin (degree (F,y)+1, (degree (F,y)/4+1)*i+4);
     93       if (l < dummy)
     94       {
     95         factors.insert (LCF);
     96@@ -4619,11 +4632,11 @@
     97   else
     98   {
     99     i= 1;
     100-    while ((degree (F,y)/4)*i + 4 <= smallFactorDeg)
     101+    while (((degree (F,y)/4)*i+1) + 4 <= smallFactorDeg)
     102       i++;
     103     while (i < 5)
     104     {
     105-      dummy= tmin (degree (F,y)+1, (degree (F,y)/4)*i+4);
     106+      dummy= tmin (degree (F,y)+1, ((degree (F,y)/4)+1)*i+4);
     107       if (l < dummy)
     108       {
     109         factors.insert (LCF);
     110@@ -5020,12 +5033,12 @@
     111     CanonicalForm bufF= F;
     112     int factorsFound= 0;
     113     if (alpha.level() == 1 || (alpha.level() != 1 && reduceFq2Fp))
     114-      reconstructionTry (result, bufF, bufUniFactors, degree (F) + 1 + degree
     115-                         (LCF), factorsFound, factorsFoundIndex, NTLN, false
     116+      reconstructionTry (result, bufF, bufUniFactors, degree (F) + 1,
     117+                         factorsFound, factorsFoundIndex, NTLN, false
     118                         );
     119     else
     120-      reconstructionTry (result, bufF, bufUniFactors, degree (F) + 1 + degree
     121-                         (LCF), factorsFound, factorsFoundIndex, NTLNe, false
     122+      reconstructionTry (result, bufF, bufUniFactors, degree (F) + 1,
     123+                         factorsFound, factorsFoundIndex, NTLNe, false
     124                         );
     125     if (alpha.level() == 1 || (alpha.level() != 1 && reduceFq2Fp))
     126     {
     127@@ -5336,7 +5349,7 @@
     128   if (minBound > 16 || result.length() == 0)
     129   {
     130     result= Union (result, smallFactors);
     131-    CanonicalForm MODl= power (y, degree (F) + 1 + degree (LC (F, 1)));
     132+    CanonicalForm MODl= power (y, degree (F) + 1);
     133     delete [] bounds;
     134     return Union (result, factorRecombination (bufUniFactors, F, MODl, degs, 1,
     135                                                bufUniFactors.length()/2
     136@@ -5585,7 +5598,7 @@
     137     delete [] bounds;
     138     return Union (smallFactors, extFactorRecombination
     139                                 (bufUniFactors, F,
     140-                                 power (y, degree (F) + 1 + degree (LCF)),info,
     141+                                 power (y, degree (F) + 1),info,
     142                                  degs, evaluation, 1, bufUniFactors.length()/2
     143                                 )
     144                  );
     145@@ -5638,8 +5651,8 @@
     146     CanonicalForm bufF= F;
     147     int factorsFound= 0;
     148 
     149-    extReconstructionTry (result, bufF, bufUniFactors, degree (F) + 1 + degree
     150-                          (LCF), factorsFound, factorsFoundIndex, NTLN, false,
     151+    extReconstructionTry (result, bufF, bufUniFactors, degree (F) + 1,
     152+                          factorsFound, factorsFoundIndex, NTLN, false,
     153                           info, evaluation
     154                          );
     155 
     156@@ -5767,7 +5780,10 @@
     157     result= Union (result, smallFactors);
     158     if (degs.getLength() == 1 || bufUniFactors.length() == 1)
     159     {
     160-      result.append (bufF);
     161+      CFList source, dest;
     162+      CanonicalForm tmp= bufF (y - evaluation, y);
     163+      tmp= mapDown (tmp, info, source, dest);
     164+      result.append (tmp);
     165       return result;
     166     }
     167     return Union (result, extHenselLiftAndLatticeRecombi (bufF, bufUniFactors,
     168@@ -5834,7 +5850,7 @@
     169   if (minBound > 16 || result.length() == 0)
     170   {
     171     result= Union (result, smallFactors);
     172-    CanonicalForm MODl= power (y, degree (F) + 1 + degree (LC (F, 1)));
     173+    CanonicalForm MODl= power (y, degree (F) + 1);
     174     delete [] bounds;
     175     return Union (result, extFactorRecombination (bufUniFactors, F, MODl, info,
     176                                                   degs, evaluation, 1,
     177@@ -6116,7 +6132,7 @@
     178       return factors;
     179     }
     180 
     181-    if (i == 0)
     182+    if (i == 0 && !extension)
     183     {
     184       if (subCheck1 > 0)
     185       {
     186diff -ru latest/factory/facFqBivarUtil.cc b/factory/facFqBivarUtil.cc
     187--- latest/factory/facFqBivarUtil.cc    2012-07-12 16:24:57.000000000 +0200
     188+++ b/factory/facFqBivarUtil.cc 2013-08-26 14:09:38.979597772 +0200
     189@@ -494,16 +494,21 @@
     190     //middle product style computation of [G*oldQ]^{l}_{oldL}
     191     CanonicalForm G3= div (G, xToOldL);
     192     CanonicalForm Up= mulMod2 (G3, oldQ, xToLOldL);
     193-    CanonicalForm xToOldL2= power (x, oldL/2);
     194+    CanonicalForm xToOldL2= power (x, (oldL+1)/2);
     195     CanonicalForm G2= mod (G, xToOldL);
     196     CanonicalForm G1= div (G2, xToOldL2);
     197     CanonicalForm G0= mod (G2, xToOldL2);
     198     CanonicalForm oldQ1= div (oldQ, xToOldL2);
     199     CanonicalForm oldQ0= mod (oldQ, xToOldL2);
     200-    CanonicalForm Mid= mulMod2 (G1, oldQ1, xToLOldL);
     201+    CanonicalForm Mid;
     202+    if (oldL % 2 == 1)
     203+      Mid= mulMod2 (G1, oldQ1*x, xToLOldL);
     204+    else
     205+      Mid= mulMod2 (G1, oldQ1, xToLOldL);
     206     //computation of Low might be faster using a real middle product?
     207     CanonicalForm Low= mulMod2 (G0, oldQ1, xToOldL)+mulMod2 (G1, oldQ0, xToOldL);
     208-    Low= div (Low, xToOldL2);
     209+    Low= div (Low, power (x, oldL/2));
     210+    Low= mod (Low, xToLOldL);
     211     Up += Mid + Low;
     212     bufF= div (F, xToOldL);
     213     bufF -= Up;
     214diff -ru latest/factory/facMul.cc b/factory/facMul.cc
     215--- latest/factory/facMul.cc    2012-07-12 16:24:57.000000000 +0200
     216+++ b/factory/facMul.cc 2013-08-26 14:09:38.979597772 +0200
     217@@ -2720,13 +2720,6 @@
     218     divrem (A, B, Q, R);
     219     return;
     220   }
     221-  if (!(B.level() == 1 && B.isUnivariate()) &&
     222-      (A.level() == 1 && A.isUnivariate()))
     223-  {
     224-    Q= 0;
     225-    R= A;
     226-    return;
     227-  }
     228 
     229   Variable x= Variable (1);
     230   int degB= degree (B, x);
  • spkg-install

    diff --git a/spkg-install b/spkg-install
    a b  
    6868    fi
    6969fi
    7070
    71 CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS"
     71export CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS"
    7272
    7373# we are building everything fPIC, this might impose a slight
    7474# performance hit, need to evaluate:
    75 
    76 CXXFLAGS="$CXXFLAGS -fPIC"
    77 CFLAGS="$CFLAGS -fPIC"
    78 
    79 export CXXFLAGS
    80 export CFLAGS
    81 export CPPFLAGS
     75export CXXFLAGS="$CXXFLAGS -fPIC"
     76export CFLAGS="$CFLAGS -fPIC"
    8277
    8378
    8479# The Sun assembler has problems with -pipe, so disable it.
     
    8883fi
    8984
    9085
    91 apply_patches()
     86choose_patches()
    9287{
    9388    cd "$PATCHES" || return $?
    9489
     
    105100        mv configure_omalloc "$SRC/omalloc/configure"
    106101        mv conditional/singular_xalloc.patch . || return $?
    107102    fi
     103}
    108104
     105apply_patches()
     106{
    109107    # Apply all patches
    110     cd "$SRC" || return $?
    111     for patch in `ls "$PATCHES"/*.patch`; do
     108    for patch in "$PATCHES"/*.patch; do
    112109        [ -r "$patch" ] || continue  # Skip non-existing or non-readable patches
    113         echo "Applying $patch"
     110        echo "Applying $patch"
    114111        patch -p1 <"$patch"
    115112        if [ $? -ne 0 ]; then
    116113            echo >&2 "Error applying '$patch'"
     
    129126
    130127config()
    131128{
    132     cd "$SRC" || return $?
    133 
    134129    # configure notes:
    135130    # 1) We really need to add --exec-prefix and --bindir as Singular
    136131    #    uses some wierd defaults.
     
    229224
    230225build_factory()
    231226{
    232     cd "$SRC/factory" || return $?
     227    cd factory || return $?
    233228
    234229    $MAKE distclean
    235230
     
    272267
    273268build_libfac()
    274269{
    275     cd "$SRC/libfac" || return $?
     270    cd libfac || return $?
    276271
    277272    $MAKE distclean
    278273
     
    308303
    309304
    310305# Actually run all the functions defined above
    311 for i in apply_patches remove_old_version config \
     306for i in choose_patches apply_patches remove_old_version config \
    312307  build_singular build_libsingular build_factory build_libfac \
    313308  create_singular_script install_docs ; do
    314309    echo "### Singular spkg-install: $i ###"