Using Constraint Solver Sugar on Microsoft Windows with Cygwin
Last modified: Mon Feb 23 11:20:02 2009 JST
Currently, you need Cygwin to run
the constraint solver system Sugar on Microsoft Windows.
Installation of Cygwin
- You need at least 4G bytes free disk space and a few hours
(depending on your computer network connection speed) to install Cygwin.
- Visit http://www.cygwin.com
and download "setup.exe".
- Double click "setup.exe" to start installation.
- "Select Root Install Directory"
- Input "C:\cygwin" or any other appropriate folder for the Root Directory.
- "Select Packages"
- Click "All" ("Default" will be changed to "Install")
- Proceed the installation procedure following the instructions.
- After the installation, "Cygwin" icon will appear on your desktop,
- Double click "Cygwin" icon to open Cygwin terminal.
If Cygwin terminal window appears and no error messages are shown,
Cygwin is successfully installed.
- "C:\cygwin\home\your_login_name"
(or other directory depending on what you input for the Root Directory)
is your home directory under Cygwin environment.
- If you want to add/update/remove software packages later,
run "setup.exe" again.
- If you didn't select "All" in the above,
the MiniSat solver might not work correctly.
Installation of MiniSat
Installation of Sun Java JDK (Java SE Development Kit)
- About 250M bytes free disk space is required to install Java JDK.
- Visit http://java.sun.com/javase/
and download "JDK 6 Update 6" or a newer version installer.
- Run the downloaded JDK installer.
- Follow the instructions to proceed installation.
- Check the folder name where the Java JDK commands are installed.
- Under standard installation procedure,
Java JDK is installed in "C:\Program Files\Java" folder and
the Java commands are located in "C:\Program Files\Java\jdk1.6.0_06\bin" folder.
- Set PATH environment variable as follows.
- Right-click "My Computer", and then click Properties.
- Click the Advanced tab.
- Click Environment variables.
- Click "New" of a user environment variable
(not system environment variable).
- Type "PATH" for a variable name, and
"C:\Program Files\Java\jdk1.6.0_06\bin"
(the folder name where the Java commands are installed)
for the variable value.
- Open Cygwin terminal and check the installation as follows.
Installation of Sugar
- Visit Sugar web page
and download "sugar-v1-12.zip" and
move the downloaded zip file to your Cygwin home directory
(C:\cygwin\home\your_login_name).
- Alternatively, open Cygwin terminal and type
"wget http://bach.istc.kobe-u.ac.jp/sugar/sugar-v1-12.zip".
- Open Cygwin terminal.
- Type "unzip sugar-v1-12.zip".
- Type "cd sugar-v1-12".
- Type "nano bin/sugar" to edit the sugar command script.
- Change the first part as follows and save.
my $java = "java";
my $jar = "'C:\\cygwin\\home\\your_login_name\\sugar-v1-12\\bin\\sugar-v1-12.jar'";
my $solver = "minisat";
my $tmp = "sugar$$";
- Type "head bin/sugar" in Cygwin terminal to check your editing was correct.
- Type "bin/sugar examples/nqueens-8.csp" to run an example.
s SATISFIABLE
a q_1 4
a q_2 2
a q_3 8
a q_4 6
a q_5 1
a q_6 3
a q_7 5
a q_8 7
a
- Type "cp bin/sugar /usr/local/bin" to copy the sugar script to
"/usr/local/bin" directory so that you can run sugar without specifying
its location.
- Type "sugar examples/nqueens-8.csp" to confirm.
Naoyuki Tamura