Closed edd8e884-f507-429a-b577-5d554626c0fe closed 7 years ago
Changed keywords from none to days86
Description changed:
---
+++
@@ -1,2 +1,4 @@
This ticket is a compagnon of #22817 which updates cryptominisat package to 5.0.1. Since our current cython interface does not work with cryptominisat 5, we have to rewrite the interface to use the python bindings that are now provided by cryptominisat.
+#22818 and #22817 depend on each other.
+
Commit: afffd2a
Author: Thierry Monteil
Branch pushed to git repo; I updated commit sha1. New commits:
2807be3 | #22818 : let nvars() behave consistently with DIMACS convention. |
Branch pushed to git repo; I updated commit sha1. New commits:
1a480b2 | #22818 : rhs option is the opposite of the former isfalse option. |
1eda2df | #22818 : change in verbose output. |
1c45dae | #22818 : cryptominisat does not have a maxrestarts option anymore. |
262cd46 | #22818 : some solvers (including recent cryptominisat) do not implement a learnt_clauses method. |
Description changed:
---
+++
@@ -2,3 +2,7 @@
#22818 and #22817 depend on each other.
+the tarball is at https://github.com/msoos/cryptominisat/archive/5.0.1.tar.gz
+
+(might have to renamed---or downloaded using a browser)
+
works on freebsd/clang, which is a good approx of OSX.
22818 and #22817 depend on each other.
Why two tickets then?
Can you add any/all of the following to the new module cryptominisat.py
?
# Support of Python 3
from __future__ import division, absolute_import, print_function, unicode_literals
My mac OSX is still compiling the newest version of Sage...
Replying to @seblabbe:
22818 and #22817 depend on each other.
Why two tickets then?
Well, they do not really depend on each other, #22818 depends on #22817, but since the current interface was not working anymore, i wanted to make clear to the release manager that #22817 should not be considered until #22818 get a positive review.
Moreover, while i was pretty confident to be able to package cryptominisat 5 (and let it work with cmake), it was not clear to me whether i will be the author of the current ticket, i was first planning to contact Martin Albrecht top help there, but change after change, i could do something acceptable.
Can you add any/all of the following to the new module
cryptominisat.py
?# Support of Python 3 from __future__ import division, absolute_import, print_function, unicode_literals
I will do this.
My mac OSX is still compiling the newest version of Sage...
Description changed:
---
+++
@@ -1,8 +1,6 @@
This ticket is a compagnon of #22817 which updates cryptominisat package to 5.0.1. Since our current cython interface does not work with cryptominisat 5, we have to rewrite the interface to use the python bindings that are now provided by cryptominisat.
-#22818 and #22817 depend on each other.
-
-the tarball is at https://github.com/msoos/cryptominisat/archive/5.0.1.tar.gz
+The tarball is at https://github.com/msoos/cryptominisat/archive/5.0.1.tar.gz
(might have to renamed---or downloaded using a browser)
Branch pushed to git repo; I updated commit sha1. New commits:
5f02977 | #22818 : implement comment 9 for Python 3 compatibility. |
Replying to @sagetrac-tmonteil:
Replying to @seblabbe:
Can you add any/all of the following to the new module
cryptominisat.py
?# Support of Python 3 from __future__ import division, absolute_import, print_function, unicode_literals
I will do this.
Done.
On top of #22999, with OSX 10.10, sage -i cryptominisat
works and I get on relevant files:
sage -t --long src/sage/sat/solvers/cryptominisat.py
[9 tests, 1.04 s]
sage -t --long src/sage/sat/boolean_polynomials.py
[2 tests, 1.53 s]
sage -t --long src/sage/sat/converters/polybori.py
[121 tests, 1.13 s]
sage -t --long src/sage/sat/solvers/satsolver.pyx
[41 tests, 1.07 s]
----------------------------------------------------------------------
All tests passed!
----------------------------------------------------------------------
Changed keywords from days86 to days86, thursdaysbdx
Be careful that since cryptominisat is tagged as experimental
, sage -t --long
seems not to consider it as installed. For this, you have to change the file /build/pkgs/cryptominisat/type
to optional
(the number of tests should increase). Note also that the file rings/polynomial/multi_polynomial_sequence.py
should be tested as well.
I would suggest to move
from sage.misc.package import PackageNotFoundError
inside the except ImportError
clause.
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
afe37c5 | #22818 : move PackageNotFoundError import as suggested in comment 15. |
Ok, so I can install it:
$ sage -installed
...
cryptominisat...........................5.0.1
...
but I can not run it properly:
sage: from sage.sat.solvers.cryptominisat import CryptoMiniSat
sage: CryptoMiniSat()
---------------------------------------------------------------------------
PackageNotFoundError Traceback (most recent call last)
<ipython-input-2-8287720c4b48> in <module>()
----> 1 CryptoMiniSat()
/Users/slabbe/Applications/sage-git/local/lib/python2.7/site-packages/sage/sat/solvers/cryptominisat.pyc in __init__(self, verbosity, confl_limit, threads)
58 from pycryptosat import Solver
59 except ImportError:
---> 60 raise PackageNotFoundError("cryptominisat")
61 self._solver = Solver(verbose=int(verbosity), confl_limit=int(confl_limit), threads=int(threads))
62 self._nvars = 0
PackageNotFoundError: the package u'cryptominisat' was not found.
You can install it by running 'sage -i cryptominisat' in a shell
The real error is:
sage: from pycryptosat import Solver
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-3-280927e3230f> in <module>()
----> 1 from pycryptosat import Solver
ImportError: dlopen(/Users/slabbe/Applications/sage-git/local/lib/python2.7/site-packages/pycryptosat.so, 2): Library not loaded: libcryptominisat5.5.0.dylib
Referenced from: /Users/slabbe/Applications/sage-git/local/lib/python2.7/site-packages/pycryptosat.so
Reason: image not found
...this shows that message PackageNotFoundError: the package u'cryptominisat' was not found. You can install it by running 'sage -i cryptominisat' in a shell
is misleading because for me it is installed.
Could you go to your SAGE_LOCAL
directory and type:
find | grep cryptominisat
as well as:
find | grep cryptosat
find with no argument?
$ find | grep cryptominisat
usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression]
find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]
Maybe this what you mean:
$ cd local/lib
$ ls | grep cryp
libcryptominisat5.5.0.dylib
libcryptominisat5.dylib
Replying to @seblabbe:
find with no argument?
$ find | grep cryptominisat usage: find [-H | -L | -P] [-EXdsx] [-f path] path ... [expression] find [-H | -L | -P] [-EXdsx] -f path [path ...] [expression]
Who said OSX was user-friendly ?
You can try:
find -name '*cryptominisat*'
and
find -name '*cryptosat*'
I needed to add .
:
$ find . -name '*cryptominisat*'
./bin/cryptominisat5_simple
./include/cryptominisat5
./include/cryptominisat5/cryptominisat.h
./include/cryptominisat5/cryptominisat_c.h
./lib/cmake/cryptominisat5
./lib/cmake/cryptominisat5/cryptominisat5Config.cmake
./lib/cmake/cryptominisat5/cryptominisat5Targets-relwithdebinfo.cmake
./lib/cmake/cryptominisat5/cryptominisat5Targets.cmake
./lib/libcryptominisat5.5.0.dylib
./lib/libcryptominisat5.dylib
./lib/python2.7/site-packages/sage/sat/solvers/cryptominisat
./lib/python2.7/site-packages/sage/sat/solvers/cryptominisat.py
./lib/python2.7/site-packages/sage/sat/solvers/cryptominisat.pyc
./var/lib/sage/installed/cryptominisat-5.0.1
$ find . -name '*cryptosat*'
./lib/python2.7/site-packages/pycryptosat-5.0.1-py2.7.egg-info
./lib/python2.7/site-packages/pycryptosat.so
I do not see much difference, except that my .so
files become .dylib
, which seems an OSX specificity. Not sure how this impacts things.
Does the following work: put the block
p cnf 2 3
1 0
-2 0
-1 2 3 0
in the file /tmp/cnf
, and run:
./bin/cryptominisat5 --verb 0 /tmp/cnf
Apparently, you do not have a ./bin/cryptominisat5
file, so try instead:
./bin/cryptominisat5_simple /tmp/cnf
I get:
$ ./bin/cryptominisat5_simple --verb 0 /tmp/cnf
dyld: Library not loaded: libcryptominisat5.5.0.dylib
Referenced from: /Users/slabbe/Applications/sage-git/local/./bin/cryptominisat5_simple
Reason: image not found
Trace/BPT trap: 5
Same output without --verb 0
.
What if you do the same from a sage -sh
shell ? What is the output of echo $LDFLAGS
?
OK, I can start debug your stuff. I suspect some stuff is not set as we want it in cryptominisat build system on OS X. Given the reports I am seeing, I'll want the output of
otool -L lib/libcryptominisat5.5.0.dylib
otool -L bin/cryptominisat5_simple
otool -L lib/python2.7/site-packages/pycryptosat.so
please.
Replying to @sagetrac-tmonteil:
What if you do the same from a
sage -sh
shell ?
same result
What is the output of
echo $LDFLAGS
?
$ sage -sh
$ echo $LDFLAGS
-L/Users/slabbe/Applications/sage-git/local/lib -Wl,-rpath,/Users/slabbe/Applications/sage-git/local/lib
$ otool -L lib/libcryptominisat5.5.0.dylib
lib/libcryptominisat5.5.0.dylib:
libcryptominisat5.5.0.dylib (compatibility version 5.0.0, current version 5.0.0)
/Users/slabbe/Applications/sage-git/local/lib/libm4ri-0.0.20140914.dylib (compatibility version 0.0.0, current version 0.0.0)
/Users/slabbe/Applications/sage-git/local/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.20.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/Users/slabbe/Applications/sage-git/local/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
$ otool -L bin/cryptominisat5_simple
bin/cryptominisat5_simple:
libcryptominisat5.5.0.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.5)
/Users/slabbe/Applications/sage-git/local/lib/libm4ri-0.0.20140914.dylib (compatibility version 0.0.0, current version 0.0.0)
/Users/slabbe/Applications/sage-git/local/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.20.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1197.1.1)
/Users/slabbe/Applications/sage-git/local/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
$ otool -L lib/python2.7/site-packages/pycryptosat.so
lib/python2.7/site-packages/pycryptosat.so:
build/lib.macosx-10.9-x86_64-2.7/pycryptosat.so (compatibility version 0.0.0, current version 0.0.0)
libcryptominisat5.5.0.dylib (compatibility version 5.0.0, current version 5.0.0)
/Users/slabbe/Applications/sage-git/local/lib/libpython2.7.dylib (compatibility version 2.7.0, current version 2.7.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1152.0.0)
/Users/slabbe/Applications/sage-git/local/lib/libstdc++.6.dylib (compatibility version 7.0.0, current version 7.20.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
/Users/slabbe/Applications/sage-git/local/lib/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
Mirage:sage-build fbissey$ otool -L /Users/fbissey/build/sage-build/local/bin/cryptominisat5_simple
/Users/fbissey/build/sage-build/local/bin/cryptominisat5_simple:
libcryptominisat5.5.0.dylib (compatibility version 5.0.0, current version 5.0.0)
/usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.8)
/Users/fbissey/build/sage-build/local/lib/libm4ri-0.0.20140914.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2)
Mirage:sage-build fbissey$ otool -L /Users/fbissey/build/sage-build/local/lib/libcryptominisat5.5.0.dylib
/Users/fbissey/build/sage-build/local/lib/libcryptominisat5.5.0.dylib:
libcryptominisat5.5.0.dylib (compatibility version 5.0.0, current version 5.0.0)
/Users/fbissey/build/sage-build/local/lib/libm4ri-0.0.20140914.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 307.5.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.50.2)
install_name is not set. This will not work properly on OS X but the fix will belong to #22817 as it is for building cryptominisat
itself. Looking into it.
Documentation of INPUTS of __init__
should go into the class, because it should appear first in:
CryptoMiniSat??
You may write See documentation class for inputs
inside __init__
. There are many example like this in Sage code.
Branch pushed to git repo; I updated commit sha1. New commits:
be9db62 | #22818 : move documentation of INPUT from `__init__` to the class, as suggested in [comment:34](#comment%3A34). |
Replying to @seblabbe:
Documentation of INPUTS of
__init__
should go into the class, because it should appear first in:CryptoMiniSat??
You may write
See documentation class for inputs
inside__init__
. There are many example like this in Sage code.
Done. Note that actually, we should put most of the doc in the documentation od the SAT
function which is the only one imported in the namespace. Looking at it, it seems that the arguments can not be passed to the different class constructors.
Branch pushed to git repo; I updated commit sha1. New commits:
0566102 | #22818 : pass options from SAT to CruptoMiniSat. |
Replying to @sagetrac-tmonteil:
Looking at it, it seems that the arguments can not be passed to the different class constructors.
Done for cryptominisat.
It is less easy for LP solver, since SAT
will need a solver
option to decide between cryptominisat and LP, and then another solver
option to decide which MILP backend to use. Moreover, the SatLP
input tells about a solver
option, but then it does not pass it to MixedIntegerLinearProgram()
. In any case, this will be for another ticket since it does not concerns cryptominisat.
Branch pushed to git repo; I updated commit sha1. New commits:
e382251 | #22818 : remove useless import. |
This ticket is a compagnon of #22817 which updates cryptominisat package to 5.0.1. Since our current cython interface does not work with cryptominisat 5, we have to rewrite the interface to use the python bindings that are now provided by cryptominisat.
The tarball is at https://github.com/msoos/cryptominisat/archive/5.0.1.tar.gz
(might have to renamed---or downloaded using a browser)
Depends on #22817
CC: @kiwifb
Component: packages: experimental
Keywords: days86, thursdaysbdx, sdl
Author: Thierry Monteil
Branch:
c22de1d
Reviewer: Sébastien Labbé
Issue created by migration from https://trac.sagemath.org/ticket/22818