diff --git a/Makefile b/Makefile index 1b58abc4ae..557953cb06 100755 --- a/Makefile +++ b/Makefile @@ -65,3 +65,5 @@ include $(OR_ROOT)makefiles/Makefile.test.$(SYSTEM) -include $(OR_ROOT)Makefile.user print-% : ; @echo $* = $($*) + + diff --git a/examples/cpp/fap_model_printer.cc b/examples/cpp/fap_model_printer.cc index 0be1c4bd3a..c3ea2d0a02 100644 --- a/examples/cpp/fap_model_printer.cc +++ b/examples/cpp/fap_model_printer.cc @@ -18,7 +18,6 @@ #include #include #include "base/stringprintf.h" -#include "base/concise_iterator.h" namespace operations_research { @@ -41,27 +40,27 @@ void FapModelPrinter::PrintFapVariables() { int mobility_cost; LOG(INFO) << "Variable File:"; - for (ConstIter > it(variables_); !it.at_end(); ++it) { + for (const auto& it : variables_) { LOG(INFO) << "Variable "; - key = it->first; + key = it.first; LOG(INFO) << StringPrintf("%3d: ", key); - domain_index = it->second.domain_index_; + domain_index = it.second.domain_index_; LOG(INFO) << StringPrintf("%3d", domain_index); - initial_position = it->second.initial_position_; + initial_position = it.second.initial_position_; LOG(INFO) << StringPrintf("%3d", initial_position); - mobility_index = it->second.mobility_index_; + mobility_index = it.second.mobility_index_; LOG(INFO) << StringPrintf("%3d", mobility_index); - mobility_cost = it->second.mobility_cost_; + mobility_cost = it.second.mobility_cost_; LOG(INFO) << StringPrintf("%8d", mobility_cost); LOG(INFO) << StringPrintf(" { "); - for (int i = 0; i < it->second.domain_.size(); ++i) - LOG(INFO) << StringPrintf("%d ", it->second.domain_[i]); + for (int i = 0; i < it.second.domain_.size(); ++i) + LOG(INFO) << StringPrintf("%d ", it.second.domain_[i]); LOG(INFO) << "}"; LOG(INFO) << "\n"; @@ -79,29 +78,29 @@ void FapModelPrinter::PrintFapConstraints() { int weight_cost; LOG(INFO) << "Constraint File:"; - for (ConstIter > it(constraints_); !it.at_end(); ++it) { - variable1 = it->variable1_; + for (const auto& constraint : constraints_) { + variable1 = constraint.variable1_; LOG(INFO) << StringPrintf("%3d ", variable1); - variable2 = it->variable2_; + variable2 = constraint.variable2_; LOG(INFO) << StringPrintf("%3d ", variable2); - type = it->type_; + type = constraint.type_; LOG(INFO) << type; - operation = it->operator_; + operation = constraint.operator_; LOG(INFO) << operation; - value = it->value_; + value = constraint.value_; LOG(INFO) << StringPrintf("%3d", value); - weight_index = it->weight_index_; + weight_index = constraint.weight_index_; LOG(INFO) << StringPrintf("%3d", weight_index); - weight_cost = it->weight_cost_; + weight_cost = constraint.weight_cost_; LOG(INFO) << StringPrintf("%8d", weight_cost); - if (it->hard_) { + if (constraint.hard_) { LOG(INFO) << " hard"; } @@ -115,8 +114,8 @@ void FapModelPrinter::PrintFapObjective() { void FapModelPrinter::PrintFapValues() { LOG(INFO) << StringPrintf("Values(%d): ", static_cast(values_.size())); - for (ConstIter > it(values_); !it.at_end(); ++it) { - LOG(INFO) << *it; + for (int value : values_) { + LOG(INFO) << value; } } diff --git a/examples/cpp/fap_parser.cc b/examples/cpp/fap_parser.cc index 341668d583..9467e3f407 100644 --- a/examples/cpp/fap_parser.cc +++ b/examples/cpp/fap_parser.cc @@ -17,9 +17,7 @@ #include #include "base/file.h" #include "base/split.h" -#include "base/concise_iterator.h" #include "base/map_util.h" - #include "cpp/fap_parser.h" namespace operations_research { @@ -34,7 +32,7 @@ void ParseFileByLines(const string& filename, std::vector* lines) { file->ReadToString(&result, kMaxInputFileSize); file->Close(); - SplitStringUsing(result, "\n", lines); + *lines = strings::Split(result, "\n", strings::SkipEmpty()); } // VariableParser Implementation @@ -46,9 +44,9 @@ VariableParser::~VariableParser() { } void VariableParser::Parse() { std::vector lines; ParseFileByLines(filename_, &lines); - for (ConstIter > it(lines); !it.at_end(); ++it) { + for (const auto& line : lines) { std::vector tokens; - SplitStringUsing(*it, " ", &tokens); + tokens = strings::Split(line, " ", strings::SkipEmpty()); if (tokens.empty()) { continue; } @@ -74,9 +72,9 @@ DomainParser::~DomainParser() { } void DomainParser::Parse() { std::vector lines; ParseFileByLines(filename_, &lines); - for (ConstIter > it(lines); !it.at_end(); ++it) { + for (const auto& line : lines) { std::vector tokens; - SplitStringUsing(*it, " ", &tokens); + tokens = strings::Split(line, " ", strings::SkipEmpty()); if (tokens.empty()) { continue; } @@ -106,9 +104,9 @@ ConstraintParser::~ConstraintParser() { } void ConstraintParser::Parse() { std::vector lines; ParseFileByLines(filename_, &lines); - for (ConstIter > it(lines); !it.at_end(); ++it) { + for (const auto& line : lines) { std::vector tokens; - SplitStringUsing(*it, " ", &tokens); + tokens = strings::Split(line, " ", strings::SkipEmpty()); if (tokens.empty()) { continue; } @@ -149,22 +147,22 @@ void ParametersParser::Parse() { std::vector lines; ParseFileByLines(filename_, &lines); - for (ConstIter > it(lines); !it.at_end(); ++it) { + for (const auto& line : lines) { if (objective) { - largest_token = largest_token || (it->find("largest") != string::npos); - value_token = value_token || (it->find("value") != string::npos); - number_token = number_token || (it->find("number") != string::npos); - values_token = values_token || (it->find("values") != string::npos); - coefficient = coefficient || (it->find("coefficient") != string::npos); + largest_token = largest_token || (line.find("largest") != string::npos); + value_token = value_token || (line.find("value") != string::npos); + number_token = number_token || (line.find("number") != string::npos); + values_token = values_token || (line.find("values") != string::npos); + coefficient = coefficient || (line.find("coefficient") != string::npos); } if (coefficient) { CHECK_EQ(coefficient_no_, constraint_coefficient_no_ + variable_coefficient_no_); objective = false; - if (it->find("=") != string::npos) { + if (line.find("=") != string::npos) { std::vector tokens; - SplitStringUsing(*it, " ", &tokens); + tokens = strings::Split(line, " ", strings::SkipEmpty()); CHECK_GE(tokens.size(), 3); coefficients.push_back(atoi32(tokens[2].c_str())); } @@ -215,30 +213,29 @@ void ParseInstance(const string& data_directory, ParametersParser cst(data_directory); cst.Parse(); - for (MutableIter > it(*variables); !it.at_end(); ++it) { - it->second.domain_ = FindOrDie(dom.domains(), it->second.domain_index_); - it->second.domain_size_ = dom.domain_cardinality(); - if ((it->second.mobility_index_ == -1) || - (it->second.mobility_index_ == 0)) { - it->second.mobility_cost_ = -1; - if (it->second.initial_position_ != -1) { - it->second.hard_ = true; + for (auto& it : *variables) { + it.second.domain_ = FindOrDie(dom.domains(), it.second.domain_index_); + it.second.domain_size_ = dom.domain_cardinality(); + if ((it.second.mobility_index_ == -1) || + (it.second.mobility_index_ == 0)) { + it.second.mobility_cost_ = -1; + if (it.second.initial_position_ != -1) { + it.second.hard_ = true; } } else { - it->second.mobility_cost_ = - (cst.variable_weights())[it->second.mobility_index_-1]; + it.second.mobility_cost_ = + (cst.variable_weights())[it.second.mobility_index_-1]; } } *frequencies = FindOrDie(dom.domains(), 0); *objective = cst.objective(); - for (MutableIter > it(*constraints); - !it.at_end(); ++it) { - if ((it->weight_index_ == -1) || (it->weight_index_ == 0)) { - it->weight_cost_ = -1; - it->hard_ = true; + for (auto& constraint : *constraints) { + if ((constraint.weight_index_ == -1) || (constraint.weight_index_ == 0)) { + constraint.weight_cost_ = -1; + constraint.hard_ = true; } else { - it->weight_cost_ = (cst.constraint_weights())[it->weight_index_-1]; + constraint.weight_cost_ = (cst.constraint_weights())[constraint.weight_index_-1]; } } } diff --git a/examples/cpp/fap_parser.h b/examples/cpp/fap_parser.h index bae8044c59..e4db56b0ed 100644 --- a/examples/cpp/fap_parser.h +++ b/examples/cpp/fap_parser.h @@ -24,7 +24,6 @@ #include "base/logging.h" #include "base/strtoint.h" #include "base/split.h" -#include "base/concise_iterator.h" #include "base/map_util.h" using std::string; diff --git a/examples/cpp/fap_utilities.cc b/examples/cpp/fap_utilities.cc index 60d2dc17ec..7dd370cc90 100644 --- a/examples/cpp/fap_utilities.cc +++ b/examples/cpp/fap_utilities.cc @@ -20,7 +20,6 @@ #include "base/logging.h" #include "base/stringprintf.h" -#include "base/concise_iterator.h" #include "base/map_util.h" namespace operations_research { @@ -29,33 +28,32 @@ bool CheckConstraintSatisfaction(const std::vector& data_constrai const std::vector& variables, const std::map& index_from_key) { bool status = true; - for (ConstIter > it(data_constraints); - !it.at_end(); ++it) { - const int index1 = FindOrDie(index_from_key, it->variable1_); - const int index2 = FindOrDie(index_from_key, it->variable2_); + for (const auto& data_constraint : data_constraints) { + const int index1 = FindOrDie(index_from_key, data_constraint.variable1_); + const int index2 = FindOrDie(index_from_key, data_constraint.variable2_); CHECK_LT(index1, variables.size()); CHECK_LT(index2, variables.size()); const int var1 = variables[index1]; const int var2 = variables[index2]; const int absolute_difference = abs(var1 - var2); - if (it->hard_) { - if ((it->operator_ == ">") && (absolute_difference <= it->value_)) { + if (data_constraint.hard_) { + if ((data_constraint.operator_ == ">") && (absolute_difference <= data_constraint.value_)) { LOG(INFO) << StringPrintf(" Violation of contraint between variable %d" " and variable %d.\n", - it->variable1_, it->variable2_); + data_constraint.variable1_, data_constraint.variable2_); LOG(INFO) << StringPrintf(" Expected |%d - %d| (= %d) > %d.", var1, var2, - absolute_difference, it->value_); + absolute_difference, data_constraint.value_); status = false; - } else if ((it->operator_ == "=") && - (absolute_difference != it->value_)) { + } else if ((data_constraint.operator_ == "=") && + (absolute_difference != data_constraint.value_)) { LOG(INFO) << StringPrintf(" Violation of contraint between variable %d" " and variable %d.\n", - it->variable1_, it->variable2_); + data_constraint.variable1_, data_constraint.variable2_); LOG(INFO) << StringPrintf(" Expected |%d - %d| (= %d) == %d.", var1, var2, - absolute_difference, it->value_); + absolute_difference, data_constraint.value_); status = false; } } @@ -67,19 +65,18 @@ bool CheckVariablePosition(const std::map& data_variables, const std::vector& variables, const std::map& index_from_key) { bool status = true; - for (ConstIter > it(data_variables); - !it.at_end(); ++it) { - const int index = FindOrDie(index_from_key, it->first); + for (const auto& it : data_variables) { + const int index = FindOrDie(index_from_key, it.first); CHECK_LT(index, variables.size()); const int var = variables[index]; - if (it->second.hard_ && - (it->second.initial_position_ != -1) && - (var != it->second.initial_position_)) { + if (it.second.hard_ && + (it.second.initial_position_ != -1) && + (var != it.second.initial_position_)) { LOG(INFO) << StringPrintf(" Change of position of hard variable %d.\n", - it->first); + it.first); LOG(INFO) << StringPrintf(" Expected %d instead of given %d.", - it->second.initial_position_, var); + it.second.initial_position_, var); status = false; } } diff --git a/makefiles/Makefile.archive.mk b/makefiles/Makefile.archive.mk index fa50378643..6a73842c6f 100644 --- a/makefiles/Makefile.archive.mk +++ b/makefiles/Makefile.archive.mk @@ -24,8 +24,6 @@ create_dirs: $(MKDIR) temp$S$(INSTALL_DIR)$Slib $(MKDIR) temp$S$(INSTALL_DIR)$Sobjs $(MKDIR) temp$S$(INSTALL_DIR)$Sbin - $(MKDIR) temp$S$(INSTALL_DIR)$Sbin$Scpp - $(MKDIR) temp$S$(INSTALL_DIR)$Sbin$Scsharp $(MKDIR) temp$S$(INSTALL_DIR)$Sinclude $(MKDIR) temp$S$(INSTALL_DIR)$Sinclude$Salgorithms $(MKDIR) temp$S$(INSTALL_DIR)$Sinclude$Sbase @@ -72,6 +70,7 @@ cc_archive: $(COPY) $(LIB_DIR)$S$(LIB_PREFIX)cvrptw_lib.$(LIB_SUFFIX) temp$S$(INSTALL_DIR)$Slib $(COPY) $(LIB_DIR)$S$(LIB_PREFIX)dimacs.$(LIB_SUFFIX) temp$S$(INSTALL_DIR)$Slib $(COPY) $(LIB_DIR)$S$(LIB_PREFIX)ortools.$(LIB_SUFFIX) temp$S$(INSTALL_DIR)$Slib + $(COPY) $(LIB_DIR)$S$(LIB_PREFIX)fap.$(LIB_SUFFIX) temp$S$(INSTALL_DIR)$Slib $(COPY) examples$Scpp$S*.cc temp$S$(INSTALL_DIR)$Sexamples$Scpp $(COPY) examples$Scpp$S*.h temp$S$(INSTALL_DIR)$Sexamples$Scpp $(COPY) src$Salgorithms$S*.h temp$S$(INSTALL_DIR)$Sinclude$Salgorithms @@ -114,8 +113,8 @@ endif dotnet_archive: - $(COPY) bin$SGoogle.Protobuf.dll temp$S$(INSTALL_DIR)$Sbin$Scsharp - $(COPY) bin$S$(CLR_DLL_NAME).dll temp$S$(INSTALL_DIR)$Sbin$Scsharp + $(COPY) bin$SGoogle.Protobuf.dll temp$S$(INSTALL_DIR)$Sbin + $(COPY) bin$S$(CLR_DLL_NAME).dll temp$S$(INSTALL_DIR)$Sbin $(COPY) examples$Scsharp$S*.cs temp$S$(INSTALL_DIR)$Sexamples$Scsharp $(COPY) examples$Scsharp$Ssolution$SProperties$S*.cs temp$S$(INSTALL_DIR)$Sexamples$Scsharp$Ssolution$SProperties $(COPY) examples$Sdata$Sdiscrete_tomography$S* temp$S$(INSTALL_DIR)$Sexamples$Sdata$Sdiscrete_tomography @@ -129,7 +128,7 @@ ifeq "$(SYSTEM)" "win" $(COPY) examples$Scsharp$S*.sln temp$S$(INSTALL_DIR)$Sexamples $(COPY) examples$Scsharp$Ssolution$S*.csproj temp$S$(INSTALL_DIR)$Sexamples$Scsharp$Ssolution else - $(COPY) lib$Slib$(CLR_DLL_NAME).so temp$S$(INSTALL_DIR)$Sbin$Scsharp + $(COPY) lib$Slib$(CLR_DLL_NAME).so temp$S$(INSTALL_DIR)$Sbin endif java_archive: diff --git a/makefiles/Makefile.cpp.mk b/makefiles/Makefile.cpp.mk index b636f50b68..daaecf2828 100755 --- a/makefiles/Makefile.cpp.mk +++ b/makefiles/Makefile.cpp.mk @@ -74,7 +74,7 @@ DIMACS_DEPS = \ DIMACS_LNK = $(PRE_LIB)dimacs$(POST_LIB) $(OR_TOOLS_LNK) dimacslibs: $(DIMACS_LIBS) -FAP_LIBS = $(LIB_DIR)/$(LIB_PREFIX)fap.$(LIB_SUFFIX) +FAP_LIBS = $(LIB_DIR)/$(LIB_PREFIX)fap.$(LIB_SUFFIX) FAP_DEPS = \ $(EX_DIR)/cpp/fap_model_printer.h \ $(EX_DIR)/cpp/fap_parser.h \ @@ -178,6 +178,8 @@ $(OBJ_DIR)/fap_parser.$O: $(EX_DIR)/cpp/fap_parser.cc $(OBJ_DIR)/fap_utilities.$O: $(EX_DIR)/cpp/fap_utilities.cc $(CCC) $(CFLAGS) -c $(EX_DIR)$Scpp$Sfap_utilities.cc $(OBJ_OUT)$(OBJ_DIR)$Sfap_utilities.$O +$(LIB_DIR)/$(LIB_PREFIX)fap.$(LIB_SUFFIX): $(FAP_OBJS) + $(LINK_CMD) $(LINK_PREFIX)$(LIB_DIR)$S$(LIB_PREFIX)fap.$(LIB_SUFFIX) $(FAP_OBJS) # Flatzinc code @@ -607,6 +609,14 @@ $(LIB_DIR)/$(LIB_PREFIX)ortools.$(LIB_SUFFIX): \ $(DEPENDENCIES_LNK) \ $(OR_TOOLS_LD_FLAGS) +# compile and run C++ examples + +ccc: $(BIN_DIR)$S$(basename $(notdir $(EX)))$E + +rcc: $(BIN_DIR)$S$(basename $(notdir $(EX)))$E + @echo running $(BIN_DIR)$S$(basename $(notdir $(EX)))$E + $(BIN_DIR)$S$(basename $(notdir $(EX)))$E + # Debug printdir: diff --git a/makefiles/Makefile.csharp.mk b/makefiles/Makefile.csharp.mk index aac139d4af..625a5a60ad 100755 --- a/makefiles/Makefile.csharp.mk +++ b/makefiles/Makefile.csharp.mk @@ -356,13 +356,14 @@ techtalk_scheduling: $(BIN_DIR)/techtalk_scheduling$(CLR_EXE_SUFFIX).exe -$(BIN_DIR)$S$(EX)$(CLR_EXE_SUFFIX).exe: $(BIN_DIR)/$(CLR_DLL_NAME).dll $(EX_DIR)/csharp/$(EX).cs - $(CSC) $(SIGNING_FLAGS) /target:exe /out:$(BIN_DIR)$S$(EX)$(CLR_EXE_SUFFIX).exe /platform:$(NETPLATFORM) /lib:$(BIN_DIR) /r:$(CLR_DLL_NAME).dll /r:Google.Protobuf.dll $(EX_DIR)$Scsharp$S$(EX).cs +$(BIN_DIR)$S$(basename $(notdir $(EX)))$(CLR_EXE_SUFFIX).exe: $(BIN_DIR)/$(CLR_DLL_NAME).dll $(EX) + $(CSC) $(SIGNING_FLAGS) /target:exe /out:$(BIN_DIR)$S$(basename $(notdir $(EX)))$(CLR_EXE_SUFFIX).exe /platform:$(NETPLATFORM) /lib:$(BIN_DIR) /r:$(CLR_DLL_NAME).dll /r:Google.Protobuf.dll $(EX) -csc: $(BIN_DIR)$S$(EX)$(CLR_EXE_SUFFIX).exe +csc: $(BIN_DIR)$S$(basename $(notdir $(EX)))$(CLR_EXE_SUFFIX).exe -rcs: $(BIN_DIR)$S$(EX)$(CLR_EXE_SUFFIX).exe - $(MONO) $(BIN_DIR)$S$(EX)$(CLR_EXE_SUFFIX).exe $(ARGS) +rcs: $(BIN_DIR)$S$(basename $(notdir $(EX)))$(CLR_EXE_SUFFIX).exe + @echo running $(BIN_DIR)$S$(basename $(notdir $(EX)))$(CLR_EXE_SUFFIX).exe + $(MONO) $(BIN_DIR)$S$(basename $(notdir $(EX)))$(CLR_EXE_SUFFIX).exe $(ARGS) # C# Fz support diff --git a/makefiles/Makefile.java.mk b/makefiles/Makefile.java.mk index 57d039b7eb..399c983a49 100755 --- a/makefiles/Makefile.java.mk +++ b/makefiles/Makefile.java.mk @@ -368,10 +368,28 @@ $(OBJ_DIR)/com/google/ortools/samples/MultiThreadTest.class: javaortools $(EX_DI # Compile and Run CP java example: -$(OBJ_DIR)/com/google/ortools/samples/$(EX).class: javaortools $(EX_DIR)/com/google/ortools/samples/$(EX).java - $(JAVAC_BIN) -d $(OBJ_DIR) -cp $(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar $(EX_DIR)$Scom$Sgoogle$Sortools$Ssamples$S$(EX).java +ifneq ($(EX),) +ifeq ($(SYSTEM),win) +EX_read_package = $(shell findstr /r "^package.*\;" $(EX)) +else +EX_read_package = $(shell grep '^package.*\;' $(EX)) +endif +EX_name = $(basename $(notdir $(EX))) +EX_package = $(subst ;,,$(subst package ,,$(EX_read_package))) +ifeq ($(EX_read_package),) +EX_class_file = $(OBJ_DIR)$S$(EX_name).class +EX_class = $(EX_name) +else +EX_class_file = $(OBJ_DIR)$S$(subst .,$S,$(EX_package))$S$(EX_name).class +EX_class = $(EX_package).$(EX_name) +endif -cjava: $(OBJ_DIR)/com/google/ortools/samples/$(EX).class -rjava: cjava javaortools - $(JAVA_BIN) -Djava.library.path=$(LIB_DIR) -cp $(OBJ_DIR)$(CPSEP)$(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar com.google.ortools.samples.$(EX) $(ARGS) +$(EX_class_file): javaortools $(EX) + $(JAVAC_BIN) -d $(OBJ_DIR) -cp $(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar $(EX) + +cjava: $(EX_class_file) + +rjava: $(EX_class_file) javaortools + $(JAVA_BIN) -Djava.library.path=$(LIB_DIR) -cp $(OBJ_DIR)$(CPSEP)$(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar $(EX_class) $(ARGS) +endif diff --git a/tools/Makefile.cc b/tools/Makefile.cc index bbb631a6b9..2d8e05430f 100644 --- a/tools/Makefile.cc +++ b/tools/Makefile.cc @@ -26,25 +26,32 @@ else endif # Useful directories. -CPP_BIN_DIR = $(OR_ROOT)bin/cpp -CS_BIN_DIR = $(OR_ROOT)bin$Scsharp +BIN_DIR = $(OR_ROOT)bin OBJ_DIR = $(OR_ROOT)objs +EX_DIR = $(OR_ROOT)examples CPP_EX_DIR = $(OR_ROOT)examples$Scpp -JAVA_EX_DIR = $(OR_ROOL)examples$Scom CS_EX_DIR = $(OR_ROOT)examples$Scsharp INC_EX_DIR = $(OR_ROOT)examples INC_DIR = $(OR_ROOT)include LIB_DIR = $(OR_ROOT)lib +CLR_DLL_NAME?=Google.OrTools + +JAVAC_BIN = javac +JAVA_BIN = java + # Unix specific part. ifeq ("$(SYSTEM)","unix") # Defines OR_TOOLS_TOP if it is not already defined. OR_TOOLS_TOP ?= $(shell pwd) OS = $(shell uname -s) - LIB_PREFIX = -Wl,-rpath $(OR_TOOLS_TOP)/lib -L$(OR_TOOLS_TOP)/lib - OR_TOOLS_LIBS = $(LIB_PREFIX) -lortools - CVRPTW_LIBS = $(LIB_PREFIX) -lcvrptw_lib $(LIB_PREFIX) -lortools - DIMACS_LIBS = $(LIB_PREFIX) -ldimacs $(LIB_PREFIX) -lortools + LIB_PREFIX = lib + LIB_SUFFIX = so + PRE_LIB = -Wl,-rpath $(OR_TOOLS_TOP)/lib -L$(OR_TOOLS_TOP)/lib + OR_TOOLS_LNK = $(PRE_LIB) -lortools + CVRPTW_LNK = $(PRE_LIB) -lcvrptw_lib $(PRE_LIB) -lortools + DIMACS_LNK = $(PRE_LIB) -ldimacs $(PRE_LIB) -lortools + FAP_LNK = $(PRE_LIB) -lfap $(PRE_LIB) -lortools ifeq ($(OS),Linux) CCC = g++ -fPIC -std=c++0x LD_FLAGS = -lz -lrt -lpthread @@ -109,9 +116,12 @@ ifeq ("$(SYSTEM)","win") /DGFLAGS_DLL_DECL= /DGFLAGS_DLL_DECLARE_FLAG= /DGFLAGS_DLL_DEFINE_FLAG= \ /I$(INC_DIR) /I$(INC_EX_DIR) $(GLOP_INC) $(BOP_INC) LD_FLAGS = psapi.lib ws2_32.lib - OR_TOOLS_LIBS = lib\\ortools.lib - CVRPTW_LIBS = lib\\cvrptw_lib.lib lib\\ortools.lib - DIMACS_LIBS = lib\\dimacs.lib lib\\ortools.lib + LIB_PREFIX = + PRE_LIB = + LIB_SUFFIX = lib + OR_TOOLS_LNK = lib\\ortools.lib + CVRPTW_LNK = lib\\cvrptw_lib.lib lib\\ortools.lib + DIMACS_LNK = lib\\dimacs.lib lib\\ortools.lib O=obj E=.exe OBJ_OUT = /Fo @@ -125,57 +135,62 @@ ifeq ("$(SYSTEM)","win") MONO= endif +OR_TOOLS_LIBS = $(LIB_DIR)/$(LIB_PREFIX)ortools.$(LIB_SUFFIX) +CVRPTW_LIBS = $(LIB_DIR)/$(LIB_PREFIX)cvrptw_lib.$(LIB_SUFFIX) +DIMACS_LIBS = $(LIB_DIR)/$(LIB_PREFIX)dimacs.$(LIB_SUFFIX) +FAP_LIBS = $(LIB_DIR)/$(LIB_PREFIX)fap.$(LIB_SUFFIX) + .PHONY: all clean test all: \ - $(CPP_BIN_DIR)/costas_array$E \ - $(CPP_BIN_DIR)/cryptarithm$E \ - $(CPP_BIN_DIR)/cvrp_disjoint_tw$E \ - $(CPP_BIN_DIR)/cvrptw$E \ - $(CPP_BIN_DIR)/cvrptw_with_refueling$E \ - $(CPP_BIN_DIR)/cvrptw_with_resources$E \ - $(CPP_BIN_DIR)/cvrptw_with_stop_times_and_resources$E \ - $(CPP_BIN_DIR)/dimacs_assignment$E \ - $(CPP_BIN_DIR)/dobble_ls$E \ - $(CPP_BIN_DIR)/flexible_jobshop$E \ - $(CPP_BIN_DIR)/golomb$E \ - $(CPP_BIN_DIR)/jobshop$E \ - $(CPP_BIN_DIR)/jobshop_ls$E \ - $(CPP_BIN_DIR)/jobshop_earlytardy$E \ - $(CPP_BIN_DIR)/magic_square$E \ - $(CPP_BIN_DIR)/model_util$E \ - $(CPP_BIN_DIR)/multidim_knapsack$E \ - $(CPP_BIN_DIR)/network_routing$E \ - $(CPP_BIN_DIR)/nqueens$E \ - $(CPP_BIN_DIR)/pdptw$E \ - $(CPP_BIN_DIR)/sports_scheduling$E \ - $(CPP_BIN_DIR)/tsp$E \ - $(CPP_BIN_DIR)/linear_assignment_api$E \ - $(CPP_BIN_DIR)/strawberry_fields_with_column_generation$E \ - $(CPP_BIN_DIR)/linear_programming$E \ - $(CPP_BIN_DIR)/linear_solver_protocol_buffers$E \ - $(CPP_BIN_DIR)/integer_programming$E \ - $(CPP_BIN_DIR)/flow_api$E + $(BIN_DIR)/costas_array$E \ + $(BIN_DIR)/cryptarithm$E \ + $(BIN_DIR)/cvrp_disjoint_tw$E \ + $(BIN_DIR)/cvrptw$E \ + $(BIN_DIR)/cvrptw_with_refueling$E \ + $(BIN_DIR)/cvrptw_with_resources$E \ + $(BIN_DIR)/cvrptw_with_stop_times_and_resources$E \ + $(BIN_DIR)/dimacs_assignment$E \ + $(BIN_DIR)/dobble_ls$E \ + $(BIN_DIR)/flexible_jobshop$E \ + $(BIN_DIR)/golomb$E \ + $(BIN_DIR)/jobshop$E \ + $(BIN_DIR)/jobshop_ls$E \ + $(BIN_DIR)/jobshop_earlytardy$E \ + $(BIN_DIR)/magic_square$E \ + $(BIN_DIR)/model_util$E \ + $(BIN_DIR)/multidim_knapsack$E \ + $(BIN_DIR)/network_routing$E \ + $(BIN_DIR)/nqueens$E \ + $(BIN_DIR)/pdptw$E \ + $(BIN_DIR)/sports_scheduling$E \ + $(BIN_DIR)/tsp$E \ + $(BIN_DIR)/linear_assignment_api$E \ + $(BIN_DIR)/strawberry_fields_with_column_generation$E \ + $(BIN_DIR)/linear_programming$E \ + $(BIN_DIR)/linear_solver_protocol_buffers$E \ + $(BIN_DIR)/integer_programming$E \ + $(BIN_DIR)/flow_api$E clean: - $(DEL) $(CPP_BIN_DIR)$S* + $(DEL) $(BIN_DIR)$S* $(DEL) $(OBJ_DIR)$S*$O -test_cc: $(CPP_BIN_DIR)/golomb$E $(CPP_BIN_DIR)/cvrptw$E - $(CPP_BIN_DIR)$Sgolomb$E - $(CPP_BIN_DIR)/cvrptw$E +test_cc: $(BIN_DIR)/golomb$E $(BIN_DIR)/cvrptw$E + $(BIN_DIR)$Sgolomb$E + $(BIN_DIR)/cvrptw$E test_java: EX:=Tsp test_java: - javac -d $(OBJ_DIR) -cp $(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar $(JAVA_EX_DIR)$Sgoogle$Sortools$Ssamples$S$(EX).java + javac -d $(OBJ_DIR) -cp $(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar $(EX_DIR)$Scom$Sgoogle$Sortools$Ssamples$S$(EX).java java -Djava.library.path=$(LIB_DIR) -cp $(OBJ_DIR)$(CPSEP)$(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar com.google.ortools.samples.$(EX) $(ARGS) test_cs: EX:=csflow test_cs: - $(CSC) /target:exe /out:$(CS_BIN_DIR)$S$(EX).exe /platform:$(NETPLATFORM) /lib:$(CS_BIN_DIR) /r:Google.OrTools.dll /r:Google.Protobuf.dll $(CS_EX_DIR)$S$(EX).cs - $(MONO) $(CS_BIN_DIR)$S$(EX)$(CLR_EXE_SUFFIX).exe $(ARGS) + $(CSC) /target:exe /out:$(BIN_DIR)$S$(EX).exe /platform:$(NETPLATFORM) /lib:$(BIN_DIR) /r:Google.OrTools.dll /r:Google.Protobuf.dll $(CS_EX_DIR)$S$(EX).cs + $(MONO) $(BIN_DIR)$S$(EX).exe $(ARGS) test: test_cc test_java test_cs @@ -190,192 +205,222 @@ test: test_cc test_java test_cs $(OBJ_DIR)$Scostas_array.$O: $(CPP_EX_DIR)$Scostas_array.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Scostas_array.cc $(OBJ_OUT)$(OBJ_DIR)$Scostas_array.$O -$(CPP_BIN_DIR)/costas_array$E: $(OBJ_DIR)$Scostas_array.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Scostas_array.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Scostas_array$E +$(BIN_DIR)/costas_array$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Scostas_array.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Scostas_array.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Scostas_array$E $(OBJ_DIR)$Scryptarithm.$O:$(CPP_EX_DIR)$Scryptarithm.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Scryptarithm.cc $(OBJ_OUT)$(OBJ_DIR)$Scryptarithm.$O -$(CPP_BIN_DIR)/cryptarithm$E: $(OBJ_DIR)$Scryptarithm.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Scryptarithm.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Scryptarithm$E +$(BIN_DIR)/cryptarithm$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Scryptarithm.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Scryptarithm.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Scryptarithm$E $(OBJ_DIR)$Scvrp_disjoint_tw.$O: $(CPP_EX_DIR)$Scvrp_disjoint_tw.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Scvrp_disjoint_tw.cc $(OBJ_OUT)$(OBJ_DIR)$Scvrp_disjoint_tw.$O -$(CPP_BIN_DIR)/cvrp_disjoint_tw$E: $(OBJ_DIR)$Scvrp_disjoint_tw.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Scvrp_disjoint_tw.$O $(CVRPTW_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Scvrp_disjoint_tw$E +$(BIN_DIR)/cvrp_disjoint_tw$E: $(OR_TOOLS_LIBS) $(CVRPTW_LIBS) $(OBJ_DIR)$Scvrp_disjoint_tw.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Scvrp_disjoint_tw.$O $(CVRPTW_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Scvrp_disjoint_tw$E $(OBJ_DIR)$Scvrptw.$O: $(CPP_EX_DIR)$Scvrptw.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Scvrptw.cc $(OBJ_OUT)$(OBJ_DIR)$Scvrptw.$O -$(CPP_BIN_DIR)/cvrptw$E: $(OBJ_DIR)$Scvrptw.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Scvrptw.$O $(CVRPTW_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Scvrptw$E +$(BIN_DIR)/cvrptw$E: $(OR_TOOLS_LIBS) $(CVRPTW_LIBS) $(OBJ_DIR)$Scvrptw.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Scvrptw.$O $(CVRPTW_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Scvrptw$E $(OBJ_DIR)$Scvrptw_with_refueling.$O: $(CPP_EX_DIR)$Scvrptw_with_refueling.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Scvrptw_with_refueling.cc $(OBJ_OUT)$(OBJ_DIR)$Scvrptw_with_refueling.$O -$(CPP_BIN_DIR)/cvrptw_with_refueling$E: $(OBJ_DIR)$Scvrptw_with_refueling.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Scvrptw_with_refueling.$O $(CVRPTW_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Scvrptw_with_refueling$E +$(BIN_DIR)/cvrptw_with_refueling$E: $(OR_TOOLS_LIBS) $(CVRPTW_LIBS) $(CVRPTW_LIBS) $(OBJ_DIR)$Scvrptw_with_refueling.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Scvrptw_with_refueling.$O $(CVRPTW_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Scvrptw_with_refueling$E $(OBJ_DIR)$Scvrptw_with_resources.$O: $(CPP_EX_DIR)$Scvrptw_with_resources.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Scvrptw_with_resources.cc $(OBJ_OUT)$(OBJ_DIR)$Scvrptw_with_resources.$O -$(CPP_BIN_DIR)/cvrptw_with_resources$E: $(OBJ_DIR)$Scvrptw_with_resources.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Scvrptw_with_resources.$O $(CVRPTW_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Scvrptw_with_resources$E +$(BIN_DIR)/cvrptw_with_resources$E: $(OR_TOOLS_LIBS) $(CVRPTW_LIBS) $(OBJ_DIR)$Scvrptw_with_resources.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Scvrptw_with_resources.$O $(CVRPTW_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Scvrptw_with_resources$E $(OBJ_DIR)$Scvrptw_with_stop_times_and_resources.$O: $(CPP_EX_DIR)$Scvrptw_with_stop_times_and_resources.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Scvrptw_with_stop_times_and_resources.cc $(OBJ_OUT)$(OBJ_DIR)$Scvrptw_with_stop_times_and_resources.$O -$(CPP_BIN_DIR)/cvrptw_with_stop_times_and_resources$E: $(OBJ_DIR)$Scvrptw_with_stop_times_and_resources.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Scvrptw_with_stop_times_and_resources.$O $(CVRPTW_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Scvrptw_with_stop_times_and_resources$E +$(BIN_DIR)/cvrptw_with_stop_times_and_resources$E: $(OR_TOOLS_LIBS) $(CVRPTW_LIBS) $(OBJ_DIR)$Scvrptw_with_stop_times_and_resources.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Scvrptw_with_stop_times_and_resources.$O $(CVRPTW_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Scvrptw_with_stop_times_and_resources$E $(OBJ_DIR)$Sdimacs_assignment.$O:$(CPP_EX_DIR)$Sdimacs_assignment.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Sdimacs_assignment.cc $(OBJ_OUT)$(OBJ_DIR)$Sdimacs_assignment.$O -$(CPP_BIN_DIR)/dimacs_assignment$E: $(OBJ_DIR)$Sdimacs_assignment.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Sdimacs_assignment.$O $(DIMACS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Sdimacs_assignment$E +$(BIN_DIR)/dimacs_assignment$E: $(OR_TOOLS_LIBS) $(DIMACS_LIBS) $(OBJ_DIR)$Sdimacs_assignment.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Sdimacs_assignment.$O $(DIMACS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Sdimacs_assignment$E $(OBJ_DIR)$Sdobble_ls.$O:$(CPP_EX_DIR)$Sdobble_ls.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Sdobble_ls.cc $(OBJ_OUT)$(OBJ_DIR)$Sdobble_ls.$O -$(CPP_BIN_DIR)/dobble_ls$E: $(OBJ_DIR)$Sdobble_ls.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Sdobble_ls.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Sdobble_ls$E +$(BIN_DIR)/dobble_ls$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Sdobble_ls.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Sdobble_ls.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Sdobble_ls$E $(OBJ_DIR)$Sflexible_jobshop.$O:$(CPP_EX_DIR)$Sflexible_jobshop.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CPP_EX_DIR)$Sflexible_jobshop.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Sflexible_jobshop.cc $(OBJ_OUT)$(OBJ_DIR)$Sflexible_jobshop.$O -$(CPP_BIN_DIR)/flexible_jobshop$E: $(OBJ_DIR)$Sflexible_jobshop.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Sflexible_jobshop.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Sflexible_jobshop$E +$(BIN_DIR)/flexible_jobshop$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Sflexible_jobshop.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Sflexible_jobshop.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Sflexible_jobshop$E $(OBJ_DIR)$Sgolomb.$O:$(CPP_EX_DIR)$Sgolomb.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Sgolomb.cc $(OBJ_OUT)$(OBJ_DIR)$Sgolomb.$O -$(CPP_BIN_DIR)/golomb$E: $(OBJ_DIR)$Sgolomb.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Sgolomb.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Sgolomb$E +$(BIN_DIR)/golomb$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Sgolomb.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Sgolomb.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Sgolomb$E $(OBJ_DIR)$Sjobshop.$O:$(CPP_EX_DIR)$Sjobshop.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Sjobshop.cc $(OBJ_OUT)$(OBJ_DIR)$Sjobshop.$O -$(CPP_BIN_DIR)/jobshop$E: $(OBJ_DIR)$Sjobshop.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Sjobshop.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Sjobshop$E +$(BIN_DIR)/jobshop$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Sjobshop.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Sjobshop.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Sjobshop$E $(OBJ_DIR)$Sjobshop_ls.$O:$(CPP_EX_DIR)$Sjobshop_ls.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Sjobshop_ls.cc $(OBJ_OUT)$(OBJ_DIR)$Sjobshop_ls.$O -$(CPP_BIN_DIR)/jobshop_ls$E: $(OBJ_DIR)$Sjobshop_ls.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Sjobshop_ls.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Sjobshop_ls$E +$(BIN_DIR)/jobshop_ls$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Sjobshop_ls.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Sjobshop_ls.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Sjobshop_ls$E $(OBJ_DIR)$Sjobshop_earlytardy.$O:$(CPP_EX_DIR)$Sjobshop_earlytardy.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CPP_EX_DIR)$Sjobshop_earlytardy.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Sjobshop_earlytardy.cc $(OBJ_OUT)$(OBJ_DIR)$Sjobshop_earlytardy.$O -$(CPP_BIN_DIR)/jobshop_earlytardy$E: $(OBJ_DIR)$Sjobshop_earlytardy.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Sjobshop_earlytardy.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Sjobshop_earlytardy$E +$(BIN_DIR)/jobshop_earlytardy$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Sjobshop_earlytardy.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Sjobshop_earlytardy.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Sjobshop_earlytardy$E $(OBJ_DIR)$Smagic_square.$O:$(CPP_EX_DIR)$Smagic_square.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Smagic_square.cc $(OBJ_OUT)$(OBJ_DIR)$Smagic_square.$O -$(CPP_BIN_DIR)/magic_square$E: $(OBJ_DIR)$Smagic_square.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Smagic_square.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Smagic_square$E +$(BIN_DIR)/magic_square$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Smagic_square.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Smagic_square.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Smagic_square$E $(OBJ_DIR)$Smodel_util.$O:$(CPP_EX_DIR)$Smodel_util.cc $(INC_DIR)$Sconstraint_solver$Smodel.pb.h $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Smodel_util.cc $(OBJ_OUT)$(OBJ_DIR)$Smodel_util.$O -$(CPP_BIN_DIR)/model_util$E: $(OBJ_DIR)$Smodel_util.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Smodel_util.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Smodel_util$E +$(BIN_DIR)/model_util$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Smodel_util.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Smodel_util.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Smodel_util$E $(OBJ_DIR)$Smultidim_knapsack.$O:$(CPP_EX_DIR)$Smultidim_knapsack.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Smultidim_knapsack.cc $(OBJ_OUT)$(OBJ_DIR)$Smultidim_knapsack.$O -$(CPP_BIN_DIR)/multidim_knapsack$E: $(OBJ_DIR)$Smultidim_knapsack.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Smultidim_knapsack.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Smultidim_knapsack$E +$(BIN_DIR)/multidim_knapsack$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Smultidim_knapsack.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Smultidim_knapsack.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Smultidim_knapsack$E $(OBJ_DIR)$Snetwork_routing.$O:$(CPP_EX_DIR)$Snetwork_routing.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Snetwork_routing.cc $(OBJ_OUT)$(OBJ_DIR)$Snetwork_routing.$O -$(CPP_BIN_DIR)/network_routing$E: $(GRAPH_DEPS) $(OBJ_DIR)$Snetwork_routing.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Snetwork_routing.$O $(OR_TOOLS_LIBS) $(GRAPH_LNK) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Snetwork_routing$E +$(BIN_DIR)/network_routing$E: $(OR_TOOLS_LIBS) $(GRAPH_DEPS) $(OBJ_DIR)$Snetwork_routing.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Snetwork_routing.$O $(OR_TOOLS_LNK) $(GRAPH_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Snetwork_routing$E $(OBJ_DIR)$Snqueens.$O: $(CPP_EX_DIR)$Snqueens.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Snqueens.cc $(OBJ_OUT)$(OBJ_DIR)$Snqueens.$O -$(CPP_BIN_DIR)/nqueens$E: $(OBJ_DIR)$Snqueens.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Snqueens.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Snqueens$E +$(BIN_DIR)/nqueens$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Snqueens.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Snqueens.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Snqueens$E $(OBJ_DIR)$Spdptw.$O: $(CPP_EX_DIR)$Spdptw.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Spdptw.cc $(OBJ_OUT)$(OBJ_DIR)$Spdptw.$O -$(CPP_BIN_DIR)/pdptw$E: $(OBJ_DIR)$Spdptw.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Spdptw.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Spdptw$E +$(BIN_DIR)/pdptw$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Spdptw.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Spdptw.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Spdptw$E $(OBJ_DIR)$Ssports_scheduling.$O:$(CPP_EX_DIR)$Ssports_scheduling.cc $(INC_DIR)$Sconstraint_solver$Sconstraint_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Ssports_scheduling.cc $(OBJ_OUT)$(OBJ_DIR)$Ssports_scheduling.$O -$(CPP_BIN_DIR)/sports_scheduling$E: $(OBJ_DIR)$Ssports_scheduling.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Ssports_scheduling.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Ssports_scheduling$E +$(BIN_DIR)/sports_scheduling$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Ssports_scheduling.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Ssports_scheduling.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Ssports_scheduling$E $(OBJ_DIR)$Stsp.$O: $(CPP_EX_DIR)$Stsp.cc $(INC_DIR)$Sconstraint_solver$Srouting.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Stsp.cc $(OBJ_OUT)$(OBJ_DIR)$Stsp.$O -$(CPP_BIN_DIR)/tsp$E: $(OBJ_DIR)$Stsp.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Stsp.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Stsp$E +$(BIN_DIR)/tsp$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Stsp.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Stsp.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Stsp$E # Flow and linear assignment cpp $(OBJ_DIR)$Slinear_assignment_api.$O:$(CPP_EX_DIR)$Slinear_assignment_api.cc $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Slinear_assignment_api.cc $(OBJ_OUT)$(OBJ_DIR)$Slinear_assignment_api.$O -$(CPP_BIN_DIR)/linear_assignment_api$E: $(OBJ_DIR)$Slinear_assignment_api.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Slinear_assignment_api.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Slinear_assignment_api$E +$(BIN_DIR)/linear_assignment_api$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Slinear_assignment_api.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Slinear_assignment_api.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Slinear_assignment_api$E $(OBJ_DIR)$Sflow_api.$O:$(CPP_EX_DIR)$Sflow_api.cc $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Sflow_api.cc $(OBJ_OUT)$(OBJ_DIR)$Sflow_api.$O -$(CPP_BIN_DIR)/flow_api$E: $(OBJ_DIR)$Sflow_api.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Sflow_api.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Sflow_api$E +$(BIN_DIR)/flow_api$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Sflow_api.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Sflow_api.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Sflow_api$E # Linear Programming Examples $(OBJ_DIR)$Sstrawberry_fields_with_column_generation.$O: $(CPP_EX_DIR)$Sstrawberry_fields_with_column_generation.cc $(INC_DIR)$Slinear_solver$Slinear_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Sstrawberry_fields_with_column_generation.cc $(OBJ_OUT)$(OBJ_DIR)$Sstrawberry_fields_with_column_generation.$O -$(CPP_BIN_DIR)/strawberry_fields_with_column_generation$E: $(OBJ_DIR)$Sstrawberry_fields_with_column_generation.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Sstrawberry_fields_with_column_generation.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Sstrawberry_fields_with_column_generation$E +$(BIN_DIR)/strawberry_fields_with_column_generation$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Sstrawberry_fields_with_column_generation.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Sstrawberry_fields_with_column_generation.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Sstrawberry_fields_with_column_generation$E $(OBJ_DIR)$Slinear_programming.$O: $(CPP_EX_DIR)$Slinear_programming.cc $(INC_DIR)$Slinear_solver$Slinear_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Slinear_programming.cc $(OBJ_OUT)$(OBJ_DIR)$Slinear_programming.$O -$(CPP_BIN_DIR)/linear_programming$E: $(OBJ_DIR)$Slinear_programming.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Slinear_programming.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Slinear_programming$E +$(BIN_DIR)/linear_programming$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Slinear_programming.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Slinear_programming.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Slinear_programming$E $(OBJ_DIR)$Slinear_solver_protocol_buffers.$O: $(CPP_EX_DIR)$Slinear_solver_protocol_buffers.cc $(INC_DIR)$Slinear_solver$Slinear_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Slinear_solver_protocol_buffers.cc $(OBJ_OUT)$(OBJ_DIR)$Slinear_solver_protocol_buffers.$O -$(CPP_BIN_DIR)/linear_solver_protocol_buffers$E: $(OBJ_DIR)$Slinear_solver_protocol_buffers.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Slinear_solver_protocol_buffers.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Slinear_solver_protocol_buffers$E +$(BIN_DIR)/linear_solver_protocol_buffers$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Slinear_solver_protocol_buffers.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Slinear_solver_protocol_buffers.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Slinear_solver_protocol_buffers$E $(OBJ_DIR)$Sinteger_programming.$O: $(CPP_EX_DIR)$Sinteger_programming.cc $(INC_DIR)$Slinear_solver$Slinear_solver.h $(CCC) $(CFLAGS) -c $(CPP_EX_DIR)$Sinteger_programming.cc $(OBJ_OUT)$(OBJ_DIR)$Sinteger_programming.$O -$(CPP_BIN_DIR)/integer_programming$E: $(OBJ_DIR)$Sinteger_programming.$O - $(CCC) $(CFLAGS) $(OBJ_DIR)$Sinteger_programming.$O $(OR_TOOLS_LIBS) $(LD_FLAGS) $(EXE_OUT)$(CPP_BIN_DIR)$Sinteger_programming$E +$(BIN_DIR)/integer_programming$E: $(OR_TOOLS_LIBS) $(OBJ_DIR)$Sinteger_programming.$O + $(CCC) $(CFLAGS) $(OBJ_DIR)$Sinteger_programming.$O $(OR_TOOLS_LNK) $(LD_FLAGS) $(EXE_OUT)$(BIN_DIR)$Sinteger_programming$E + + +# C++ generic running command + +ccc: $(BIN_DIR)$S$(basename $(notdir $(EX)))$E + +rcc: $(BIN_DIR)$S$(basename $(notdir $(EX)))$E + @echo running $(BIN_DIR)$S$(basename $(notdir $(EX)))$E + $(BIN_DIR)$S$(basename $(notdir $(EX)))$E # Java generic compilation command. -$(OBJ_DIR)$Scom$Sgoogle$Sortools$Ssamples$S$(EX).class: $(JAVA_EX_DIR)$Sgoogle$Sortools$Ssamples$S$(EX).java - javac -d $(OBJ_DIR) -cp $(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar $(JAVA_EX_DIR)$Sgoogle$Sortools$Ssamples$S$(EX).java +ifneq ($(EX),) +ifeq ($(SYSTEM),win) +EX_read_package = $(shell findstr /r "^package.*\;" $(EX)) +else +EX_read_package = $(shell grep '^package.*\;' $(EX)) +endif +EX_name = $(basename $(notdir $(EX))) +EX_package = $(subst ;,,$(subst package ,,$(EX_read_package))) +ifeq ($(EX_read_package),) +EX_class_file = $(OBJ_DIR)$S$(EX_name).class +EX_class = $(EX_name) +else +EX_class_file = $(OBJ_DIR)$S$(subst .,$S,$(EX_package))$S$(EX_name).class +EX_class = $(EX_package).$(EX_name) +endif -cjava: $(OBJ_DIR)$Scom$Sgoogle$Sortools$Ssamples$S$(EX).class -rjava: $(OBJ_DIR)$Scom$Sgoogle$Sortools$Ssamples$S$(EX).class - java -Djava.library.path=$(LIB_DIR) -cp $(OBJ_DIR)$(CPSEP)$(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar com.google.ortools.samples.$(EX) $(ARGS) +$(EX_class_file): $(LIB_DIR)$Scom.google.ortools.jar $(LIB_DIR)$Sprotobuf.jar $(EX) + $(JAVAC_BIN) -d $(OBJ_DIR) -cp $(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar $(EX) + +cjava: $(EX_class_file) + +rjava: $(EX_class_file) + $(JAVA_BIN) -Djava.library.path=$(LIB_DIR) -cp $(OBJ_DIR)$(CPSEP)$(LIB_DIR)$Scom.google.ortools.jar$(CPSEP)$(LIB_DIR)$Sprotobuf.jar $(EX_class) $(ARGS) +endif # .NET generic compilation command. -ccs: $(CS_EX_DIR)$S$(EX).cs - $(CSC) /target:exe /out:$(CS_BIN_DIR)$S$(EX).exe /platform:$(NETPLATFORM) /lib:$(CS_BIN_DIR) /r:Google.OrTools.dll /r:Google.Protobuf.dll $(CS_EX_DIR)$S$(EX).cs +$(BIN_DIR)$S$(basename $(notdir $(EX))).exe: $(BIN_DIR)/$(CLR_DLL_NAME).dll $(EX) + $(CSC) $(SIGNING_FLAGS) /target:exe /out:$(BIN_DIR)$S$(basename $(notdir $(EX))).exe /platform:$(NETPLATFORM) /lib:$(BIN_DIR) /r:$(CLR_DLL_NAME).dll /r:Google.Protobuf.dll $(EX) -rcs: ccs - $(MONO) $(CS_BIN_DIR)$S$(EX)$(CLR_EXE_SUFFIX).exe $(ARGS) +csc: $(BIN_DIR)$S$(basename $(notdir $(EX))).exe + +rcs: $(BIN_DIR)$S$(basename $(notdir $(EX))).exe + @echo running $(BIN_DIR)$S$(basename $(notdir $(EX))).exe + $(MONO) $(BIN_DIR)$S$(basename $(notdir $(EX))).exe $(ARGS) # Debug diff --git a/tools/Makfile.python b/tools/Makfile.python deleted file mode 100644 index 7190c46af9..0000000000 --- a/tools/Makfile.python +++ /dev/null @@ -1,56 +0,0 @@ - -##############################Windows specific part############################## - -# Please define WINDOWS_PYTHON_PATH (c:\\python27 by default) -WINDOWS_PYTHON_PATH = c:\\python27-64 -# Set this variable to use it as PYTHONPATH -WINDOWS_OR_TOOLS_PYTHONPATH = - -###############################Unix specific part################################ - -# Set this variable to use a different python version. Example : PYTHON_VERSION = 3.5 or PYTHON_VERSION = 2 -PYTHON_VERSION = - -# Set this variable to use it as PYTHONPATH -UNIX_OR_TOOLS_PYTHONPATH = - -################################################################################## - -.PHONY: rpy install check - -# Let's discover something about where we run -ifeq "$(SHELL)" "cmd.exe" - SYSTEM = win -else -ifeq "$(SHELL)" "sh.exe" -SYSTEM = win - S = \\ -else - SYSTEM = unix - S = / -endif -endif - -ifeq ($(SYSTEM),win) -PYTHON_EXECUTABLE = $(WINDOWS_PYTHON_PATH)$Spython -SET_PYTHON_PATH = @set PYTHONPATH=$(WINDOWS_OR_TOOLS_PYTHONPATH) && -else -PYTHON_EXECUTABLE = python$(PYTHON_VERSION) -SET_PYTHON_PATH = @PYTHONPATH=$(UNIX_OR_TOOLS_PYTHONPATH) -endif - -install: - $(PYTHON_EXECUTABLE) setup.py install --user - $(SET_PYTHON_PATH) $(PYTHON_EXECUTABLE) check_python_deps.py --log=ERROR - -check: - $(SET_PYTHON_PATH) $(PYTHON_EXECUTABLE) check_python_deps.py --log=INFO - -rpy: $(EX) - @echo Running $(EX) - $(SET_PYTHON_PATH) $(PYTHON_EXECUTABLE) check_python_deps.py --log=ERROR - $(SET_PYTHON_PATH) $(PYTHON_EXECUTABLE) $(EX) $(ARGS) - - - -print-% : ; @echo $* = $($*) \ No newline at end of file diff --git a/tools/README.cc.java.csharp b/tools/README.cc.java.csharp index 48d1d38361..b2ca0938ba 100644 --- a/tools/README.cc.java.csharp +++ b/tools/README.cc.java.csharp @@ -25,12 +25,12 @@ or-tools/ Use Makefile: - on unix: -make bin/cpp/golomb -./bin/cpp/golomb +make bin/golomb +./bin/golomb - on windows: -make bin\\cpp\\golomb.exe -bin\\cpp\golomb.exe +make bin\\golomb.exe +bin\\golomb.exe ########################## java ########################## @@ -64,17 +64,17 @@ make rcs EX=csflow This is equivalent to compiling and running examples/csflow.cs and running 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 +csc /target:exe /out:bin\csflow.exe /platform:x86 /lib:bin /r:Google.OrTools.dll examples\csharp\csflow.cs +bin\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 +csc /target:exe /out:bin/csflow.exe /platform:x64 /lib:bin /r:Google.OrTools.dll examples\csharp\csflow.cs +bin\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=bin/csharp mono bin/csharp/csflow.exe +mcs /target:exe /out:bin/csflow.exe /platform:anycpu /lib:bin /r:Google.OrTools.dll examples/csharp/csflow.cs +MONO_PATH=bin mono bin/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 +mcs /target:exe /out:bin/csflow.exe /platform:anycpu /lib:bin /r:Google.OrTools.dll examples/csharp/csflow.cs +DYLD_FALLBACK_LIBRARY_PATH=lib mono64 bin/csflow.exe diff --git a/tools/README.dotnet b/tools/README.dotnet index 5a03e32d15..bba1394cb0 100644 --- a/tools/README.dotnet +++ b/tools/README.dotnet @@ -25,17 +25,17 @@ make rcs EX=csflow This is equivalent to compiling and running examples/csflow.cs and running 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 +csc /target:exe /out:bin\csflow.exe /platform:x86 /lib:bin /r:Google.OrTools.dll examples\csharp\csflow.cs +bin\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 +csc /target:exe /out:bin/csflow.exe /platform:x64 /lib:bin /r:Google.OrTools.dll examples\csharp\csflow.cs +bin\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=bin/csharp mono bin/csharp/csflow.exe +mcs /target:exe /out:bin/csflow.exe /platform:anycpu /lib:bin /r:Google.OrTools.dll examples/csharp/csflow.cs +MONO_PATH=bin mono bin/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 +mcs /target:exe /out:bin/csflow.exe /platform:anycpu /lib:bin /r:Google.OrTools.dll examples/csharp/csflow.cs +DYLD_FALLBACK_LIBRARY_PATH=lib mono64 bin/csflow.exe diff --git a/tools/fix_libraries_on_linux.sh b/tools/fix_libraries_on_linux.sh index a056747865..cf92283008 100755 --- a/tools/fix_libraries_on_linux.sh +++ b/tools/fix_libraries_on_linux.sh @@ -1,4 +1,4 @@ dependencies/install/bin/patchelf --set-rpath '$ORIGIN' temp/or-tools*/lib/libjniortools.so dependencies/install/bin/patchelf --set-rpath '$ORIGIN' temp/or-tools*/lib/libcvrptw_lib.so dependencies/install/bin/patchelf --set-rpath '$ORIGIN' temp/or-tools*/lib/libdimacs.so -dependencies/install/bin/patchelf --set-rpath '$ORIGIN/../../lib' temp/or-tools*/bin/csharp/libGoogle.OrTools.so +dependencies/install/bin/patchelf --set-rpath '$ORIGIN/../../lib' temp/or-tools*/bin/libGoogle.OrTools.so diff --git a/tools/install_libortools_mac.sh b/tools/install_libortools_mac.sh index a9575f15a0..c7d0840973 100755 --- a/tools/install_libortools_mac.sh +++ b/tools/install_libortools_mac.sh @@ -1,6 +1,6 @@ export N=`pwd`/lib -export B=`pwd`/bin/csharp +export B=`pwd`/bin export O=`otool -L lib/libortools.dylib | grep -v ':' | grep libortools | cut -d '(' -f 1` echo install library in path $N echo "$O"