fix readme and makefile for archives

This commit is contained in:
Laurent Perron
2016-07-21 11:46:20 -07:00
parent 922384cd57
commit 21b96d28c5
2 changed files with 106 additions and 162 deletions

View File

@@ -5,24 +5,24 @@
# Let's discover something about where we run
ifeq "$(SHELL)" "cmd.exe"
SYSTEM = win
SYSTEM = win
else
ifeq "$(SHELL)" "sh.exe"
SYSTEM = win
else
SYSTEM = unix
endif
ifeq "$(SHELL)" "sh.exe"
SYSTEM = win
else
SYSTEM = unix
endif
endif
# Define the OR_ROOT directory.
ifeq ($(OR_TOOLS_TOP),)
OR_ROOT =
OR_ROOT =
else
ifeq "$(SYSTEM)" "win"
OR_ROOT = $(OR_TOOLS_TOP)\\
else
OR_ROOT = $(OR_TOOLS_TOP)/
endif
ifeq "$(SYSTEM)" "win"
OR_ROOT = $(OR_TOOLS_TOP)\\
else
OR_ROOT = $(OR_TOOLS_TOP)/
endif
endif
# Useful directories.
@@ -34,120 +34,75 @@ INC_DIR = $(OR_ROOT)include
# Unix specific part.
ifeq ("$(SYSTEM)","unix")
OS = $(shell uname -s)
ifeq ($(OS),Linux)
CCC = g++ -fPIC -std=c++0x
LD_FLAGS = -lz -lrt -lpthread
# Defines OR_TOOLS_TOP if it is not already defined.
OR_TOOLS_TOP ?= $(shell pwd)
OS = $(shell uname -s)
ifeq ($(OS),Linux)
CCC = g++ -fPIC -std=c++0x
LD_FLAGS = -lz -lrt -lpthread
# Defines OR_TOOLS_TOP if it is not already defined.
OR_TOOLS_TOP ?= $(shell pwd)
OR_TOOLS_LIB_PRE = -Wl,-rpath $(OR_TOOLS_TOP)/lib -L$(OR_TOOLS_TOP)/lib
<<<<<<< HEAD
ORTOOLS_LIB = $(OR_TOOLS_LIB_PRE) -lortools $(OR_TOOLS_LIB_PRE) -lcvrptw_lib $(OR_TOOLS_LIB_PRE) -lfz $(OR_TOOLS_LIB_PRE) -ldimacs
=======
<<<<<<< HEAD
<<<<<<< HEAD
ORTOOLS_LIB = $(OR_TOOLS_LIB_PRE) -lortools $(OR_TOOLS_LIB_PRE) -lcvrptw_lib $(OR_TOOLS_LIB_PRE) -ldimacs
=======
ORTOOLS_LIB = $(OR_TOOLS_LIB_PRE) -lortools $(OR_TOOLS_LIB_PRE) -lcvrptw_lib $(OR_TOOLS_LIB_PRE) -lfz $(OR_TOOLS_LIB_PRE) -ldimacs
>>>>>>> 4ea00a8a3aaf87b3831f4a47e31df5fb028eb4d7
=======
ORTOOLS_LIB = $(OR_TOOLS_LIB_PRE) -lortools $(OR_TOOLS_LIB_PRE) -lcvrptw_lib $(OR_TOOLS_LIB_PRE) -lfz $(OR_TOOLS_LIB_PRE) -ldimacs
>>>>>>> 4ea00a8a3aaf87b3831f4a47e31df5fb028eb4d7
>>>>>>> archives fixes for windows
LBITS = $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
PORT = Linux64
ARCH = -DARCH_K8
else
PORT = Linux32
endif
endif
ifeq ($(OS),Darwin) # Assume Mac Os X
CCC = clang++ -fPIC -std=c++11
LD_FLAGS = -lz
<<<<<<< HEAD
ORTOOLS_LIB = -L$(OR_ROOT)lib -lortools -L$(OR_ROOT)lib -lcvrptw_lib -L$(OR_ROOT)lib -lfz -L$(OR_ROOT)lib -ldimacs
=======
<<<<<<< HEAD
<<<<<<< HEAD
ORTOOLS_LIB = -L$(OR_ROOT)lib -lortools -L$(OR_ROOT)lib -lcvrptw_lib -L$(OR_ROOT)lib -ldimacs
=======
ORTOOLS_LIB = -L$(OR_ROOT)lib -lortools -L$(OR_ROOT)lib -lcvrptw_lib -L$(OR_ROOT)lib -lfz -L$(OR_ROOT)lib -ldimacs
>>>>>>> 4ea00a8a3aaf87b3831f4a47e31df5fb028eb4d7
=======
ORTOOLS_LIB = -L$(OR_ROOT)lib -lortools -L$(OR_ROOT)lib -lcvrptw_lib -L$(OR_ROOT)lib -lfz -L$(OR_ROOT)lib -ldimacs
>>>>>>> 4ea00a8a3aaf87b3831f4a47e31df5fb028eb4d7
>>>>>>> archives fixes for windows
ARCH = -DARCH_K8
PORT = MacOsX64
endif
O = o
E =
OBJ_OUT = -o #
EXE_OUT = -o #
DEL = rm -f
S = /
CLP_INC = -DUSE_CLP
CBC_INC = -DUSE_CBC
GLOP_INC = -DUSE_GLOP
BOP_INT = -DUSE_BOP
DEBUG = -O4 -DNDEBUG
CFLAGS = $(DEBUG) -I$(INC_DIR) -I$(INC_EX_DIR) $(ARCH) -Wno-deprecated \
$(CBC_INC) $(CLP_INC) $(GLOP_INC) $(BOP_INC)
ORTOOLS_LIB = $(OR_TOOLS_LIB_PRE) -lortools $(OR_TOOLS_LIB_PRE) -lcvrptw_lib $(OR_TOOLS_LIB_PRE) -lfz $(OR_TOOLS_LIB_PRE) -ldimacs
LBITS = $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)
PORT = Linux64
ARCH = -DARCH_K8
else
PORT = Linux32
endif
endif
ifeq ($(OS),Darwin) # Assume Mac Os X
CCC = clang++ -fPIC -std=c++11
LD_FLAGS = -lz
ORTOOLS_LIB = -L$(OR_ROOT)lib -lortools -L$(OR_ROOT)lib -lcvrptw_lib -L$(OR_ROOT)lib -lfz -L$(OR_ROOT)lib -ldimacs
ARCH = -DARCH_K8
PORT = MacOsX64
endif
O = o
E =
OBJ_OUT = -o #
EXE_OUT = -o #
DEL = rm -f
S = /
CLP_INC = -DUSE_CLP
CBC_INC = -DUSE_CBC
GLOP_INC = -DUSE_GLOP
BOP_INT = -DUSE_BOP
DEBUG = -O4 -DNDEBUG
CFLAGS = $(DEBUG) -I$(INC_DIR) -I$(INC_EX_DIR) $(ARCH) -Wno-deprecated \
$(CBC_INC) $(CLP_INC) $(GLOP_INC) $(BOP_INC)
endif
# Windows specific part.
ifeq ("$(SYSTEM)","win")
ifeq ("$(Platform)", "X64")
PLATFORM = Win64
endif
ifeq ("$(Platform)", "x64")
PLATFORM = Win64
endif
ifeq ("$(PLATFORM)", "Win64")
PORT = VisualStudio$(VISUAL_STUDIO)-64b
else
PORT = VisualStudio$(VISUAL_STUDIO)-32b
endif
CLP_INC = -DUSE_CLP
CBC_INC = -DUSE_CBC
GLOP_INC = -DUSE_GLOP
BOP_INC = -DUSE_BOP
<<<<<<< HEAD
=======
<<<<<<< HEAD
<<<<<<< HEAD
CFLAGS= /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS -nologo $(DEBUG) $(CBC_INC) $(CLP_INC)\
/D__WIN32__ /I$(INC_DIR)\\src\\windows /DGFLAGS_DLL_DECL= \
/DGFLAGS_DLL_DECLARE_FLAG= /DGFLAGS_DLL_DEFINE_FLAG= \
/I$(INC_DIR) /I$(INC_EX_DIR) /D $(GLOP_INC) $(BOP_INC)
LD_FLAGS = psapi.lib ws2_32.lib
ORTOOLS_LIB = lib\\ortools.lib lib\\cvrptw_lib.lib lib\\dimacs.lib
=======
=======
>>>>>>> 4ea00a8a3aaf87b3831f4a47e31df5fb028eb4d7
>>>>>>> archives fixes for windows
CFLAGS= -nologo $(DEBUG) $(CBC_INC) $(CLP_INC)\
/D__WIN32__ /I$(INC_DIR)\\src\\windows /DGFLAGS_DLL_DECL= \
/DGFLAGS_DLL_DECLARE_FLAG= /DGFLAGS_DLL_DEFINE_FLAG= \
/I$(INC_DIR) /I$(EX_DIR) /D $(GLOP_INC) $(BOP_INC)
LD_FLAGS = psapi.lib ws2_32.lib
ifeq ("$(Platform)", "X64")
PLATFORM = Win64
endif
ifeq ("$(Platform)", "x64")
PLATFORM = Win64
endif
ifeq ("$(PLATFORM)", "Win64")
PORT = VisualStudio$(VISUAL_STUDIO)-64b
else
PORT = VisualStudio$(VISUAL_STUDIO)-32b
endif
CLP_INC = -DUSE_CLP
CBC_INC = -DUSE_CBC
GLOP_INC = -DUSE_GLOP
BOP_INC = -DUSE_BOP
CFLAGS= /D_SILENCE_STDEXT_HASH_DEPRECATION_WARNINGS -nologo $(DEBUG) $(CBC_INC) $(CLP_INC)\
/D__WIN32__ /I$(INC_DIR)\\src\\windows /DGFLAGS_DLL_DECL= \
/DGFLAGS_DLL_DECLARE_FLAG= /DGFLAGS_DLL_DEFINE_FLAG= \
/I$(INC_DIR) /I$(INC_EX_DIR) /D $(GLOP_INC) $(BOP_INC)
LD_FLAGS = psapi.lib ws2_32.lib
ORTOOLS_LIB = lib\\ortools.lib lib\\cvrptw.lib lib\\fz.lib lib\\dimacs.lib
<<<<<<< HEAD
=======
<<<<<<< HEAD
>>>>>>> 4ea00a8a3aaf87b3831f4a47e31df5fb028eb4d7
=======
>>>>>>> 4ea00a8a3aaf87b3831f4a47e31df5fb028eb4d7
>>>>>>> archives fixes for windows
O=obj
E=.exe
OBJ_OUT = /Fo
EXE_OUT = /Fe
DEL = del
S = \\
DEBUG=/O2 -DNDEBUG
CCC=cl /EHsc /MD /nologo
O=obj
E=.exe
OBJ_OUT = /Fo
EXE_OUT = /Fe
DEL = del
S = \\
DEBUG=/O2 -DNDEBUG
CCC=cl /EHsc /MD /nologo
endif
.PHONY: all clean

