sagemath / sage

Main repository of SageMath
https://www.sagemath.org
Other
1.44k stars 480 forks source link

Update PolyBoRi to newest upstream release #6177

Closed malb closed 15 years ago

malb commented 15 years ago
2009/04/06 The first release candidate of PolyBoRi 0.6 is available 
for download. It comes with a PEP8-conforming python interface and 
new algorithms: FGLM and (experimental) parallel processing of 
Gröbner basis variants. In addition, the documentation was improved 
considerably: the tutorial is more extensive, and the TeX4ht-
Support has been improved. Finally, built-in support for plotting 
the underlying decision diagrams has been added.

This version also allows bigger systems to be solved using the M4RI library (due to an updated M4RI) and makes use of M4RI in shared library mode.

This ticket depends on #5510

CC: @sagetrac-PolyBoRi @burcin @rlmill @boothby

Component: packages: standard

Keywords: M4RI, PolyBoRi

Author: Michael Brickenstein, Alexander Dreyer, Martin Albrecht

Reviewer: David Kirkby, Alex Ghitza, Burcin Erocal, Minh Van Nguyen

Merged: Sage 4.1.2.alpha2

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

1998e663-c3b5-4cf6-92c3-7f1771ca5185 commented 15 years ago
comment:41

Hi! It's damn hot here. At the moment, I don't know any more, why you shouldn't just use the constructor Variable(i). Is it, as you have to attach the parent? Unluckily, we use use Variable(i) in a lot of places from python. Of course, it would be cleaner to do something like ring.gen(i). Michael

malb commented 15 years ago
comment:42

Replying to @sagetrac-PolyBoRi:

Is it, as you have to attach the parent?

Yep, it is still somewhat strange that the code above is so slow.

1998e663-c3b5-4cf6-92c3-7f1771ca5185 commented 15 years ago
comment:43

I think, we should wait for Alexander having a look on it, who might have an idea, what happens. Michael

1998e663-c3b5-4cf6-92c3-7f1771ca5185 commented 15 years ago
comment:44

By the way, there happen at least two things: the call BooleEnv::ring and

static ring_type& ring(){
      return active_ring;
  }

the assigment operator.

malb commented 15 years ago
comment:45

It must be the assignment operator (or the dummy constructor) then.

1998e663-c3b5-4cf6-92c3-7f1771ca5185 commented 15 years ago
comment:46

Thanks, a lot, you did it. I didn't remember this Cython thingy. It is the dummy constructor. The assignment doesn't do anything. It is isn't defined. So it is the standard c++ behaviour. However the dummy constructors of the ring should construct a CuddManager, which means something like allocating a memory pool. Michael

malb commented 15 years ago

faster Variable(i)

malb commented 15 years ago
comment:47

Attachment: polybori-0.6.3.2.patch.gz

The attached patch fixes the bottleneck by avoiding the dummy constructor. Note, that we still need to take care of that Solaris issue Dave reported where scons would pick up the Sun compiler instead of gcc.

1998e663-c3b5-4cf6-92c3-7f1771ca5185 commented 15 years ago

Attachment: custom.py.gz

Solaris fix for patches/custom.py

1998e663-c3b5-4cf6-92c3-7f1771ca5185 commented 15 years ago
comment:48

I added some lines to custom.py, s.th. C and C++ compiler are picked from the Sage environment (if any). This fixes the Solaris issue.

Regards, Alexander

malb commented 15 years ago
comment:49

I have added this fix to the newest SPKG available at:

http://sage.math.washington.edu/home/malb/spkgs/polybori-0.6.3-20090825.spkg

aghitza commented 15 years ago
comment:50

There seems to be a pickling problem, try the following on sage.math:

sage -t -long devel/sage/sage/structure/sage_object.pyx
bac7d3ea-3f1b-4826-8464-f0b53d5e12d2 commented 15 years ago
comment:51

I've found another Solaris issue. I tried a build of Sage from scratch on my Solaris machine, which has Sun Studio 12 update 1 in /opt/sunstudio12.1

You will note below that SCons can't write to the file sage-4.1.1/local/share/polybori/flags.conf, as it does not exist.

