fix windows compilation except c#

This commit is contained in:
lperron@google.com
2012-04-04 16:09:38 +00:00
parent e1773300a1
commit 0eaa7a5f88
6 changed files with 49 additions and 48 deletions

View File

@@ -23,7 +23,7 @@ class UpVar : public BaseLNS {
virtual ~UpVar() {}
virtual bool NextFragment(vector<int>* fragment) {
virtual bool NextFragment(std::vector<int>* fragment) {
bool all_done = true;
for (int i = 0; i < Size(); ++i) {
if (Value(i) == 0) {
@@ -93,11 +93,11 @@ void BuildModelWithSearch(int workers,
// Standard model building.
Solver s(StringPrintf("Worker_%i", worker));
VLOG(1) << "Worker " << worker << " started";
vector<IntVar*> vars;
std::vector<IntVar*> vars;
s.MakeBoolVarArray(workers, "vars", &vars);
Assignment* const solution = s.MakeAssignment();
solution->Add(vars);
vector<int> coefficients;
std::vector<int> coefficients;
int obj_max = 0;
for (int i = 0; i < workers; ++i) {
const int value = (i + 1) * (i + 1);
@@ -110,7 +110,7 @@ void BuildModelWithSearch(int workers,
SolutionCollector* const collector =
master ? s.MakeLastSolutionCollector(solution) : NULL;
vector<SearchMonitor*> monitors;
std::vector<SearchMonitor*> monitors;
// Create or wait for initial solution.
if (master) {

View File

@@ -64,30 +64,30 @@ GRAPH_LNK = \
# Binaries
CPBINARIES = \
$(BIN_DIR)$Scostas_array$E \
$(BIN_DIR)$Scryptarithm$E \
$(BIN_DIR)$Scvrptw$E \
$(BIN_DIR)$Sdobble_ls$E \
$(BIN_DIR)$Sflow_api$E \
$(BIN_DIR)$Sgolomb$E \
$(BIN_DIR)$Sjobshop$E \
$(BIN_DIR)$Sjobshop_ls$E \
$(BIN_DIR)$Slinear_assignment_api$E \
$(BIN_DIR)$Smagic_square$E \
$(BIN_DIR)$Smodel_util$E \
$(BIN_DIR)$Smultidim_knapsack$E \
$(BIN_DIR)$Snetwork_routing$E \
$(BIN_DIR)$Snqueens$E \
$(BIN_DIR)$Spdptw$E \
$(BIN_DIR)$Sdimacs_assignment$E \
$(BIN_DIR)$Ssports_scheduling$E \
$(BIN_DIR)$Stsp$E
$(BIN_DIR)/costas_array$E \
$(BIN_DIR)/cryptarithm$E \
$(BIN_DIR)/cvrptw$E \
$(BIN_DIR)/dobble_ls$E \
$(BIN_DIR)/flow_api$E \
$(BIN_DIR)/golomb$E \
$(BIN_DIR)/jobshop$E \
$(BIN_DIR)/jobshop_ls$E \
$(BIN_DIR)/linear_assignment_api$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)/dimacs_assignment$E \
$(BIN_DIR)/sports_scheduling$E \
$(BIN_DIR)/tsp$E
LPBINARIES = \
$(BIN_DIR)$Sinteger_programming$E \
$(BIN_DIR)$Slinear_programming$E \
$(BIN_DIR)$Slinear_solver_protocol_buffers$E \
$(BIN_DIR)$Sstrawberry_fields_with_column_generation$E
$(BIN_DIR)/integer_programming$E \
$(BIN_DIR)/linear_programming$E \
$(BIN_DIR)/linear_solver_protocol_buffers$E \
$(BIN_DIR)/strawberry_fields_with_column_generation$E
# Special dimacs example.

View File

@@ -52,7 +52,7 @@ $(OBJ_DIR)/linear_solver_csharp_wrap.$O: $(GEN_DIR)/linear_solver/linear_solver_
$(BIN_DIR)/Google.OrTools.LinearSolver.dll: $(OBJ_DIR)/linear_solver_csharp_wrap.$O $(LP_DEPS) $(SRC_DIR)/com/google/ortools/linearsolver/LinearExpr.cs $(SRC_DIR)/com/google/ortools/linearsolver/LinearConstraint.cs
ifeq ($(SYSTEM),win)
$(CSC) /target:module /out:$(LIB_DIR)$S$(LIBPREFIX)Google.OrTools.LinearSolver.netmodule /warn:0 /nologo /debug $(GEN_DIR)\\com\\google\\ortools\\linearsolver\\*.cs $(SRC_DIR)/com\\google\\ortools\\linearsolver\\*.cs
$(CSC) /target:module /out:$(LIB_DIR)$S$(LIBPREFIX)Google.OrTools.LinearSolver.netmodule /warn:0 /nologo /debug $(GEN_DIR)\\com\\google\\ortools\\linearsolver\\*.cs $(SRC_DIR)\\com\\google\\ortools\\linearsolver\\*.cs
$(LD) $(LDOUT)$(BIN_DIR)\\Google.OrTools.LinearSolver.dll $(LIB_DIR)$S$(LIBPREFIX)Google.OrTools.LinearSolver.netmodule $(OBJ_DIR)\\linear_solver_csharp_wrap.$O $(LP_LNK) $(LDFLAGS)
else
$(CSC) /target:library /out:$(BIN_DIR)/Google.OrTools.LinearSolver.dll /warn:0 /nologo /debug $(GEN_DIR)/com/google/ortools/linearsolver/*.cs $(SRC_DIR)/com/google/ortools/linearsolver/*.cs
@@ -87,7 +87,7 @@ $(OBJ_DIR)/constraint_solver_csharp_wrap.$O: $(GEN_DIR)/constraint_solver/constr
$(BIN_DIR)/Google.OrTools.ConstraintSolver.dll: $(OBJ_DIR)/constraint_solver_csharp_wrap.$O $(ROUTING_DEPS) $(SRC_DIR)/com/google/ortools/constraintsolver/IntVarArrayHelper.cs $(SRC_DIR)/com/google/ortools/constraintsolver/IntervalVarArrayHelper.cs $(SRC_DIR)/com/google/ortools/constraintsolver/IntArrayHelper.cs $(SRC_DIR)/com/google/ortools/constraintsolver/ValCstPair.cs $(SRC_DIR)/com/google/ortools/constraintsolver/NetDecisionBuilder.cs
ifeq ($(SYSTEM),win)
$(CSC) /target:module /out:$(LIB_DIR)$S$(LIBPREFIX)Google.OrTools.ConstraintSolver.netmodule /warn:0 /nologo /debug $(GEN_DIR)\\com\\google\\ortools\\constraintsolver\\*.cs com\\google\\ortools\\constraintsolver\\*.cs
$(CSC) /target:module /out:$(LIB_DIR)$S$(LIBPREFIX)Google.OrTools.ConstraintSolver.netmodule /warn:0 /nologo /debug $(GEN_DIR)\\com\\google\\ortools\\constraintsolver\\*.cs $(SRC_DIR)\\com\\google\\ortools\\constraintsolver\\*.cs
$(LD) $(LDOUT)$(BIN_DIR)\\Google.OrTools.ConstraintSolver.dll $(LIB_DIR)$S$(LIBPREFIX)Google.OrTools.ConstraintSolver.netmodule $(OBJ_DIR)$Sconstraint_solver_csharp_wrap.$O $(ROUTING_LNK) $(LDFLAGS)
else
$(CSC) /target:library /out:$(BIN_DIR)/Google.OrTools.ConstraintSolver.dll /warn:0 /nologo /debug $(GEN_DIR)/com/google/ortools/constraintsolver/*.cs $(SRC_DIR)/com/google/ortools/constraintsolver/*.cs

View File

@@ -345,20 +345,21 @@ java_archive: java
-$(DELREC) temp
$(MKDIR) temp
$(MKDIR) temp$Sor-tools.$(PLATFORM)
$(COPY) *.jar temp$Sor-tools.$(PLATFORM)
$(COPY) $(LIB_DIR)$S$(LIBPREFIX)jni*.$(JNILIBEXT) temp$Sor-tools.$(PLATFORM)
$(MKDIR) temp$Sor-tools.$(PLATFORM)\lib
$(COPY) lib\*.jar temp$Sor-tools.$(PLATFORM)\lin
$(COPY) $(LIB_DIR)$S$(LIBPREFIX)jni*.$(JNILIBEXT) temp$Sor-tools.$(PLATFORM)\lib
ifeq ("$(SYSTEM)","win")
tools\mkdir temp\or-tools.$(PLATFORM)\com
tools\mkdir temp\or-tools.$(PLATFORM)\com\google
tools\mkdir temp\or-tools.$(PLATFORM)\com\google\ortools
tools\mkdir temp\or-tools.$(PLATFORM)\com\google\ortools\constraintsolver
tools\mkdir temp\or-tools.$(PLATFORM)\com\google\ortools\constraintsolver\samples
tools\mkdir temp\or-tools.$(PLATFORM)\com\google\ortools\linearsolver
tools\mkdir temp\or-tools.$(PLATFORM)\com\google\ortools\linearsolver\samples
tools\mkdir temp\or-tools.$(PLATFORM)\com\google\ortools\graph
tools\mkdir temp\or-tools.$(PLATFORM)\com\google\ortools\graph\samples
tools\mkdir temp\or-tools.$(PLATFORM)\com\google\ortools\knapsacksolver
tools\mkdir temp\or-tools.$(PLATFORM)\com\google\ortools\knapsacksolver\samples
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com\google
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com\google\ortools
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com\google\ortools\constraintsolver
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com\google\ortools\constraintsolver\samples
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com\google\ortools\linearsolver
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com\google\ortools\linearsolver\samples
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com\google\ortools\graph
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com\google\ortools\graph\samples
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com\google\ortools\knapsacksolver
tools\mkdir temp\or-tools.$(PLATFORM)\examples\com\google\ortools\knapsacksolver\samples
tools\mkdir temp\or-tools.$(PLATFORM)\data
tools\mkdir temp\or-tools.$(PLATFORM)\data\discrete_tomography
tools\mkdir temp\or-tools.$(PLATFORM)\data\fill_a_pix
@@ -372,10 +373,10 @@ ifeq ("$(SYSTEM)","win")
copy data\rogo\* temp\or-tools.$(PLATFORM)\data\rogo
copy data\survo_puzzle\* temp\or-tools.$(PLATFORM)\data\survo_puzzle
copy data\quasigroup_completion\* temp\or-tools.$(PLATFORM)\data\quasigroup_completion
copy com\google\ortools\constraintsolver\samples\*.java temp\or-tools.$(PLATFORM)\com\google\ortools\constraintsolver\samples
copy com\google\ortools\linearsolver\samples\*.java temp\or-tools.$(PLATFORM)\com\google\ortools\linearsolver\samples
copy com\google\ortools\graph\samples\*.java temp\or-tools.$(PLATFORM)\com\google\ortools\graph\samples
copy com\google\ortools\knapsacksolver\samples\*.java temp\or-tools.$(PLATFORM)\com\google\ortools\knapsacksolver\samples
copy examples\com\google\ortools\constraintsolver\samples\*.java temp\or-tools.$(PLATFORM)\examples\com\google\ortools\constraintsolver\samples
copy examples\com\google\ortools\linearsolver\samples\*.java temp\or-tools.$(PLATFORM)\examples\com\google\ortools\linearsolver\samples
copy examples\com\google\ortools\graph\samples\*.java temp\or-tools.$(PLATFORM)\examples\com\google\ortools\graph\samples
copy examples\com\google\ortools\knapsacksolver\samples\*.java temp\or-tools.$(PLATFORM)\examples\com\google\ortools\knapsacksolver\samples
cd temp$Sor-tools.$(PLATFORM) && tar -C ..$S.. -c -v com | tar -x -v -m --exclude=*.cs --exclude=*svn*
cd temp && ..$Stools$Szip.exe -r ..$SGoogle.OrTools.java.$(PLATFORM).$(SVNVERSION).zip or-tools.$(PLATFORM)
else

View File

@@ -20,7 +20,7 @@ Mutex::Mutex() : real_mutex_(new tthread::mutex) {}
Mutex::~Mutex() {}
void Mutex::Lock() { real_mutex_->lock(); }
void Mutex::Unlock() { real_mutex_->unlock(); }
bool Mutex::TryLock() { real_mutex_->try_lock(); }
bool Mutex::TryLock() { return real_mutex_->try_lock(); }
tthread::mutex* Mutex::RealMutex() const { return real_mutex_.get(); }
CondVar::CondVar() : real_condition_(new tthread::condition_variable) {}

View File

@@ -292,7 +292,7 @@ MtSolveSupport::MtSolveSupport(
solution_barrier_(new Barrier(workers_ + 1)),
enter_search_barrier_(new Barrier(workers_ + 1)),
exit_search_barrier_(new Barrier(workers_ + 1)),
fail_stamp_(0LLU),
fail_stamp_(0ULL),
started_slaves_(0),
ended_slaves_(0) {
Reset();
@@ -313,7 +313,7 @@ void MtSolveSupport::Reset() {
ended_slaves_ = 0;
master_blocked_ = false;
best_exported_cost_ = maximize() ? kint64min : kint64max;
fail_stamp_ = 0LLU;
fail_stamp_ = 0ULL;
local_solution_->mutable_worker_info()->set_worker_id(-1);
local_solution_->set_is_valid(false);
}