View File

@@ -1,4 +1,5 @@
This file describes how to install the or-tools C++, java and .Net binary archive.
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
@@ -10,64 +11,52 @@ These modules have been tested under:
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
LICENSE-2.0.txt <- Apache License
README <- This file
Makefile/ <- Main makefile for cpp
examples/ <- C++, java and .Net examples
lib/ <- directory containing libraries and jar files.
include/ <- all include files
objs/ <- directory containing C++ compiled object files (*.o)
bin/ <- directory containing executable files, and .NET assemblies
########################## C++ ###########################
Use Makefile
########################## java ##########################
Running the examples will involve compiling them, then running them.
Running the examples will involve compiling them, then running them.
Let's compile and run
examples/com/google/ortools/samples/RabbitsPheasants.java
Let's compile and run examples/com/google/ortools/samples/RabbitsPheasants.java:
- on unix:
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
Unix
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
Windows
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
- on windows:
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.
Let's compile examples/csflow.cs and run it:
on windows 32 bit:
csc /target:exe /out:bin\csharp\csflow.exe /platform:x86 /lib:bin\csharp /r:Google.OrTools.dll examples\csharp\csflow.cs
bin\csharp\csflow.exe
- on windows 32 bit:
csc /target:exe /out:bin\csharp\csflow.exe /platform:x86 /lib:bin\csharp /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:bin\csharp /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:bin\csharp /r:Google.OrTools.dll examples\csharp\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:bin/csharp /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:bin/csharp /r:Google.OrTools.dll examples/csharp/csflow.cs
MONO_PATH=lib dependencies\install\bin\mono bin/csharp/csflow.exe
- on linux (mono comes from the distribution, on ubuntu 16.04 and up):
mcs /target:exe /out:bin/csharp/csflow.exe /platform:anycpu /lib:bin/csharp /r:Google.OrTools.dll examples/csharp/csflow.cs
MONO_PATH=lib mono bin/csharp/csflow.exe
- on Mac OS X (Use installer with version 4.2.1 or up):
mcs /target:exe /out:bin/csharp/csflow.exe /platform:anycpu /lib:bin/csharp /r:Google.OrTools.dll examples/csharp/csflow.cs
DYLD_FALLBACK_LIBRARY_PATH=lib mono64 bin/csharp/csflow.exe