It strikes me the build process of this leaves a bit to be desired. Note in the following line, -fPIC is twice used as a flag (... -g -fPIC -fPIC -DNDEBUG), and the 'gd' library is linked no less than four times in the line following that (...-Lgroebner -LCudd -lm -lgd -lgd -lgd -lgd). Looking at install.log I see numerous instances of this.

Another thing that I believe would be helpful is if there was a space between the '-h' flag and the library name, which appears below as "-Wl,-hlibpboriCudd-0.6.3.so.0". Although the Sun linker will accept that, I think having "-Wl,-h libpboriCudd-0.6.3.so.0" would be a bit neater. But all these are minor points compared to the fact polybori fails as it can't write to a file which does not exist.


gcc -o M4RI/brilliantrussian.pic.o -c -std=c99 -O3 -Wno-long-long -Wreturn-type -g -fPIC -fPIC -DNDEBUG -DHAVE_GD -DHAVE_TR1_UNORDERED_MAP -DPACKED -DHAVE_M4RI -DHAVE_GD -DHAVE_IEEE_754 -DBSD -I/export/home/drkirkby/sage/tmp/sage-4.1.1/spkg/build/polybori-0.6.3-20090825/src/boost_1_34_1.cropped -I/export/home/drkirkby/sage/tmp/sage-4.1.1/local/include -I/export/home/drkirkby/sage/tmp/sage-4.1.1/local/include/python2.6 -Ipolybori/include -IM4RI -ICudd/obj -ICudd/util -ICudd/cudd -ICudd/mtr -ICudd/st -ICudd/epd M4RI/brilliantrussian.c
g++ -o groebner/libgroebner-0.6.3.so.0.0.0 -G -Wl,-hlibgroebner-0.6.3.so.0 Cudd/obj/cuddObj.pic.o Cudd/util/cpu_time.pic.o Cudd/util/state.pic.o Cudd/util/datalimit.pic.o Cudd/util/texpand.pic.o Cudd/util/pipefork.pic.o Cudd/util/strsav.pic.o Cudd/util/ptime.pic.o Cudd/util/tmpfile.pic.o Cudd/util/stub.pic.o Cudd/util/cpu_stats.pic.o Cudd/util/safe_mem.pic.o Cudd/util/getopt.pic.o Cudd/util/prtime.pic.o Cudd/util/pathsearch.pic.o Cudd/cudd/cuddApprox.pic.o Cudd/cudd/cuddRead.pic.o Cudd/cudd/cuddLevelQ.pic.o Cudd/cudd/cuddCof.pic.o Cudd/cudd/cuddGenetic.pic.o Cudd/cudd/cuddZddPort.pic.o Cudd/cudd/cuddMatMult.pic.o Cudd/cudd/cuddZddIsop.pic.o Cudd/cudd/cuddAPI.pic.o Cudd/cudd/cuddZddGroup.pic.o Cudd/cudd/cuddZddSymm.pic.o Cudd/cudd/cuddRef.pic.o Cudd/cudd/cuddZddMisc.pic.o Cudd/cudd/cuddDecomp.pic.o Cudd/cudd/cuddZddUtil.pic.o Cudd/cudd/cuddLiteral.pic.o Cudd/cudd/cuddAddNeg.pic.o Cudd/cudd/cuddPriority.pic.o Cudd/cudd/cuddAnneal.pic.o Cudd/cudd/cuddInit.pic.o Cudd/cudd/cuddZddSetop.pic.o Cudd/cudd/cuddReorder.pic.o Cudd/cudd/cuddSolve.pic.o Cudd/cudd/cuddBddCorr.pic.o Cudd/cudd/cuddAddFind.pic.o Cudd/cudd/cuddAddInv.pic.o Cudd/cudd/cuddWindow.pic.o Cudd/cudd/cuddAddIte.pic.o Cudd/cudd/cuddAddAbs.pic.o Cudd/cudd/cuddZddReord.pic.o Cudd/cudd/cuddBddAbs.pic.o Cudd/cudd/cuddBddIte.pic.o Cudd/cudd/cuddLinear.pic.o Cudd/cudd/cuddSign.pic.o Cudd/cudd/cuddCheck.pic.o Cudd/cudd/cuddZddCount.pic.o Cudd/cudd/cuddZddFuncs.pic.o Cudd/cudd/cuddEssent.pic.o Cudd/cudd/cuddGroup.pic.o Cudd/cudd/cuddSplit.pic.o Cudd/cudd/cuddSat.pic.o Cudd/cudd/cuddAddApply.pic.o Cudd/cudd/cuddLCache.pic.o Cudd/cudd/cuddCache.pic.o Cudd/cudd/cuddAndAbs.pic.o Cudd/cudd/cuddHarwell.pic.o Cudd/cudd/cuddBridge.pic.o Cudd/cudd/cuddUtil.pic.o Cudd/cudd/cuddExport.pic.o Cudd/cudd/cuddSubsetHB.pic.o Cudd/cudd/cuddAddWalsh.pic.o Cudd/cudd/cuddSymmetry.pic.o Cudd/cudd/cuddTable.pic.o Cudd/cudd/cuddApa.pic.o Cudd/cudd/cuddCompose.pic.o Cudd/cudd/cuddZddLin.pic.o Cudd/cudd/cuddExact.pic.o Cudd/cudd/cuddSubsetSP.pic.o Cudd/cudd/cuddGenCof.pic.o Cudd/cudd/cuddClip.pic.o Cudd/cudd/cuddInteract.pic.o Cudd/mtr/mtrBasic.pic.o Cudd/mtr/mtrGroup.pic.o Cudd/st/st.pic.o Cudd/epd/epd.pic.o polybori/src/BoolePolyRing.pic.o polybori/src/BooleEnv.pic.o polybori/src/BoolePolynomial.pic.o polybori/src/BooleVariable.pic.o polybori/src/CErrorInfo.pic.o polybori/src/PBoRiError.pic.o polybori/src/CCuddFirstIter.pic.o polybori/src/CCuddNavigator.pic.o polybori/src/BooleMonomial.pic.o polybori/src/BooleSet.pic.o polybori/src/LexOrder.pic.o polybori/src/CCuddLastIter.pic.o polybori/src/CCuddGetNode.pic.o polybori/src/BooleExponent.pic.o polybori/src/DegLexOrder.pic.o polybori/src/DegRevLexAscOrder.pic.o polybori/src/pbori_routines.pic.o polybori/src/BlockDegLexOrder.pic.o polybori/src/BlockDegRevLexAscOrder.pic.o groebner/src/groebner.pic.o groebner/src/literal_factorization.pic.o groebner/src/randomset.pic.o groebner/src/pairs.pic.o groebner/src/groebner_alg.pic.o groebner/src/fglm.pic.o groebner/src/polynomial_properties.pic.o groebner/src/lexbuckets.pic.o groebner/src/dlex4data.pic.o groebner/src/dp_asc4data.pic.o groebner/src/lp4data.pic.o groebner/src/nf.pic.o groebner/src/interpolate.pic.o M4RI/grayflex.pic.o M4RI/permutation.pic.o M4RI/packedmatrix.pic.o M4RI/strassen.pic.o M4RI/misc.pic.o M4RI/brilliantrussian.pic.o -L/export/home/drkirkby/sage/tmp/sage-4.1.1/local/lib -L/export/home/drkirkby/sage/tmp/sage-4.1.1/local/lib/python2.6/config -Lpolybori -Lgroebner -LCudd -lm -lgd -lgd -lgd -lgd
g++ -o Cudd/libpboriCudd-0.6.3.so.0.0.0 -G -Wl,-hlibpboriCudd-0.6.3.so.0 Cudd/obj/cuddObj.pic.o Cudd/util/cpu_time.pic.o Cudd/util/state.pic.o Cudd/util/datalimit.pic.o Cudd/util/texpand.pic.o Cudd/util/pipefork.pic.o Cudd/util/strsav.pic.o Cudd/util/ptime.pic.o Cudd/util/tmpfile.pic.o Cudd/util/stub.pic.o Cudd/util/cpu_stats.pic.o Cudd/util/safe_mem.pic.o Cudd/util/getopt.pic.o Cudd/util/prtime.pic.o Cudd/util/pathsearch.pic.o Cudd/cudd/cuddApprox.pic.o Cudd/cudd/cuddRead.pic.o Cudd/cudd/cuddLevelQ.pic.o Cudd/cudd/cuddCof.pic.o Cudd/cudd/cuddGenetic.pic.o Cudd/cudd/cuddZddPort.pic.o Cudd/cudd/cuddMatMult.pic.o Cudd/cudd/cuddZddIsop.pic.o Cudd/cudd/cuddAPI.pic.o Cudd/cudd/cuddZddGroup.pic.o Cudd/cudd/cuddZddSymm.pic.o Cudd/cudd/cuddRef.pic.o Cudd/cudd/cuddZddMisc.pic.o Cudd/cudd/cuddDecomp.pic.o Cudd/cudd/cuddZddUtil.pic.o Cudd/cudd/cuddLiteral.pic.o Cudd/cudd/cuddAddNeg.pic.o Cudd/cudd/cuddPriority.pic.o Cudd/cudd/cuddAnneal.pic.o Cudd/cudd/cuddInit.pic.o Cudd/cudd/cuddZddSetop.pic.o Cudd/cudd/cuddReorder.pic.o Cudd/cudd/cuddSolve.pic.o Cudd/cudd/cuddBddCorr.pic.o Cudd/cudd/cuddAddFind.pic.o Cudd/cudd/cuddAddInv.pic.o Cudd/cudd/cuddWindow.pic.o Cudd/cudd/cuddAddIte.pic.o Cudd/cudd/cuddAddAbs.pic.o Cudd/cudd/cuddZddReord.pic.o Cudd/cudd/cuddBddAbs.pic.o Cudd/cudd/cuddBddIte.pic.o Cudd/cudd/cuddLinear.pic.o Cudd/cudd/cuddSign.pic.o Cudd/cudd/cuddCheck.pic.o Cudd/cudd/cuddZddCount.pic.o Cudd/cudd/cuddZddFuncs.pic.o Cudd/cudd/cuddEssent.pic.o Cudd/cudd/cuddGroup.pic.o Cudd/cudd/cuddSplit.pic.o Cudd/cudd/cuddSat.pic.o Cudd/cudd/cuddAddApply.pic.o Cudd/cudd/cuddLCache.pic.o Cudd/cudd/cuddCache.pic.o Cudd/cudd/cuddAndAbs.pic.o Cudd/cudd/cuddHarwell.pic.o Cudd/cudd/cuddBridge.pic.o Cudd/cudd/cuddUtil.pic.o Cudd/cudd/cuddExport.pic.o Cudd/cudd/cuddSubsetHB.pic.o Cudd/cudd/cuddAddWalsh.pic.o Cudd/cudd/cuddSymmetry.pic.o Cudd/cudd/cuddTable.pic.o Cudd/cudd/cuddApa.pic.o Cudd/cudd/cuddCompose.pic.o Cudd/cudd/cuddZddLin.pic.o Cudd/cudd/cuddExact.pic.o Cudd/cudd/cuddSubsetSP.pic.o Cudd/cudd/cuddGenCof.pic.o Cudd/cudd/cuddClip.pic.o Cudd/cudd/cuddInteract.pic.o Cudd/mtr/mtrBasic.pic.o Cudd/mtr/mtrGroup.pic.o Cudd/st/st.pic.o Cudd/epd/epd.pic.o -L/export/home/drkirkby/sage/tmp/sage-4.1.1/local/lib -L/export/home/drkirkby/sage/tmp/sage-4.1.1/local/lib/python2.6/config -Lpolybori -Lgroebner -LCudd -lm -lgd -lgd -lgd -lgd
build_symlink(["polybori/libpolybori-0.6.3.so.0"], ["polybori/libpolybori-0.6.3.so.0.0.0"])
Symlinking from libpolybori-0.6.3.so.0.0.0 to polybori/libpolybori-0.6.3.so.0
build_symlink(["polybori/libpolybori-0.6.3.so"], ["polybori/libpolybori-0.6.3.so.0"])
Symlinking from libpolybori-0.6.3.so.0 to polybori/libpolybori-0.6.3.so
build_symlink(["polybori/libpolybori.so"], ["polybori/libpolybori-0.6.3.so"])
Symlinking from libpolybori-0.6.3.so to polybori/libpolybori.so
build_symlink(["groebner/libgroebner-0.6.3.so.0"], ["groebner/libgroebner-0.6.3.so.0.0.0"])
Symlinking from libgroebner-0.6.3.so.0.0.0 to groebner/libgroebner-0.6.3.so.0
build_symlink(["groebner/libgroebner-0.6.3.so"], ["groebner/libgroebner-0.6.3.so.0"])
Symlinking from libgroebner-0.6.3.so.0 to groebner/libgroebner-0.6.3.so
build_symlink(["groebner/libgroebner.so"], ["groebner/libgroebner-0.6.3.so"])
Symlinking from libgroebner-0.6.3.so to groebner/libgroebner.so
build_symlink(["Cudd/libpboriCudd-0.6.3.so.0"], ["Cudd/libpboriCudd-0.6.3.so.0.0.0"])
Symlinking from libpboriCudd-0.6.3.so.0.0.0 to Cudd/libpboriCudd-0.6.3.so.0
build_symlink(["Cudd/libpboriCudd-0.6.3.so"], ["Cudd/libpboriCudd-0.6.3.so.0"])
Symlinking from libpboriCudd-0.6.3.so.0 to Cudd/libpboriCudd-0.6.3.so
build_symlink(["Cudd/libpboriCudd.so"], ["Cudd/libpboriCudd-0.6.3.so"])
Symlinking from libpboriCudd-0.6.3.so to Cudd/libpboriCudd.so
scons: done building targets.
Done build_polybori.
Installing PolyBoRi...
scons: Reading SConscript files ...
Sun linker detected.
Checking for C header file gd.h... (cached) yes
Checking for C library gd... (cached) yes
Checking for C++ header file unordered_map... (cached) no
Checking for C++ header file tr1/unordered_map... (cached) yes
Warning: No LaTeX to html converter found, Tutorial will not be installed
Checking for C library m4ri... (cached) no
Checking for C header file gd.h... (cached) yes
Checking for C library gd... (cached) yes
no python extension
setting umask to 022 (was 022)

