Files
ortools-clone/tools/README.cc.java.csharp

69 lines
2.5 KiB
Plaintext
Raw Normal View History

This file describes how to install the or-tools C++, java and .Net binary archive.
OR-Tools is located at https://developers.google.com/optimization
These modules have been tested under:
- ubuntu 14.04 and up (32 and 64 bit).
- Mac OS X El Capitan and up with xcode 4.x (64 bit).
- Microsoft Visual studio 2013 and 2015 (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
Makefile/ <- Main makefile for cpp
examples/ <- C++, java and .Net examples
lib/
lib/cpp/ <- directory containing the ortools complete libraries for cpp
lib/java/ <- directory containing jar files and native libraries
lib/csharp <- directory containing assemblies and native libraries
include/ <- all include files
objs/ <- directory containing C++ compiled object files (*.o)
bin/ <- directory containing executable files
########################## C++ ###########################
Use Makefile
########################## java ##########################
Running the examples will involve compiling them, then running them.
Let's compile and run
examples/com/google/ortools/samples/RabbitsPheasants.java
javac -d objs -cp lib/com.google.ortools.jar:lib/protobuf.jar examples/com/google/ortools/samples/RabbitsPheasants.java
java -Djava.library.path=lib -cp objs:lib/com.google.ortools.jar com.google.ortools.samples.RabbitsPheasants
########################## .Net ##########################
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:bin\csharp\csflow.exe /platform:x86 /lib:lib /r:Google.OrTools.dll examples\csharp\csflow.cs
bin\csharp\csflow.exe
on windows 64 bit:
csc /target:exe /out:bin/csharp/csflow.exe /platform:x64 /lib:lib /r:Google.OrTools.dll examples\csflow.cs
bin\csharp\csflow.exe
On linux (mono comes from the distribution, on ubuntu at least)
mcs /target:exe /out:bin/csharp/csflow.exe /platform:anycpu /lib:lib /r:Google.OrTools.dll examples/csharp/csflow.cs
MONO_PATH=lib mono bin/csharp/csflow.exe
On Mac OS X (mono is compiled under dependencies/install)
dependencies\install\bin\mcs /target:exe /out:bin/csharp/csflow.exe /platform:anycpu /lib:lib /r:Google.OrTools.dll examples/csharp/csflow.cs
MONO_PATH=lib dependencies\install\bin\mono bin/csharp/csflow.exe