f43b4b64a90e0236b07875bea56d4b4361a14fd7
This file describes how to install the constraint-solver library and
run the c++ and python examples. This has been tested under ubuntu
10.10, Mac OS X Snow Leopard with xcode 3.2.3, and Microsoft Windows
with Visual Studio 2010 express C++.
Upon untarring the given operation_research tar file, you will get the
following structure:
operations_research-1.0/
LICENSE-2.0.txt <- Apache License
Makefile <- Makefile for unix platform (ubuntu linux, mac os X)
Makefile.msv <- Makefile for Microsoft Visual Studio
README <- This file
base/ <- Directory containing basic utilities.
constraint_solver/ <- The main directory for the constraint solver library
examples/ <- C++ examples
graph/ <- Graph algorithms used in the constraint solver
objs/ <- Where C++ objs files will be stored
python/ <- Python examples
util/ <- More utilities needed by the constraint solver
First, you will need to install the google-gflags library, compile it
and install it. It can be obtained at the following address:
http://code.google.com/p/google-gflags/
By default, the makefile assumes the installation path is
../gflags-1.3 from the Makefile, thus at the same level as the
operations_research directory.
Then you need to install zlib. The makefile default path is
../zlib-1.2.5 from the location of the makefile.
Please edit the top of the makefile to accomodate your installation.
On Microsoft Windows, please do the following:
- decompress the gflags directory, do not compile it
- modify the Makefile.msv to point to the source of the gflags source
directory.
- install the zlib source archive, step into it
and run "nmake -f win32/Makefile.msc" directly at this point.
(please note that there is a bug in zlib-1.2.5 makefile as the OBJS
list of files misses the inffast.obj entry).
- modify the Makefile.msv to point to the root of the zlib source tree.
You can then compile the library, examples (linux, mac, and windows)
and python wrapping (linux, mac):
make (linux, mac)
nmake -f Makefile.msv (windows)
To compile in debug mode, please use
make DEBUG=-g (linux, mac)
nmake -f Makefile.msv DEBUG="/Od /Zi"
You can clean everything using
make clean (linux, mac)
nmake -f Makefile.msv clean (windows)
When everything is compiled, you will find under operations_research:
3 libraries (libcp.a, libutil.a and libbase.a) for unix, or
4 libraries (cp.lib, util.lib, base.lib and gflags.dll) for Windows
One binary per C++ example (e.g. nqueens or nqueens.exe on Windows)
A C++ wrapping library (_pywrapcp.so)
You can execute C++ examples just by running then:
./magic_square (linux, mac)
magic_square.exe (windows)
For the python examples, as we have not installed the
constraint_solver module, we need to use the following command:
PYTHONPATH= <python_binary> python/<sample.py>
As in
PYTHONPATH= python2.6 python/golomb8.py
This has been tested with python 2.5 and 2.6.
The wrapping using SWIG has been tested with SWIG 1.3.40 and 1.3.31.
Description
Languages
C++
80.1%
Python
6.3%
Julia
3.2%
Starlark
2.2%
C#
2.1%
Other
6%