scons: *** Error writing options to file: /export/home/drkirkby/sage/tmp/sage-4.1.1/local/share/polybori/flags.conf
[Errno 2] No such file or directory: '/export/home/drkirkby/sage/tmp/sage-4.1.1/local/share/polybori/flags.conf'
File "/export/home/drkirkby/sage/tmp/sage-4.1.1/spkg/build/polybori-0.6.3-20090825/src/polybori-0.6/SConstruct", line 1281, in <module>
Error installing PolyBoRi.

real    18m9.386s
user    16m29.417s
sys     1m23.875s
sage: An error occurred while installing polybori-0.6.3-20090825
1998e663-c3b5-4cf6-92c3-7f1771ca5185 commented 15 years ago

Patched the (patched) patch/SConstruct to fix the "flags.conf" issue

1998e663-c3b5-4cf6-92c3-7f1771ca5185 commented 15 years ago
comment:52

Attachment: flags-conf.patch.gz

Indeed, this is not a Solaris issue, but it will occur always, in the case, that PolyBoRi wasn't installed in the corresponding Sage before. Some patch from Sage adds the generation of flags.conf, but that goes wrong, if the installation directory does not exist before. The flags-conf.patch above should fix the problem.

Regards, Alexander

1998e663-c3b5-4cf6-92c3-7f1771ca5185 commented 15 years ago
comment:53

