Patch: MiniSat 2.2.0 fails to build on several occasions

665 views
Skip to first unread message

Michael Tautschnig

unread,
Aug 26, 2010, 3:40:47 AM8/26/10
to MiniSat
Hi all,

As maintainer of the Debian package I noticed build failures on some
architectures running a Linux kernel - the necessary patch is attached
as
debian.patch.

Furthermore, MiniSat 2.2.0 fails to link on OS X as memUsedPeak is not
defined
(not even the stub used for other systems). Hence the proposed patch
osx.patch.

Hope this helps,
Michael

PS.: Inlining the patches as otherwise the message doesn't seem to
make it to the
list.

================== <osx.patch>
==============================================
--- a/minisat-2.2.0/utils/System.cc
+++ b/minisat-2.2.0/utils/System.cc
@@ -88,6 +88,7 @@ double Minisat::memUsed(void) {
malloc_statistics_t t;
malloc_zone_statistics(NULL, &t);
return (double)t.max_size_in_use / (1024*1024); }
+double Minisat::memUsedPeak(void) { return memUsed(); }

#else
double Minisat::memUsed() {
================== </osx.patch>
=============================================


================== <debian.patch>
==============================================
--- minisat2-2.2.0.orig/simp/Main.cc
+++ minisat2-2.2.0/simp/Main.cc
@@ -74,7 +74,7 @@ int main(int argc, char** argv)
setUsageHelp("USAGE: %s [options] <input-file> <result-output-
file>\n\n where input may be either in plain or gzipped DIMACS.\n");
// printf("This is MiniSat 2.0 beta\n");

-#if defined(__linux__)
+#if defined(__linux__) && defined(_FPU_EXTENDED) &&
defined(_FPU_DOUBLE) && defined(_FPU_GETCW)
fpu_control_t oldcw, newcw;
_FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) |
_FPU_DOUBLE; _FPU_SETCW(newcw);
printf("WARNING: for repeatability, setting FPU to use double
precision\n");
--- minisat2-2.2.0.orig/core/Main.cc
+++ minisat2-2.2.0/core/Main.cc
@@ -74,7 +74,7 @@ int main(int argc, char** argv)
setUsageHelp("USAGE: %s [options] <input-file> <result-output-
file>\n\n where input may be either in plain or gzipped DIMACS.\n");
// printf("This is MiniSat 2.0 beta\n");

-#if defined(__linux__)
+#if defined(__linux__) && defined(_FPU_EXTENDED) &&
defined(_FPU_DOUBLE) && defined(_FPU_GETCW)
fpu_control_t oldcw, newcw;
_FPU_GETCW(oldcw); newcw = (oldcw & ~_FPU_EXTENDED) |
_FPU_DOUBLE; _FPU_SETCW(newcw);
printf("WARNING: for repeatability, setting FPU to use double
precision\n");
--- minisat2-2.2.0.orig/utils/System.cc
+++ minisat2-2.2.0/utils/System.cc
@@ -72,7 +72,7 @@ double Minisat::memUsedPeak() {
double peak = memReadPeak() / 1024;
return peak == 0 ? memUsed() : peak; }

-#elif defined(__FreeBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) ||
defined(__gnu_hurd__)

double Minisat::memUsed(void) {
struct rusage ru;
================== </debian.patch>
=============================================

Michael Tautschnig

unread,
Aug 26, 2010, 3:46:21 AM8/26/10
to MiniSat
[...]
> PS.: Inlining the patches as otherwise the message doesn't seem to
> make it to the
> list.
>
[...]

It seems the ended up on-list with undesirable line wraps. Please just
drop me
an email if I should re-send them in private.

Best,
Michael

Edd Barrett

unread,
Aug 26, 2010, 3:54:25 AM8/26/10
to min...@googlegroups.com

If you are using the gmail web interface, it wraps lines and mangles diffs. I
use mutt to send diffs for this reason ;)

--
Best Regards
Edd Barrett

http://www.theunixzoo.co.uk

Michael Tautschnig

unread,
Aug 26, 2010, 4:15:49 AM8/26/10
to min...@googlegroups.com
[...]

> >
> > It seems the ended up on-list with undesirable line wraps. Please just
> > drop me
> > an email if I should re-send them in private.
>
> If you are using the gmail web interface, it wraps lines and mangles diffs. I
> use mutt to send diffs for this reason ;)
>

So usually do I, but somewhere on the way between my mutt and the google groups
my messages got lost or were discarded.

Best,
Michael

Niklas Sörensson

unread,
Aug 31, 2010, 6:04:55 AM8/31/10
to min...@googlegroups.com
Hi Michael,

On Thu, Aug 26, 2010 at 9:40 AM, Michael Tautschnig
<michael.t...@googlemail.com> wrote:
> Hi all,
>
> As maintainer of the Debian package I noticed build failures on some
> architectures running a Linux kernel - the necessary patch is attached
> as
> debian.patch.

Thanks. As you mentioned the patch got messed up by gmail. If you can
send it to me privately would be good.

> Furthermore, MiniSat 2.2.0 fails to link on OS X as memUsedPeak is not
> defined
> (not even the stub used for other systems). Hence the proposed patch
> osx.patch.

Thanks, I was aware of this but have not yet fixed it (I've been on vacation).

Cheers,

/Niklas

Reply all
Reply to author
Forward
0 new messages