[...]
> > Or are there any other IDEs on windows that can handle Minisat better?
> > (with debug .. )
>
> I think compiling with cygwin will be easier but still will not work
> completely as-is.
>
I haven't tried the most recent git HEAD, but early 2.2.0 versions do
work fine, both with cygwin and MinGW/MSys, with only minimal patching
(which might even already be included in current git HEAD; if not,
Niklas, feel free to use it) - patch is shown below.
Best regards,
Michael
diff --git a/minisat-2.2.0/core/Main.cc b/minisat-2.2.0/core/Main.cc
index 4388c3e..31b8a30 100644
--- a/minisat-2.2.0/core/Main.cc
+++ b/minisat-2.2.0/core/Main.cc
@@ -96,8 +96,12 @@ int main(int argc, char** argv)
// Use signal handlers that forcibly quit until the solver
will be able to respond to
// interrupts:
signal(SIGINT, SIGINT_exit);
+#ifdef SIGXCPU
signal(SIGXCPU,SIGINT_exit);
+#endif
+
+#if !defined(_MSC_VER) && !defined(__MINGW32__)
// Set limit on CPU-time:
if (cpu_lim != INT32_MAX){
rlimit rl;
@@ -118,6 +122,7 @@ int main(int argc, char** argv)
if (setrlimit(RLIMIT_AS, &rl) == -1)
printf("WARNING! Could not set resource limit:
Virtual memory.\n");
} }
+#endif
if (argc == 1)
printf("Reading from standard input... Use '--help' for
help.\n");
@@ -146,7 +151,9 @@ int main(int argc, char** argv)
// Change to signal-handlers that will only notify the solver
and allow it to terminate
// voluntarily:
signal(SIGINT, SIGINT_interrupt);
+#ifdef SIGXCPU
signal(SIGXCPU,SIGINT_interrupt);
+#endif
if (!S.simplify()){
if (res != NULL) fprintf(res, "UNSAT\n"), fclose(res);
diff --git a/minisat-2.2.0/simp/Main.cc b/minisat-2.2.0/simp/Main.cc
index e59d73b..af7da39 100644
--- a/minisat-2.2.0/simp/Main.cc
+++ b/minisat-2.2.0/simp/Main.cc
@@ -22,7 +22,9 @@ OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWA
#include <signal.h>
#include <zlib.h>
+#if !defined(_MSC_VER) && !defined(__MINGW32__)
#include <sys/resource.h>
+#endif
#include "utils/System.h"
#include "utils/ParseUtils.h"
@@ -100,8 +102,11 @@ int main(int argc, char** argv)
// Use signal handlers that forcibly quit until the solver
will be able to respond to
// interrupts:
signal(SIGINT, SIGINT_exit);
+#ifdef SIGXCPU
signal(SIGXCPU,SIGINT_exit);
+#endif
+#if !defined(_MSC_VER) && !defined(__MINGW32__)
// Set limit on CPU-time:
if (cpu_lim != INT32_MAX){
rlimit rl;
@@ -122,6 +127,7 @@ int main(int argc, char** argv)
if (setrlimit(RLIMIT_AS, &rl) == -1)
printf("WARNING! Could not set resource limit:
Virtual memory.\n");
} }
+#endif
if (argc == 1)
printf("Reading from standard input... Use '--help' for
help.\n");
@@ -149,7 +155,9 @@ int main(int argc, char** argv)
// Change to signal-handlers that will only notify the solver
and allow it to terminate
// voluntarily:
signal(SIGINT, SIGINT_interrupt);
+#ifdef SIGXCPU
signal(SIGXCPU,SIGINT_interrupt);
+#endif
S.eliminate(true);
double simplified_time = cpuTime();