I would suggest to postpone the minor issues (duplicated arguments, missing, but not mandatory space) to the next release of PolyBoRi.

Alexander

malb commented 15 years ago
comment:54

Alright, the new SPKG deals with the flags.conf issue (thanks Alexander)

http://sage.math.washington.edu/home/malb/spkgs/polybori-0.6.3-20090827.spkg

I will postpone the fPIC issue for now and will concentrate on the pickling issue.

malb commented 15 years ago

Reviewer: David Kirkby, Alex Ghitza

malb commented 15 years ago

Author: Michael Brickenstein, Alexander Dreyer, Martin Albrecht

malb commented 15 years ago

Attachment: polybori-0.6.3.3.patch.gz

fixes the pickling issue

malb commented 15 years ago
comment:56

The attached patch fixes the pickling issue and now all doctests pass on sage.math.

burcin commented 15 years ago

Attachment: trac_6177_reviewer_patch.gz

minor fixes

burcin commented 15 years ago
comment:57

I added a patch with minor changes:

I give Martin's patch and the package a positive review. Martin, if you're ok with my changes, please mark this positive review.

Only attachment: polybori-0.6.3.3.patch and attachment: trac_6177_reviewer_patch should be applied, with the package linked from comment:54.

burcin commented 15 years ago

Changed reviewer from David Kirkby, Alex Ghitza to David Kirkby, Alex Ghitza, Burcin Erocal

