From bd25bee356da7382af8fb5bb117647ed9cbd66eb Mon Sep 17 00:00:00 2001 From: "lperron@google.com" Date: Sun, 2 Sep 2012 15:20:21 +0000 Subject: [PATCH] improved python/java/.NET archives, available on all platforms, with license and readme file --- examples/csharp/solution/Flow.csproj | 2 +- .../csharp/solution/IntegerProgramming.csproj | 2 +- examples/csharp/solution/Knapsack.csproj | 2 +- .../csharp/solution/LinearProgramming.csproj | 2 +- .../csharp/solution/RabbitsPheasants.csproj | 2 +- examples/csharp/solution/Tsp.csproj | 2 +- makefiles/Makefile.csharp.mk | 22 +++--- makefiles/Makefile.java.mk | 4 +- makefiles/Makefile.python.mk | 73 ++++++++++--------- makefiles/Makefile.unix | 1 + makefiles/Makefile.win | 1 + setup.cfg | 2 - setup.py | 70 ------------------ tools/README.dotnet | 40 ++++++++++ tools/README.java | 28 +++++++ tools/README.python | 31 ++++++++ tools/setup.py | 32 ++++++++ 17 files changed, 192 insertions(+), 124 deletions(-) delete mode 100644 setup.cfg delete mode 100644 setup.py create mode 100644 tools/README.dotnet create mode 100644 tools/README.java create mode 100644 tools/README.python create mode 100644 tools/setup.py diff --git a/examples/csharp/solution/Flow.csproj b/examples/csharp/solution/Flow.csproj index b1b6c06c53..9f0ae43328 100644 --- a/examples/csharp/solution/Flow.csproj +++ b/examples/csharp/solution/Flow.csproj @@ -53,7 +53,7 @@ - ..\..\..\bin\Google.OrTools.Graph.dll + ..\..\bin\Google.OrTools.Graph.dll diff --git a/examples/csharp/solution/IntegerProgramming.csproj b/examples/csharp/solution/IntegerProgramming.csproj index 314bbf9fbd..c62dddff59 100644 --- a/examples/csharp/solution/IntegerProgramming.csproj +++ b/examples/csharp/solution/IntegerProgramming.csproj @@ -53,7 +53,7 @@ - ..\..\..\bin\Google.OrTools.LinearSolver.dll + ..\..\bin\Google.OrTools.LinearSolver.dll diff --git a/examples/csharp/solution/Knapsack.csproj b/examples/csharp/solution/Knapsack.csproj index 1fdad94f71..abcd9ba62f 100644 --- a/examples/csharp/solution/Knapsack.csproj +++ b/examples/csharp/solution/Knapsack.csproj @@ -53,7 +53,7 @@ - ..\..\..\bin\Google.OrTools.Algorithms.dll + ..\..\bin\Google.OrTools.Algorithms.dll diff --git a/examples/csharp/solution/LinearProgramming.csproj b/examples/csharp/solution/LinearProgramming.csproj index 250334d931..61f0d74155 100644 --- a/examples/csharp/solution/LinearProgramming.csproj +++ b/examples/csharp/solution/LinearProgramming.csproj @@ -53,7 +53,7 @@ - ..\..\..\bin\Google.OrTools.LinearSolver.dll + ..\..\bin\Google.OrTools.LinearSolver.dll diff --git a/examples/csharp/solution/RabbitsPheasants.csproj b/examples/csharp/solution/RabbitsPheasants.csproj index c4c2fd1b04..e02e35f7c0 100644 --- a/examples/csharp/solution/RabbitsPheasants.csproj +++ b/examples/csharp/solution/RabbitsPheasants.csproj @@ -56,7 +56,7 @@ - ..\..\..\bin\Google.OrTools.ConstraintSolver.dll + ..\..\bin\Google.OrTools.ConstraintSolver.dll diff --git a/examples/csharp/solution/Tsp.csproj b/examples/csharp/solution/Tsp.csproj index 28fd2d13db..c2c174c504 100644 --- a/examples/csharp/solution/Tsp.csproj +++ b/examples/csharp/solution/Tsp.csproj @@ -56,7 +56,7 @@ - ..\..\..\bin\Google.OrTools.ConstraintSolver.dll + ..\..\bin\Google.OrTools.ConstraintSolver.dll diff --git a/makefiles/Makefile.csharp.mk b/makefiles/Makefile.csharp.mk index 84e9991544..05efb0674d 100644 --- a/makefiles/Makefile.csharp.mk +++ b/makefiles/Makefile.csharp.mk @@ -189,9 +189,9 @@ ifeq ("$(SYSTEM)","win") tools\mkdir temp\or-tools.$(PORT) tools\mkdir temp\or-tools.$(PORT)\bin tools\mkdir temp\or-tools.$(PORT)\examples - tools\mkdir temp\or-tools.$(PORT)\examples\csharp - tools\mkdir temp\or-tools.$(PORT)\examples\csharp\solution - tools\mkdir temp\or-tools.$(PORT)\examples\csharp\solution\Properties + tools\mkdir temp\or-tools.$(PORT)\examples\ + tools\mkdir temp\or-tools.$(PORT)\examples\solution + tools\mkdir temp\or-tools.$(PORT)\examples\solution\Properties tools\mkdir temp\or-tools.$(PORT)\data tools\mkdir temp\or-tools.$(PORT)\data\discrete_tomography tools\mkdir temp\or-tools.$(PORT)\data\fill_a_pix @@ -200,11 +200,12 @@ ifeq ("$(SYSTEM)","win") tools\mkdir temp\or-tools.$(PORT)\data\survo_puzzle tools\mkdir temp\or-tools.$(PORT)\data\quasigroup_completion copy LICENSE-2.0.txt temp$Sor-tools.$(PORT) + copy tools\README.dotnet temp\or-tools.$(PORT)\README copy bin\Google.OrTools.*.dll temp\or-tools.$(PORT)\bin - copy examples\csharp\*.cs temp\or-tools.$(PORT)\examples\csharp - copy examples\csharp\*.sln temp\or-tools.$(PORT)\examples\csharp - copy examples\csharp\solution\*.csproj temp\or-tools.$(PORT)\examples\csharp\solution - copy examples\csharp\solution\Properties\*.cs temp\or-tools.$(PORT)\examples\csharp\solution\Properties + copy examples\csharp\*.cs temp\or-tools.$(PORT)\examples + copy examples\csharp\*.sln temp\or-tools.$(PORT)\examples + copy examples\csharp\solution\*.csproj temp\or-tools.$(PORT)\examples\solution + copy examples\csharp\solution\Properties\*.cs temp\or-tools.$(PORT)\examples\solution\Properties copy data\discrete_tomography\* temp\or-tools.$(PORT)\data\discrete_tomography copy data\fill_a_pix\* temp\or-tools.$(PORT)\data\fill_a_pix copy data\minesweeper\* temp\or-tools.$(PORT)\data\minesweeper @@ -216,9 +217,7 @@ else mkdir temp mkdir temp/or-tools.$(PORT) mkdir temp/or-tools.$(PORT)/bin - mkdir temp/or-tools.$(PORT)/lib mkdir temp/or-tools.$(PORT)/examples - mkdir temp/or-tools.$(PORT)/examples/csharp mkdir temp/or-tools.$(PORT)/data mkdir temp/or-tools.$(PORT)/data/discrete_tomography mkdir temp/or-tools.$(PORT)/data/fill_a_pix @@ -227,9 +226,10 @@ else mkdir temp/or-tools.$(PORT)/data/survo_puzzle mkdir temp/or-tools.$(PORT)/data/quasigroup_completion cp LICENSE-2.0.txt temp/or-tools.$(PORT) + cp tools/README.dotnet temp/or-tools.$(PORT)/README cp bin/Google.OrTools.*.dll temp/or-tools.$(PORT)/bin - cp lib/libGoogle.OrTools.*.so temp/or-tools.$(PORT)/lib - cp examples/csharp/*.cs temp/or-tools.$(PORT)/examples/csharp + cp lib/libGoogle.OrTools.*.so temp/or-tools.$(PORT)/bin + cp examples/csharp/*.cs temp/or-tools.$(PORT)/examples cp data/discrete_tomography/* temp/or-tools.$(PORT)/data/discrete_tomography cp data/fill_a_pix/* temp/or-tools.$(PORT)/data/fill_a_pix cp data/minesweeper/* temp/or-tools.$(PORT)/data/minesweeper diff --git a/makefiles/Makefile.java.mk b/makefiles/Makefile.java.mk index aa76ddb2a7..e4e5a9ba98 100644 --- a/makefiles/Makefile.java.mk +++ b/makefiles/Makefile.java.mk @@ -362,9 +362,11 @@ java_archive: java $(MKDIR) temp $(MKDIR) temp$Sor-tools.$(PORT) $(MKDIR) temp$Sor-tools.$(PORT)$Slib + $(MKDIR) temp$Sor-tools.$(PORT)$Sobjs $(COPY) LICENSE-2.0.txt temp$Sor-tools.$(PORT) + $(COPY) tools$SREADME.java temp$Sor-tools.$(PORT)$SREADME $(COPY) lib$S*.jar temp$Sor-tools.$(PORT)$Slib - $(COPY) $(LIB_DIR)$S$(LIBPREFIX)jni*.$(JNI_LIB_EXT) temp$Sor-tools.$(PORT)$Slib + $(COPY) lib$S$(LIBPREFIX)jni*.$(JNI_LIB_EXT) temp$Sor-tools.$(PORT)$Slib ifeq ("$(SYSTEM)","win") tools\mkdir temp\or-tools.$(PORT)\examples tools\mkdir temp\or-tools.$(PORT)\examples\com diff --git a/makefiles/Makefile.python.mk b/makefiles/Makefile.python.mk index c7f82e7f02..d9b8c543cd 100644 --- a/makefiles/Makefile.python.mk +++ b/makefiles/Makefile.python.mk @@ -125,39 +125,44 @@ python_archive: python $(MKDIR) temp $(MKDIR) temp$Sor-tools.$(PORT) $(MKDIR) temp$Sor-tools.$(PORT)$Sexamples - $(MKDIR) temp$Sor-tools.$(PORT)$Sexamples$Spython - $(MKDIR) temp$Sor-tools.$(PORT)$Ssrc - $(MKDIR) temp$Sor-tools.$(PORT)$Ssrc$Sconstraint_solver - $(MKDIR) temp$Sor-tools.$(PORT)$Ssrc$Slinear_solver - $(MKDIR) temp$Sor-tools.$(PORT)$Ssrc$Sgraph - $(MKDIR) temp$Sor-tools.$(PORT)$Ssrc$Salgorithms - $(MKDIR) temp$Sor-tools.$(PORT)$Ssrc$Sgen - $(MKDIR) temp$Sor-tools.$(PORT)$Ssrc$Sgen$Sconstraint_solver - $(MKDIR) temp$Sor-tools.$(PORT)$Ssrc$Sgen$Slinear_solver - $(MKDIR) temp$Sor-tools.$(PORT)$Ssrc$Sgen$Sgraph - $(MKDIR) temp$Sor-tools.$(PORT)$Ssrc$Sgen$Salgorithms - $(COPY) LICENSE-2.0.txt temp$Sor-tools.$(PORT) - $(COPY) examples$Spython$S*.py temp$Sor-tools.$(PORT)$Sexamples$Spython - $(COPY) src$Sgen$Sconstraint_solver$S*.py temp$Sor-tools.$(PORT)$Ssrc$Sgen$Sconstraint_solver - $(COPY) src$Sgen$Slinear_solver$S*.py temp$Sor-tools.$(PORT)$Ssrc$Sgen$Slinear_solver - $(COPY) src$Sgen$Sgraph$S*.py temp$Sor-tools.$(PORT)$Ssrc$Sgen$Sgraph - $(COPY) src$Sgen$Salgorithms$S*.py temp$Sor-tools.$(PORT)$Ssrc$Sgen$Salgorithms - $(COPY) src$Sconstraint_solver$S*.py temp$Sor-tools.$(PORT)$Ssrc$Sconstraint_solver - $(COPY) src$Slinear_solver$S*.py temp$Sor-tools.$(PORT)$Ssrc$Slinear_solver - $(COPY) src$Sgraph$S*.py temp$Sor-tools.$(PORT)$Ssrc$Sgraph - $(COPY) src$Salgorithms$S*.py temp$Sor-tools.$(PORT)$Ssrc$Salgorithms -ifeq ("$(SYSTEM)","win") - cd temp$Sor-tools.$(PORT) && ..\..\tools\tar.exe -C ..$S.. -c -v --exclude *svn* data | ..\..\tools\tar.exe xvm - $(COPY) src$Sgen$Sconstraint_solver$S_pywrapcp.pyd temp$Sor-tools.$(PORT)$Ssrc$Sgen$Sconstraint_solver - $(COPY) src$Sgen$Sconstraint_solver$S_pywraprouting.pyd temp$Sor-tools.$(PORT)$Ssrc$Sgen$Sconstraint_solver - $(COPY) src$Sgen$Slinear_solver$S_pywraplp.pyd temp$Sor-tools.$(PORT)$Ssrc$Sgen$Slinear_solver - $(COPY) src$Sgen$Sgraph$S_pywrapgraph.pyd temp$Sor-tools.$(PORT)$Ssrc$Sgen$Sgraph - $(COPY) src$Sgen$Salgorithms$S_pywrapknapsack_solver.pyd temp$Sor-tools.$(PORT)$Ssrc$Sgen$Salgorithms - cd temp && ..$Stools$Szip.exe -r ..$SGoogle.OrTools.python.$(PORT).$(SVNVERSION).zip or-tools.$(PORT) - $(WINDOWS_PYTHON_PATH)$Spython dependencies\sources\googlecode-support\scripts\googlecode_upload.py -s "Google OR-Tools, Python archive, $(PORT) platform, svn release $(SVNVERSION)" -p or-tools -l Type-Achive,$(CODEPORT),Featured Google.OrTools.python.$(PORT).$(SVNVERSION).zip -u $(USER) -w $(PASSWORD) + $(MKDIR) temp$Sor-tools.$(PORT)$Sdata + $(MKDIR) temp$Sor-tools.$(PORT)$Sconstraint_solver + $(MKDIR) temp$Sor-tools.$(PORT)$Slinear_solver + $(MKDIR) temp$Sor-tools.$(PORT)$Sgraph + $(MKDIR) temp$Sor-tools.$(PORT)$Salgorithms + $(COPY) src$Sgen$Sconstraint_solver$Spywrapcp.py temp$Sor-tools.$(PORT)$Sconstraint_solver + $(COPY) src$Sgen$Sconstraint_solver$Spywraprouting.py temp$Sor-tools.$(PORT)$Sconstraint_solver + $(COPY) src$Sgen$Slinear_solver$Spywraplp.py temp$Sor-tools.$(PORT)$Slinear_solver + $(COPY) src$Sgen$Sgraph$Spywrapgraph.py temp$Sor-tools.$(PORT)$Sgraph + $(COPY) src$Sgen$Salgorithms$Spywrapknapsack_solver.py temp$Sor-tools.$(PORT)$Salgorithms + $(COPY) lib$S_pywrapcp.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sconstraint_solver + $(COPY) lib$S_pywraprouting.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sconstraint_solver + $(COPY) lib$S_pywraplp.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Slinear_solver + $(COPY) lib$S_pywrapgraph.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Sgraph + $(COPY) lib$S_pywrapknapsack_solver.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT)$Salgorithms + $(COPY) examples$Spython$S*.py temp$Sor-tools.$(PORT)$Sexamples + $(TOUCH) temp$Sor-tools.$(PORT)$Sconstraint_solver$S__init__.py + $(TOUCH) temp$Sor-tools.$(PORT)$Slinear_solver$S__init__.py + $(TOUCH) temp$Sor-tools.$(PORT)$Sgraph$S__init__.py + $(TOUCH) temp$Sor-tools.$(PORT)$Salgorithms$S__init__.py + $(COPY) tools$SREADME.python temp$Sor-tools.$(PORT)$SREADME + $(COPY) tools$Ssetup.py temp$Sor-tools.$(PORT) + $(SED) -i -e 's/VVVV/$(shell svnversion)/' temp$Sor-tools.$(PORT)$Ssetup.py +ifeq ($(SYSTEM),win) + -del temp\or-tools.$(PORT)\setup.py-e + cd temp\or-tools.$(PORT) && ..\..\tools\tar.exe -C ..\.. -c -v --exclude *svn* --exclude *roadef* data | ..\..\tools\tar.exe xvm + cd temp && ..\tools\zip.exe -r ..\Google.OrTools.python.$(PORT).$(SVNVERSION).zip or-tools.$(PORT) else - cd temp$Sor-tools.$(PORT) && tar -C ..$S.. -c -v --exclude \*svn\* data | tar xvm - - $(COPY) _pywrap*.$(DYNAMIC_SWIG_LIB_SUFFIX) temp$Sor-tools.$(PORT) - cd temp && tar cvzf ..$SGoogle.OrTools.python.$(PORT).$(SVNVERSION).tar.gz or-tools.$(PORT) + $(SED) -i -e 's/\.dll/\.so/' temp/or-tools.$(PORT)/setup.py + -rm temp/or-tools.$(PORT)/setup.py-e + cd temp/or-tools.$(PORT) && tar -C ../.. -c -v --exclude *svn* --exclude *roadef* data | tar xvm + cd temp && tar cvzf ../Google.OrTools.python.$(PORT).$(SVNVERSION).tar.gz or-tools.$(PORT) endif - -$(DELREC) temp + +python_upload: python_archive +ifeq ($(SYSTEM),win) + $(WINDOWS_PYTHON_PATH)\python.exe dependencies\sources\googlecode-support\scripts\googlecode_upload.py -s "Google OR-Tools, Python archive, $(PORT) platform, svn release $(SVNVERSION)" -p or-tools -l Type-Achive,$(CODEPORT),Featured Google.OrTools.python.$(PORT).$(SVNVERSION).zip -u $(USER) -w $(PASSWORD) +else + python$(UNIX_PYTHON_VERSION) dependencies/sources/googlecode-support/scripts/googlecode_upload.py -s "Google OR-Tools, Python archive, $(PORT) platform, svn release $(SVNVERSION)" -p or-tools -l Type-Achive,$(CODEPORT),Featured Google.OrTools.python.$(PORT).$(SVNVERSION).tar.gz -u $(USER) -w $(PASSWORD) +endif + diff --git a/makefiles/Makefile.unix b/makefiles/Makefile.unix index a531fd2700..c997f718ff 100644 --- a/makefiles/Makefile.unix +++ b/makefiles/Makefile.unix @@ -30,6 +30,7 @@ DEL = rm -f DELREC = rm -rf S = / CPSEP = : +SED = sed # This is needed to find python.h PYTHON_INC = -I/usr/include/python$(UNIX_PYTHON_VER) -I/usr/lib/python$(UNIX_PYTHON_VER) diff --git a/makefiles/Makefile.win b/makefiles/Makefile.win index 067dadc319..136d6f4e60 100644 --- a/makefiles/Makefile.win +++ b/makefiles/Makefile.win @@ -34,6 +34,7 @@ DELREC = tools\rm.exe -rf MKDIR = md COPY = copy TOUCH = tools\touch.exe +SED = tools\sed.exe # Compilation macros. DEBUG=/O2 -DNDEBUG diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index 9350078fc8..0000000000 --- a/setup.cfg +++ /dev/null @@ -1,2 +0,0 @@ -[egg_info] -tag_svn_revision = 1 \ No newline at end of file diff --git a/setup.py b/setup.py deleted file mode 100644 index fe0b763527..0000000000 --- a/setup.py +++ /dev/null @@ -1,70 +0,0 @@ -from setuptools import setup -from os.path import join as pjoin -from glob import glob as gg - -setup( - name='or-tools', - version='1.0', - install_requires = ['google-apputils >= 0.3'], - dependency_links = ['http://google-apputils-python.googlecode.com/files/'], - packages=[ - pjoin('src', 'constraint_solver'), - pjoin('src', 'gen', 'constraint_solver'), - pjoin('src', 'linear_solver'), - pjoin('src', 'gen', 'linear_solver'), - pjoin('src', 'graph'), - pjoin('src', 'gen', 'graph'), - pjoin('src', 'algorithms'), - pjoin('src', 'gen', 'algorithms'), - ], - data_files=[('lib', [ - pjoin('lib', '_pywrapcp.so'), - pjoin('lib', '_pywraprouting.so'), - pjoin('lib', '_pywraplp.so'), - pjoin('lib', '_pywrapknapsack_solver.so'), - pjoin('lib', '_pywrapgraph.so'), - ]), - ('or-tools', ['LICENSE-2.0.txt',]), - (pjoin('or-tools', 'examples', 'python'), - gg(pjoin('examples', 'python', '*.py'))), - (pjoin('or-tools', 'data', 'bacp'), - gg(pjoin('data', 'bacp', '*'))), - (pjoin('or-tools', 'data', 'cvrptw'), - gg(pjoin('data', 'cvrptw', '*'))), - (pjoin('or-tools', 'data', 'discrete_tomography'), - gg(pjoin('data', 'discrete_tomography', '*'))), - (pjoin('or-tools', 'data', 'et_jobshop', 'jet'), - gg(pjoin('data', 'et_jobshop', 'jet', '*'))), - (pjoin('or-tools', 'data', 'et_jobshop', 'dyn'), - gg(pjoin('data', 'et_jobshop', 'dyn', '*'))), - (pjoin('or-tools', 'data', 'fill_a_pix'), - gg(pjoin('data', 'fill_a_pix', '*'))), - (pjoin('or-tools', 'data', 'jobshop'), - gg(pjoin('data', 'jobshop', '*'))), - (pjoin('or-tools', 'data', 'minesweeper'), - gg(pjoin('data', 'minesweeper', '*'))), - (pjoin('or-tools', 'data', 'multidim_knapsack'), - gg(pjoin('data', 'multidim_knapsack', '*'))), - (pjoin('or-tools', 'data', 'nonogram_regular'), - gg(pjoin('data', 'nonogram_regular', '*'))), - (pjoin('or-tools', 'data', 'pdptw'), - gg(pjoin('data', 'pdptw', '*'))), - (pjoin('or-tools', 'data', 'quasigroup_completion'), - gg(pjoin('data', 'quasigroup_completion', '*'))), - (pjoin('or-tools', 'data', 'rogo'), - gg(pjoin('data', 'rogo', '*'))), - (pjoin('or-tools', 'data', 'steel_mill'), - gg(pjoin('data', 'steel_mill', '*'))), - (pjoin('or-tools', 'data', 'strimko'), - gg(pjoin('data', 'strimko', '*'))), - (pjoin('or-tools', 'data', 'survo_puzzleX'), - gg(pjoin('data', 'survo_puzzle', '*'))), - ], - license='Apache 2.0', - author = "Google Inc", - author_email = "lperron@google.com", - description = "Google OR-Tools", - keywords = ("operations research, constraint programming, " + - "linear programming"), - url = "http://code.google.com/p/or-tools/", -) diff --git a/tools/README.dotnet b/tools/README.dotnet new file mode 100644 index 0000000000..25751afb42 --- /dev/null +++ b/tools/README.dotnet @@ -0,0 +1,40 @@ +This file describes how to use the or-tools .NET binary archive. + +OR-Tools is located at http://code.google.com/p/or-tools + +This module has been tested under: + - ubuntu 10.04 and up (32 and 64 bit). + - Mac OS X Snow Leopard with xcode 3.2.x and 4.x (64 bit) + - Mac OS X Lion with xcode 4.x (64 bit). + - Microsoft Windows with Visual Studio 2010 express C++ and + Visual studio 2010 (32 and 64 bit). + +Upon decompressing the archive, you will get the following structure: + +or-tools/ + LICENSE-2.0.txt <- Apache License + README <- This file + data/ <- Data for the examples + examples/ <- C# examples + bin/ <- Directory containing assemblies and native libraries + +Running the examples will involve compiling them, then running them. + +Let's compile examples/csflow.cs and run it. + +on windows 32 bit: + csc /target:exe /out:csflow.exe /platform:x86 /lib:bin /r:Google.OrTools.Graph.dll examples\csflow.cs + csflow.exe + +on windows 64 bit: + csc /target:exe /out:csflow.exe /platform:x64 /lib:bin /r:Google.OrTools.Graph.dll examples\csflow.cs + csflow.exe + +On linux (mono comes from the distribution, on ubuntu at least) + mono-csc /target:exe /out:csflow.exe /platform:anycpu /lib:bin /r:Google.OrTools.Graph.dll examples/csflow.cs + MONO_PATH=bin mono csflow.exe + +On Mac OS X (mono is compiled under dependencies/install) + dependencies\install\bin\mcs /target:exe /out:csflow.exe /platform:anycpu /lib:bin /r:Google.OrTools.Graph.dll examples/csflow.cs + MONO_PATH=bin dependencies\install\bin\mono csflow.exe + diff --git a/tools/README.java b/tools/README.java new file mode 100644 index 0000000000..e67c109fb5 --- /dev/null +++ b/tools/README.java @@ -0,0 +1,28 @@ +This file describes how to use the or-tools java binary archive. + +OR-Tools is located at http://code.google.com/p/or-tools + +This module has been tested under: + - ubuntu 10.04 and up (32 and 64 bit). + - Mac OS X Snow Leopard with xcode 3.2.x and 4.x (64 bit) + - Mac OS X Lion with xcode 4.x (64 bit). + - Microsoft Windows with Visual Studio 2010 express C++ and + Visual studio 2010 (32 and 64 bit). + +Upon decompressing the archive, you will get the following structure: + +or-tools/ + LICENSE-2.0.txt <- Apache License + README <- This file + data/ <- Data for the examples + examples/ <- Java examples + lib/ <- Directory containing jar files and native libraries + objs/ <- Directory that will contain compiled classes + +Running the examples will involve compiling them, then running them. + +Let's compile and run +examples/com/google/ortools/constraintsolver/samples/RabbitsPheasants.java + +javac -d objs -cp lib/com.google.ortools.constraintsolver.jar examples/com/google/ortools/constraintsolver/samples/RabbitsPheasants.java +java -Djava.library.path=lib -cp objs:lib/com.google.ortools.constraintsolver.jar com.google.ortools.constraintsolver.samples.RabbitsPheasants diff --git a/tools/README.python b/tools/README.python new file mode 100644 index 0000000000..da3021862c --- /dev/null +++ b/tools/README.python @@ -0,0 +1,31 @@ +This file describes how to install the or-tools python binary archive. + +OR-Tools is located at http://code.google.com/p/or-tools + +These modules have been tested under: + - ubuntu 10.04 and up (32 and 64 bit). + - Mac OS X Snow Leopard with xcode 3.2.x and 4.x (64 bit) + - Mac OS X Lion with xcode 4.x (64 bit). + - Microsoft Windows with Visual Studio 2010 express C++ and + Visual studio 2010 (32 and 64 bit). + +Upon decompressing the archive, you will get the following structure: + +or-tools/ + LICENSE-2.0.txt <- Apache License + README <- This file + data/ <- Data for the examples. + examples/ <- Python examples + algorithms/ <- Directory containing non-graph algorithms. + constraint_solver/ <- The main directory for the constraint library. + graph/ <- Graph algorithms. + linear_solver/ <- Linear solver wrapper. + + +To install the package, please run: + sudo python setup.py install +or + python setup.py install --user + +Once this is done, you can run the samples in the examples/ directory. +As in python examples/hidato_puzzle.py diff --git a/tools/setup.py b/tools/setup.py new file mode 100644 index 0000000000..4e750e40d7 --- /dev/null +++ b/tools/setup.py @@ -0,0 +1,32 @@ +from setuptools import setup +from os.path import join as pjoin + +setup( + name='or-tools', + version='1.0.VVVV', + packages=[ 'constraint_solver', + 'linear_solver', + 'graph', + 'algorithms' + ], + install_requires = ['google-apputils >= 0.3', 'or-tools-module'], + dependency_links = ['http://google-apputils-python.googlecode.com/files/'], + data_files=[('constraint_solver', + [pjoin('constraint_solver', '_pywrapcp.dll'), + pjoin('constraint_solver', '_pywraprouting.dll']), + ('linear_solver', + [pjoin('linear_solver', '_pywraplp.dll'), ]), + ('graph', + [pjoin('graph', '_pywrapgraph.dll'), ]), + ('algorithms', + [pjoin('algorithms', '_pywrapknapsack_solver.dll'), ]), + ], + license='Apache 2.0', + author = "Google Inc", + author_email = "lperron@google.com", + description = "Google OR-Tools Python Module", + keywords = ("operations research, constraint programming, " + + "linear programming" + "flow algorithms" + + "python"), + url = "http://code.google.com/p/or-tools/", +)