malb commented 15 years ago
comment:58

Burcin's patch looks good, applies cleanly against 4.1.2.alpha1 and doctests pass.

Its done, finally!

7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 15 years ago
comment:59

Merged patches in this order:

  1. polybori-0.6.3.3.patch
  2. trac_6177_reviewer_patch

Merged polybori-0.6.3-20090827.spkg in the standard packages repository.

7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 15 years ago

Merged: Sage 4.1.2.alpha2

7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 15 years ago

Attachment: trac_6177-polybori-0.6.3.3.patch.gz

repo corrupt-free version

7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 15 years ago

with the ".patch" file extension

7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 15 years ago
comment:60

Attachment: trac_6177_reviewer.patch.gz

I have attached two new patches

  1. trac_6177-polybori-0.6.3.3.patch --- This is the same as polybori-0.6.3.3.patch. The only change is inserting the comment

    # Insert a comment here to prevent repo corruption.

    into the empty file sage/libs/polybori/__init__.py in order to prevent repository corruption as was reported on IRC by William Stein:

    20:14 < williamstein> mvngu -- possible problem with alpha2
    20:14 < williamstein> i get /scratch/wstein/build/sage-4.1.2.alpha3/devel/sage-main/sage/rings/polynomial/pbori.pxd:10:0: 'sage.libs.polybori.decl.pxd' not found
    20:15 < williamstein> "repo corruption"?
    20:15 < williamstein> yep
    20:15 < williamstein> wstein@sage:~/build/sage-4.1.2.alpha3/devel/sage$ hg status
    20:15 < williamstein> ! sage/libs/polybori/__init__.py
    20:15 < williamstein> I fix it with:
    20:15 < williamstein> wstein@sage:~/build/sage-4.1.2.alpha3/devel/sage$ hg revert --all
    20:15 < williamstein> reverting sage/libs/polybori/__init__.py
    20:16 < mvngu> williamstein: yeah, I just do "make" again.
    20:16 < williamstein> mvngu -- that always bites you for some reason.
    20:17 < mvngu> I have been experiencing that problem on every machine I'm building on.
    20:17 < mvngu> It's always about polybori.
  2. trac_6177_reviewer.patch --- This is the same as trac_6177_reviewer_patch. I put in the file extension ".patch" so that the patch would be displayed with colour on trac.
7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 15 years ago
comment:61

Only merge these:

  1. trac_6177-polybori-0.6.3.3.patch
  2. trac_6177_reviewer.patch
7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 15 years ago

add files to MANIFEST.in

7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 15 years ago
comment:62

Attachment: trac_6177-manifest.patch.gz

The patch trac_6177-manifest.patch adds the following files to MANIFEST.in:

This way, the files would be picked up when making a source release. By now, patches should be merged in this order:

  1. trac_6177-polybori-0.6.3.3.patch
  2. trac_6177_reviewer.patch
  3. trac_6177-manifest.patch
7c09a680-e216-4024-bb8e-9bfd4aa7f313 commented 15 years ago

Changed reviewer from David Kirkby, Alex Ghitza, Burcin Erocal to David Kirkby, Alex Ghitza, Burcin Erocal, Minh Van Nguyen