[BUILD] remove old version of make third_party; use cmake to build dependencies

This commit is contained in:
Laurent Perron
2022-02-18 15:35:32 +01:00
parent 31d214411c
commit 1e06115bf6
11 changed files with 374 additions and 7048 deletions

View File

@@ -1,2 +0,0 @@
exports_files([
])

Binary file not shown.

View File

@@ -1 +0,0 @@
This directory will contains the sources of all dependencies of or-tools.

View File

@@ -21,33 +21,9 @@ endif
# All libraries and dependecies
OR_TOOLS_LIBS = $(LIB_DIR)/$(LIB_PREFIX)ortools.$L
HAS_CCC = true
ifndef CCC
HAS_CCC =
endif
# Main target
.PHONY: cc # Build C++ OR-Tools library.
.PHONY: check_cc # Quick check only running C++ OR-Tools samples targets.
.PHONY: test_cc # Run all C++ OR-Tools test targets.
.PHONY: test_fz # Run all Flatzinc OR-Tools examples.
.PHONY: package_cc # Create C++ OR-Tools "package" (archive).
ifndef HAS_CCC
cc:
@echo CCC = $(CCC)
$(warning Cannot find '$@' command which is needed for build. Please make sure it is installed and in system PATH.)
check_cc: cc
test_cc: cc
test_fz: cc
package_cc: cc
else
cc: $(OR_TOOLS_LIBS)
check_cc: check_cc_pimpl
test_cc: test_cc_pimpl
test_fz: test_fz_pimpl
package_cc: package_cc_pimpl
BUILT_LANGUAGES += C++
endif
$(GEN_DIR):
-$(MKDIR_P) $(GEN_PATH)
@@ -160,146 +136,17 @@ $(OBJ_DIR)/util: | $(OBJ_DIR)
$(OBJ_DIR)/swig: | $(OBJ_DIR)
-$(MKDIR_P) $(OBJ_DIR)$Sswig
###############
## CPP LIB ##
###############
# build from: $> grep "pb\.h:" makefiles/Makefile.gen.mk
PROTO_DEPS = \
$(GEN_DIR)/ortools/bop/bop_parameters.pb.h \
$(GEN_DIR)/ortools/constraint_solver/assignment.pb.h \
$(GEN_DIR)/ortools/constraint_solver/demon_profiler.pb.h \
$(GEN_DIR)/ortools/constraint_solver/routing_enums.pb.h \
$(GEN_DIR)/ortools/constraint_solver/routing_parameters.pb.h \
$(GEN_DIR)/ortools/constraint_solver/search_limit.pb.h \
$(GEN_DIR)/ortools/constraint_solver/search_stats.pb.h \
$(GEN_DIR)/ortools/constraint_solver/solver_parameters.pb.h \
$(GEN_DIR)/ortools/glop/parameters.pb.h \
$(GEN_DIR)/ortools/graph/flow_problem.pb.h \
$(GEN_DIR)/ortools/linear_solver/linear_solver.pb.h \
$(GEN_DIR)/ortools/packing/multiple_dimensions_bin_packing.pb.h \
$(GEN_DIR)/ortools/packing/vector_bin_packing.pb.h \
$(GEN_DIR)/ortools/sat/boolean_problem.pb.h \
$(GEN_DIR)/ortools/sat/cp_model.pb.h \
$(GEN_DIR)/ortools/sat/sat_parameters.pb.h \
$(GEN_DIR)/ortools/scheduling/jobshop_scheduling.pb.h \
$(GEN_DIR)/ortools/scheduling/rcpsp.pb.h \
$(GEN_DIR)/ortools/util/optional_boolean.pb.h
include $(OR_ROOT)makefiles/Makefile.gen.mk
ifeq ($(USE_SCIP),ON)
PROTO_DEPS += $(GEN_DIR)/ortools/gscip/gscip.pb.h
else
undefine GSCIP_LIB_OBJS
endif
all_protos: $(PROTO_DEPS)
# OR Tools unique library.
$(OR_TOOLS_LIBS): \
dependencies/check.log \
$(BASE_LIB_OBJS) \
$(PORT_LIB_OBJS) \
$(UTIL_LIB_OBJS) \
$(SCHEDULING_LIB_OBJS) \
$(LP_DATA_LIB_OBJS) \
$(GLOP_LIB_OBJS) \
$(BOP_LIB_OBJS) \
$(LP_LIB_OBJS) \
$(GRAPH_LIB_OBJS) \
$(ALGORITHMS_LIB_OBJS) \
$(SAT_LIB_OBJS) \
$(PACKING_LIB_OBJS) \
$(CP_LIB_OBJS) \
$(GSCIP_LIB_OBJS) \
$(GUROBI_LIB_OBJS) | $(LIB_DIR)
$(LINK_CMD) \
$(LD_OUT)$(LIB_DIR)$S$(LIB_PREFIX)ortools.$L \
$(BASE_LIB_OBJS) \
$(PORT_LIB_OBJS) \
$(UTIL_LIB_OBJS) \
$(SCHEDULING_LIB_OBJS) \
$(LP_DATA_LIB_OBJS) \
$(GLOP_LIB_OBJS) \
$(GRAPH_LIB_OBJS) \
$(ALGORITHMS_LIB_OBJS) \
$(SAT_LIB_OBJS) \
$(BOP_LIB_OBJS) \
$(LP_LIB_OBJS) \
$(PACKING_LIB_OBJS) \
$(CP_LIB_OBJS) \
$(GSCIP_LIB_OBJS) \
$(GUROBI_LIB_OBJS) \
$(DEPENDENCIES_LNK) \
$(LDFLAGS)
$(OR_TOOLS_LIBS): cc
#####################
## Flatzinc code ##
#####################
FLATZINC_LIBS = $(LIB_DIR)/$(LIB_PREFIX)fz.$L
FLATZINC_PATH = $(subst /,$S,$(FLATZINC_LIBS))
FLATZINC_DEPS = \
$(SRC_DIR)/ortools/flatzinc/checker.h \
$(SRC_DIR)/ortools/flatzinc/cp_model_fz_solver.h \
$(SRC_DIR)/ortools/flatzinc/model.h \
$(SRC_DIR)/ortools/flatzinc/parser.h \
$(SRC_DIR)/ortools/flatzinc/parser.tab.hh \
$(SRC_DIR)/ortools/flatzinc/presolve.h \
$(CP_DEPS) \
$(SAT_DEPS)
FLATZINC_LNK = $(PRE_LIB)fz$(POST_LIB) $(OR_TOOLS_LNK)
ifeq ($(PLATFORM),MACOSX)
FLATZINC_LDFLAGS = -install_name @rpath/$(LIB_PREFIX)fz.$L #
endif
cc:
cmake --build dependencies --target install -j 8
FLATZINC_OBJS=\
$(OBJ_DIR)/flatzinc/checker.$O \
$(OBJ_DIR)/flatzinc/cp_model_fz_solver.$O \
$(OBJ_DIR)/flatzinc/model.$O \
$(OBJ_DIR)/flatzinc/parser.$O \
$(OBJ_DIR)/flatzinc/parser.tab.$O \
$(OBJ_DIR)/flatzinc/parser.yy.$O \
$(OBJ_DIR)/flatzinc/presolve.$O
test_cc:
cd dependencies && ctest -R cxx_ -VV
fz_parser: #$(SRC_DIR)/ortools/flatzinc/parser.lex $(SRC_DIR)/ortools/flatzinc/parser.yy
flex -o $(SRC_DIR)/ortools/flatzinc/parser.yy.cc $(SRC_DIR)/ortools/flatzinc/parser.lex
bison -t -o $(SRC_DIR)/ortools/flatzinc/parser.tab.cc -d $(SRC_DIR)/ortools/flatzinc/parser.yy
$(OBJ_DIR)/flatzinc/%.$O: $(SRC_DIR)/ortools/flatzinc/%.cc $(FLATZINC_DEPS) | $(OBJ_DIR)/flatzinc
$(CCC) $(CFLAGS) -c $(SRC_DIR)$Sortools$Sflatzinc$S$*.cc $(OBJ_OUT)$(OBJ_DIR)$Sflatzinc$S$*.$O
$(FLATZINC_LIBS): $(OR_TOOLS_LIBS) $(FLATZINC_OBJS) | $(LIB_DIR)
$(LINK_CMD) \
$(FLATZINC_LDFLAGS) \
$(LD_OUT)$(LIB_DIR)$S$(LIB_PREFIX)fz.$L \
$(FLATZINC_OBJS) \
$(OR_TOOLS_LNK) \
$(OR_TOOLS_LDFLAGS)
.PHONY: fz # Build Flatzinc binaries.
fz: \
$(BIN_DIR)/ortools.msc \
$(BIN_DIR)/fz$E \
$(BIN_DIR)/parser_main$E
$(BIN_DIR)/ortools.msc: $(SRC_DIR)/ortools/flatzinc/ortools.msc.in | $(BIN_DIR)
$(SED) -e "s/@PROJECT_VERSION@/$(OR_TOOLS_VERSION)/" \
ortools$Sflatzinc$Sortools.msc.in \
> $(BIN_DIR)$Sortools.msc
$(SED) -i -e "s/@FZ_REL_INSTALL_BINARY@/.\/fz$E/" \
$(BIN_DIR)$Sortools.msc
$(BIN_DIR)/fz$E: $(OBJ_DIR)/flatzinc/fz.$O $(FLATZINC_LIBS) $(OR_TOOLS_LIBS) | $(BIN_DIR)
$(CCC) $(CFLAGS) $(OBJ_DIR)$Sflatzinc$Sfz.$O $(FLATZINC_LNK) $(OR_TOOLS_LDFLAGS) $(EXE_OUT)$(BIN_DIR)$Sfz$E
$(BIN_DIR)/parser_main$E: $(OBJ_DIR)/flatzinc/parser_main.$O $(FLATZINC_LIBS) $(OR_TOOLS_LIBS) | $(BIN_DIR)
$(CCC) $(CFLAGS) $(OBJ_DIR)$Sflatzinc$Sparser_main.$O $(FLATZINC_LNK) $(OR_TOOLS_LDFLAGS) $(EXE_OUT)$(BIN_DIR)$Sparser_main$E
.PHONY: clean_fz # Clean Flatzinc output from previous build.
clean_fz:
-$(DEL) $(BIN_DIR)$Sortools.msc
-$(DEL) $(BIN_DIR)$Sfz$E
-$(DEL) $(BIN_DIR)$Sparser_main$E
##################
## Sat solver ##
@@ -311,7 +158,7 @@ $(OBJ_DIR)/sat_runner.$O: \
$(CC_EX_DIR)/opb_reader.h \
$(CC_EX_DIR)/sat_cnf_reader.h \
$(SAT_DEPS) | $(OBJ_DIR)
$(CCC) $(CFLAGS) -c $(CC_EX_PATH)$Ssat_runner.cc $(OBJ_OUT)$(OBJ_DIR)$Ssat_runner.$O
$(CCC) $(CFLAGS) -I$(SRC_DIR) -c $(CC_EX_PATH)$Ssat_runner.cc $(OBJ_OUT)$(OBJ_DIR)$Ssat_runner.$O
##################
## C++ SOURCE ##
@@ -403,179 +250,6 @@ $(BIN_DIR)/course_scheduling$E: $(OBJ_DIR)/course_scheduling.$O $(OBJ_DIR)/cours
rcc_course_scheduling: $(BIN_DIR)/course_scheduling$E FORCE
$(BIN_DIR)$S$*$E $(ARGS)
##################################
## Test targets ##
##################################
.PHONY: test_cc_algorithms_samples # Build and Run all C++ Algorithms Samples (located in ortools/algorithms/samples)
test_cc_algorithms_samples: \
rcc_knapsack \
rcc_simple_knapsack_program
.PHONY: test_cc_graph_samples # Build and Run all C++ Graph Samples (located in ortools/graph/samples)
test_cc_graph_samples: \
rcc_assignment_linear_sum_assignment \
rcc_assignment_min_flow \
rcc_balance_min_flow \
rcc_simple_max_flow_program \
rcc_simple_min_cost_flow_program
.PHONY: test_cc_linear_solver_samples # Build and Run all C++ LP Samples (located in ortools/linear_solver/samples)
test_cc_linear_solver_samples: \
rcc_assignment_mip \
rcc_basic_example \
rcc_bin_packing_mip \
rcc_integer_programming_example \
rcc_linear_programming_example \
rcc_mip_var_array \
rcc_multiple_knapsack_mip \
rcc_simple_lp_program \
rcc_simple_mip_program \
rcc_stigler_diet
.PHONY: test_cc_constraint_solver_samples # Build and Run all C++ CP Samples (located in ortools/constraint_solver/samples)
test_cc_constraint_solver_samples: \
rcc_minimal_jobshop_cp \
rcc_nurses_cp \
rcc_rabbits_and_pheasants_cp \
rcc_simple_ls_program \
rcc_simple_cp_program \
rcc_simple_routing_program \
rcc_tsp \
rcc_tsp_cities \
rcc_tsp_circuit_board \
rcc_tsp_distance_matrix \
rcc_vrp \
rcc_vrp_breaks \
rcc_vrp_capacity \
rcc_vrp_drop_nodes \
rcc_vrp_global_span \
rcc_vrp_initial_routes \
rcc_vrp_pickup_delivery \
rcc_vrp_pickup_delivery_fifo \
rcc_vrp_pickup_delivery_lifo \
rcc_vrp_resources \
rcc_vrp_starts_ends \
rcc_vrp_time_windows \
rcc_vrp_with_time_limit
.PHONY: test_cc_sat_samples # Build and Run all C++ Sat Samples (located in ortools/sat/samples)
test_cc_sat_samples: \
rcc_assignment_sat \
rcc_assumptions_sample_sat \
rcc_binpacking_problem_sat \
rcc_bool_or_sample_sat \
rcc_channeling_sample_sat \
rcc_cp_is_fun_sat \
rcc_earliness_tardiness_cost_sample_sat \
rcc_interval_sample_sat \
rcc_literal_sample_sat \
rcc_no_overlap_sample_sat \
rcc_optional_interval_sample_sat \
rcc_rabbits_and_pheasants_sat \
rcc_ranking_sample_sat \
rcc_reified_sample_sat \
rcc_search_for_all_solutions_sample_sat \
rcc_simple_sat_program \
rcc_solution_hinting_sample_sat \
rcc_solve_and_print_intermediate_solutions_sample_sat \
rcc_solve_with_time_limit_sample_sat \
rcc_step_function_sample_sat \
rcc_stop_after_n_solutions_sample_sat
.PHONY: check_cc_pimpl
check_cc_pimpl: \
test_cc_algorithms_samples \
test_cc_constraint_solver_samples \
test_cc_graph_samples \
test_cc_linear_solver_samples \
test_cc_sat_samples \
\
rcc_linear_programming \
rcc_constraint_programming_cp \
rcc_integer_programming \
rcc_knapsack \
rcc_max_flow \
rcc_min_cost_flow ;
.PHONY: test_cc_tests # Build and Run all C++ Tests (located in ortools/examples/tests)
test_cc_tests: \
rcc_lp_test \
rcc_bug_fz1 \
rcc_cpp11_test \
rcc_forbidden_intervals_test \
rcc_issue57 \
rcc_min_max_test
# $(MAKE) rcc_issue173 # error: too long
.PHONY: test_cc_contrib # Build and Run all C++ Contrib (located in ortools/examples/contrib)
test_cc_contrib: ;
.PHONY: test_cc_cpp # Build and Run all C++ Examples (located in ortools/examples/cpp)
test_cc_cpp: \
rcc_costas_array_sat \
rcc_cryptarithm_sat \
rcc_cvrp_disjoint_tw \
rcc_cvrptw \
rcc_cvrptw_with_breaks \
rcc_cvrptw_with_refueling \
rcc_cvrptw_with_resources \
rcc_cvrptw_with_stop_times_and_resources \
rcc_flow_api \
rcc_linear_assignment_api \
rcc_linear_solver_protocol_buffers \
rcc_magic_sequence_sat \
rcc_magic_square_sat \
rcc_nqueens \
rcc_random_tsp \
rcc_slitherlink_sat \
rcc_strawberry_fields_with_column_generation \
rcc_uncapacitated_facility_location \
rcc_weighted_tardiness_sat
$(MAKE) run \
SOURCE=examples/cpp/dimacs_assignment.cc \
ARGS=examples/data/dimacs/assignment/small.asn
$(MAKE) run \
SOURCE=examples/cpp/dobble_ls.cc \
ARGS="--time_limit_in_ms=10000"
$(MAKE) run \
SOURCE=examples/cpp/golomb_sat.cc \
ARGS="--size=5"
$(MAKE) run \
SOURCE=examples/cpp/jobshop_sat.cc \
ARGS="--input=examples/data/jobshop/ft06"
$(MAKE) run \
SOURCE=examples/cpp/mps_driver.cc \
ARGS="--input examples/data/tests/test.mps"
$(MAKE) run \
SOURCE=examples/cpp/network_routing_sat.cc \
ARGS="--clients=10 --backbones=5 --demands=10 --traffic_min=5 --traffic_max=10 --min_client_degree=2 --max_client_degree=5 --min_backbone_degree=3 --max_backbone_degree=5 --max_capacity=20 --fixed_charge_cost=10"
$(MAKE) run \
SOURCE=examples/cpp/sports_scheduling_sat.cc \
ARGS="--params max_time_in_seconds:10.0"
# $(MAKE) run SOURCE=examples/cpp/frequency_assignment_problem.cc # Need data file
# $(MAKE) run SOURCE=examples/cpp/pdptw.cc ARGS="--pdp_file examples/data/pdptw/LC1_2_1.txt" # Fails on windows...
$(MAKE) run SOURCE=examples/cpp/shift_minimization_sat.cc ARGS="--input examples/data/shift_scheduling/minimization/data_1_23_40_66.dat"
$(MAKE) run \
SOURCE=examples/cpp/solve.cc \
ARGS="--input examples/data/tests/test2.mps"
.PHONY: test_cc_pimpl
test_cc_pimpl: \
check_cc_pimpl \
test_cc_tests \
test_cc_contrib \
test_cc_cpp
.PHONY: test_fz_pimpl
test_fz_pimpl: \
rfz_golomb \
rfz_alpha
rfz_%: fz $(FZ_EX_DIR)/%.fzn
$(BIN_DIR)$Sfz$E $(FZ_EX_PATH)$S$*.fzn
#################
## Packaging ##
#################

View File

@@ -436,7 +436,7 @@ ifeq ($(SYSTEM),win)
$(SED) -i -e 's/$$<$$<STREQUAL.*@PROJECT_NAME@>>//' \
$(TEMP_DOTNET_DIR)$S$(DOTNET_ORTOOLS_RUNTIME_ASSEMBLY_NAME)$S$(DOTNET_ORTOOLS_RUNTIME_ASSEMBLY_NAME).csproj
else
$(SED) -i -e 's/$$<$$<STREQUAL.*@PROJECT_NAME@>>/;..\/..\/lib\/$(LIB_PREFIX)ortools.$L/' \
$(SED) -i -e 's/$$<$$<STREQUAL.*@PROJECT_NAME@>>/;..\/..\/lib\/$(LIB_PREFIX)ortools.$L.$(OR_TOOLS_MAJOR)/' \
$(TEMP_DOTNET_DIR)$S$(DOTNET_ORTOOLS_RUNTIME_ASSEMBLY_NAME)$S$(DOTNET_ORTOOLS_RUNTIME_ASSEMBLY_NAME).csproj
endif

File diff suppressed because it is too large Load Diff

View File

@@ -294,11 +294,6 @@ $(JAVA_ORTOOLS_NATIVE_LIBS): \
############
## JAVA ##
############
$(LIB_DIR)/protobuf.jar: \
dependencies/install/lib/protobuf.jar \
| $(LIB_DIR)
$(COPY) dependencies$Sinstall$Slib$Sprotobuf.jar $(LIB_DIR)
$(GEN_DIR)/java/com/google/ortools/constraintsolver/SearchLimitProtobuf.java: \
$(SRC_DIR)/ortools/constraint_solver/search_limit.proto \
| $(GEN_DIR)/java/com/google/ortools/constraintsolver
@@ -452,7 +447,7 @@ $(TEMP_JAVA_DIR)/$(JAVA_ORTOOLS_NATIVE_PROJECT)/timestamp: \
$(MKDIR_P) $(JAVA_NATIVE_PATH)$Sresources$S$(JAVA_ORTOOLS_NATIVE_PROJECT)
$(COPY) $(subst /,$S,$(JAVA_ORTOOLS_NATIVE_LIBS)) $(JAVA_NATIVE_PATH)$Sresources$S$(JAVA_ORTOOLS_NATIVE_PROJECT)
ifeq ($(SYSTEM),unix)
$(COPY) $(OR_TOOLS_LIBS) $(JAVA_NATIVE_PATH)$Sresources$S$(JAVA_ORTOOLS_NATIVE_PROJECT)
$(COPY) $(OR_TOOLS_LIBS).$(OR_TOOLS_MAJOR) $(JAVA_NATIVE_PATH)$Sresources$S$(JAVA_ORTOOLS_NATIVE_PROJECT)
endif
cd $(TEMP_JAVA_DIR)$S$(JAVA_ORTOOLS_NATIVE_PROJECT) && "$(MVN_BIN)" compile -B
cd $(TEMP_JAVA_DIR)$S$(JAVA_ORTOOLS_NATIVE_PROJECT) && "$(MVN_BIN)" package -B

View File

@@ -10,7 +10,7 @@ else
@echo
endif
OR_TOOLS_PYTHONPATH = $(OR_ROOT_FULL)$(CPSEP)$(OR_ROOT_FULL)$Sdependencies$Ssources$Sprotobuf-$(PROTOBUF_TAG)$Spython
OR_TOOLS_PYTHONPATH = $(OR_ROOT_FULL)$(CPSEP)$(OR_ROOT_FULL)$Sdependencies$S_deps$Sprotobuf-src$Spython
# Check for required build tools
ifeq ($(SYSTEM),win)
@@ -84,25 +84,21 @@ package_python: python
publish_python: python
endif
PROTOBUF_PYTHON_DESC = dependencies/sources/protobuf-$(PROTOBUF_TAG)/python/google/protobuf/descriptor_pb2.py
PROTOBUF_PYTHON_DESC = dependencies/_deps/protobuf-src/python/google/protobuf/descriptor_pb2.py
$(PROTOBUF_PYTHON_DESC): \
dependencies/sources/protobuf-$(PROTOBUF_TAG)/python/setup.py
dependencies/_deps/protobuf-src/python/setup.py
ifeq ($(SYSTEM),win)
copy dependencies$Sinstall$Sbin$Sprotoc.exe dependencies$Ssources$Sprotobuf-$(PROTOBUF_TAG)$Ssrc
cd dependencies$Ssources$Sprotobuf-$(PROTOBUF_TAG)$Spython && \
copy $(PROTOC) dependencies$S_deps$Sprotobuf-src$Ssrc
cd dependencies$S_deps$Sprotobuf-src$Spython && \
"$(PYTHON_EXECUTABLE)" setup.py build
endif
ifeq ($(PLATFORM),LINUX)
cd dependencies$Ssources$Sprotobuf-$(PROTOBUF_TAG)$Spython && \
LD_LIBRARY_PATH="$(UNIX_PROTOBUF_DIR)/lib64":"$(UNIX_PROTOBUF_DIR)/lib":$(LD_LIBRARY_PATH) \
PROTOC=$(PROTOC_BINARY) \
"$(PYTHON_EXECUTABLE)" setup.py build
cd dependencies$S_deps$Sprotobuf-src$Spython && \
PATH=$(OR_TOOLS_TOP)/bin "$(PYTHON_EXECUTABLE)" setup.py build
endif
ifeq ($(PLATFORM),MACOSX)
cd dependencies$Ssources$Sprotobuf-$(PROTOBUF_TAG)$Spython && \
DYLD_LIBRARY_PATH="$(UNIX_PROTOBUF_DIR)/lib":$(DYLD_LIBRARY_PATH) \
PROTOC=$(PROTOC_BINARY) \
"$(PYTHON_EXECUTABLE)" setup.py build
cd dependencies$S_deps$Sprotobuf-src$Spython && \
PATH=$(OR_TOOLS_TOP)/bin "$(PYTHON_EXECUTABLE)" setup.py build
endif
$(GEN_DIR)/ortools/__init__.py: | $(GEN_DIR)/ortools
@@ -144,8 +140,6 @@ $(PYINIT_LIBS): $(OBJ_DIR)/swig/init_python_wrap.$O $(OR_TOOLS_LIBS)
$(PYINIT_LDFLAGS) \
$(LD_OUT)$(LIB_DIR)$S_pywrapinit.$(SWIG_PYTHON_LIB_SUFFIX) \
$(OBJ_DIR)$Sswig$Sinit_python_wrap.$O \
$(OR_TOOLS_LNK) \
$(SYS_LNK) \
$(PYTHON_LNK) \
$(PYTHON_LDFLAGS)
ifeq ($(SYSTEM),win)
@@ -252,28 +246,28 @@ $(GEN_DIR)/ortools/constraint_solver/search_limit_pb2.py: \
$(SRC_DIR)/ortools/constraint_solver/search_limit.proto \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/constraint_solver
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)$Sortools$Sconstraint_solver$Ssearch_limit.proto
$(GEN_DIR)/ortools/constraint_solver/assignment_pb2.py: \
$(SRC_DIR)/ortools/constraint_solver/assignment.proto \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/constraint_solver
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)$Sortools$Sconstraint_solver$Sassignment.proto
$(GEN_DIR)/ortools/constraint_solver/solver_parameters_pb2.py: \
$(SRC_DIR)/ortools/constraint_solver/solver_parameters.proto \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/constraint_solver
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)$Sortools$Sconstraint_solver$Ssolver_parameters.proto
$(GEN_DIR)/ortools/constraint_solver/routing_enums_pb2.py: \
$(SRC_DIR)/ortools/constraint_solver/routing_enums.proto \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/constraint_solver
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)$Sortools$Sconstraint_solver$Srouting_enums.proto
$(GEN_DIR)/ortools/constraint_solver/routing_parameters_pb2.py: \
@@ -282,7 +276,7 @@ $(GEN_DIR)/ortools/constraint_solver/routing_parameters_pb2.py: \
$(GEN_DIR)/ortools/constraint_solver/routing_enums_pb2.py \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/constraint_solver
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)$Sortools$Sconstraint_solver$Srouting_parameters.proto
$(GEN_DIR)/ortools/constraint_solver/pywrapcp.py: \
@@ -342,7 +336,7 @@ $(GEN_DIR)/ortools/util/optional_boolean_pb2.py: \
$(SRC_DIR)/ortools/util/optional_boolean.proto \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/util
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)/ortools/util/optional_boolean.proto
$(GEN_DIR)/ortools/linear_solver/linear_solver_pb2.py: \
@@ -350,15 +344,15 @@ $(GEN_DIR)/ortools/linear_solver/linear_solver_pb2.py: \
$(GEN_DIR)/ortools/util/optional_boolean_pb2.py \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/linear_solver
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)/ortools/linear_solver/linear_solver.proto
$(GEN_DIR)/ortools/linear_solver/pywraplp.py: \
$(SRC_DIR)/ortools/base/base.i \
$(SRC_DIR)/ortools/util/python/vector.i \
$(SRC_DIR)/ortools/linear_solver/python/linear_solver.i \
$(SRC_DIR)/ortools/linear_solver/linear_solver.h \
$(GEN_DIR)/ortools/linear_solver/linear_solver.pb.h \
$(INC_DIR)/ortools/linear_solver/linear_solver.h \
$(INC_DIR)/ortools/linear_solver/linear_solver.pb.h \
$(GEN_DIR)/ortools/linear_solver/linear_solver_pb2.py \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/linear_solver
@@ -402,14 +396,14 @@ $(GEN_DIR)/ortools/sat/cp_model_pb2.py: \
$(SRC_DIR)/ortools/sat/cp_model.proto \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/sat
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)/ortools/sat/cp_model.proto
$(GEN_DIR)/ortools/sat/sat_parameters_pb2.py: \
$(SRC_DIR)/ortools/sat/sat_parameters.proto \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/sat
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)/ortools/sat/sat_parameters.proto
$(GEN_DIR)/ortools/sat/pywrapsat.py: \
@@ -457,7 +451,7 @@ $(GEN_DIR)/ortools/packing/vector_bin_packing_pb2.py: \
$(SRC_DIR)/ortools/packing/vector_bin_packing.proto \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/packing
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)/ortools/packing/vector_bin_packing.proto
# pywraprcpsp
@@ -469,7 +463,7 @@ $(GEN_DIR)/ortools/scheduling/rcpsp_pb2.py: \
$(SRC_DIR)/ortools/scheduling/rcpsp.proto \
$(PROTOBUF_PYTHON_DESC) \
| $(GEN_DIR)/ortools/scheduling
$(PROTOC) --proto_path=$(INC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(PROTOC) --proto_path=$(SRC_DIR) --python_out=$(GEN_PATH) $(MYPY_OUT) \
$(SRC_DIR)/ortools/scheduling/rcpsp.proto
$(GEN_DIR)/ortools/scheduling/pywraprcpsp.py: \

View File

@@ -5,145 +5,24 @@ help_third_party:
@echo
# Checks if the user has overwritten default libraries and binaries.
UNIX_PROTOBUF_DIR ?= $(OR_TOOLS_TOP)/dependencies/install
UNIX_PROTOC_BINARY ?= $(UNIX_PROTOBUF_DIR)/bin/protoc
UNIX_ABSL_DIR ?= $(OR_TOOLS_TOP)/dependencies/install
USE_COINOR ?= ON
UNIX_CBC_DIR ?= $(OR_TOOLS_TOP)/dependencies/install
UNIX_CGL_DIR ?= $(UNIX_CBC_DIR)
UNIX_CLP_DIR ?= $(UNIX_CBC_DIR)
UNIX_OSI_DIR ?= $(UNIX_CBC_DIR)
UNIX_COINUTILS_DIR ?= $(UNIX_CBC_DIR)
USE_SCIP ?= ON
UNIX_SCIP_DIR ?= $(OR_TOOLS_TOP)/dependencies/install
USE_GLPK ?= OFF
PROTOC ?= $(OR_TOOLS_TOP)/bin/protoc
# Swig is only needed when building .Net, Java or Python wrapper
UNIX_SWIG_BINARY ?= swig
PROTOC_BINARY := $(shell $(WHICH) ${UNIX_PROTOC_BINARY})
SWIG_BINARY = $(shell $(WHICH) $(UNIX_SWIG_BINARY))
SWIG_DOXYGEN = -doxygen
# Tags of dependencies to checkout.
PROTOBUF_TAG = v3.19.4
ABSL_TAG = 20211102.0
CBC_TAG = 2.10.7
CGL_TAG = 0.60.5
CLP_TAG = 1.17.7
OSI_TAG = 0.108.7
COINUTILS_TAG = 2.11.6
PATCHELF_TAG = 0.10
SCIP_TAG = v800
# Main target.
.PHONY: third_party # Build OR-Tools Prerequisite
third_party: build_third_party
.PHONY: third_party_check # Check if third parties are all found
third_party_check: dependencies/check.log
dependencies/check.log: Makefile.local
ifeq ($(wildcard $(UNIX_PROTOBUF_DIR)/include/google/protobuf/descriptor.h),)
$(error Third party Protobuf files was not found! did you run 'make third_party' or set UNIX_PROTOBUF_DIR ?)
else
$(info PROTOBUF: found)
endif
ifeq ($(wildcard $(PROTOC_BINARY)),)
$(error Cannot find $(UNIX_PROTOC_BINARY). Please verify UNIX_PROTOC_BINARY)
else
$(info PROTOC: found)
endif
ifeq ($(wildcard $(UNIX_ABSL_DIR)/include/absl/base/config.h),)
$(error Third party Abseil-cpp files was not found! did you run 'make third_party' or set UNIX_ABSL_DIR ?)
else
$(info ABSEIL-CPP: found)
endif
ifeq ($(USE_SCIP),OFF)
$(info SCIP: disabled)
else
ifeq ($(wildcard $(UNIX_SCIP_DIR)/include/scip/scip.h),)
$(error Third party SCIP files was not found! did you run 'make third_party' or set UNIX_SCIP_DIR ?)
else
$(info SCIP: found)
endif
endif # USE_SCIP
ifeq ($(USE_COINOR),OFF)
$(info Coin OR (CLP, CBC): disabled)
else
ifeq ($(wildcard $(UNIX_COINUTILS_DIR)/include/coinutils/coin/CoinModel.hpp $(UNIX_COINUTILS_DIR)/include/coin/CoinModel.hpp),)
$(error Third party CoinUtils files was not found! did you run 'make third_party' or set UNIX_COINUTILS_DIR ?)
else
$(info COINUTILS: found)
endif
ifeq ($(wildcard $(UNIX_OSI_DIR)/include/osi/coin/OsiSolverInterface.hpp $(UNIX_OSI_DIR)/include/coin/OsiSolverInterface.hpp),)
$(error Third party Osi files was not found! did you run 'make third_party' or set UNIX_OSI_DIR ?)
else
$(info OSI: found)
endif
ifeq ($(wildcard $(UNIX_CLP_DIR)/include/clp/coin/ClpModel.hpp $(UNIX_CLP_DIR)/include/coin/ClpSimplex.hpp),)
$(error Third party Clp files was not found! did you run 'make third_party' or set UNIX_CLP_DIR ?)
else
$(info CLP: found)
endif
ifeq ($(wildcard $(UNIX_CGL_DIR)/include/cgl/coin/CglParam.hpp $(UNIX_CGL_DIR)/include/coin/CglParam.hpp),)
$(error Third party Cgl files was not found! did you run 'make third_party' or set UNIX_CGL_DIR ?)
else
$(info CGL: found)
endif
ifeq ($(wildcard $(UNIX_CBC_DIR)/include/cbc/coin/CbcModel.hpp $(UNIX_CBC_DIR)/include/coin/CbcModel.hpp),)
$(error Third party Cbc files was not found! did you run 'make third_party' or set UNIX_CBC_DIR ?)
else
$(info CBC: found)
endif
endif # USE_COINOR
# Optional dependencies
ifndef UNIX_CPLEX_DIR
$(info CPLEX: not found)
else
$(info CPLEX: found)
endif
ifndef UNIX_GLPK_DIR
$(info GLPK: not found)
else
$(info GLP: found)
endif
ifndef UNIX_XPRESS_DIR
$(info XPRESS: not found)
else
$(info XPRESS: found)
endif
$(TOUCH) $@
.PHONY: build_third_party
build_third_party: \
Makefile.local \
install_deps_directories \
install_protobuf \
install_absl \
install_cbc \
install_scip
.PHONY: install_deps_directories
install_deps_directories: \
dependencies/install/bin \
dependencies/install/lib/pkgconfig \
dependencies/install/include/coin
dependencies/sources:
$(MKDIR_P) dependencies$Ssources
dependencies/install:
$(MKDIR_P) dependencies$Sinstall
dependencies/install/bin: | dependencies/install
$(MKDIR_P) dependencies$Sinstall$Sbin
dependencies/install/lib: | dependencies/install
$(MKDIR_P) dependencies$Sinstall$Slib
dependencies/install/lib/pkgconfig: | dependencies/install/lib
$(MKDIR_P) dependencies$Sinstall$Slib$Spkgconfig
dependencies/install/include: | dependencies/install
$(MKDIR_P) dependencies$Sinstall$Sinclude
dependencies/install/include/coin: | dependencies/install/include
$(MKDIR_P) dependencies$Sinstall$Sinclude$Scoin
Makefile.local \
cmake_third_party
######################
## Makefile.local ##
@@ -161,6 +40,10 @@ Makefile.local: makefiles/Makefile.third_party.$(SYSTEM).mk
@echo "# Define UNIX_CPLEX_DIR to use CPLEX" >> Makefile.local
@echo "# e.g. UNIX_CPLEX_DIR = /opt/CPLEX_Studio-X.Y" >> Makefile.local
@echo >> Makefile.local
@echo "# Define UNIX_XPRESS_DIR to use XPRESS MP" >> Makefile.local
@echo "# e.g. on Mac OS X: UNIX_XPRESS_DIR = /Applications/FICO\ Xpress/xpressmp" >> Makefile.local
@echo "# e.g. on linux: UNIX_XPRESS_DIR = /opt/xpressmp" >> Makefile.local
@echo >> Makefile.local
@echo "# SCIP is enabled and built-in by default. To disable SCIP support" >> Makefile.local
@echo "# completely, uncomment the following line:">> Makefile.local
@echo "# USE_SCIP = OFF" >> Makefile.local
@@ -168,568 +51,30 @@ Makefile.local: makefiles/Makefile.third_party.$(SYSTEM).mk
@echo "# Define UNIX_GLPK_DIR to point to a compiled version of GLPK to use it" >> Makefile.local
@echo "# e.g. UNIX_GLPK_DIR = /opt/glpk-x.y.z" >> Makefile.local
@echo >> Makefile.local
@echo "# Define UNIX_XPRESS_DIR to use XPRESS MP" >> Makefile.local
@echo "# e.g. on Mac OS X: UNIX_XPRESS_DIR = /Applications/FICO\ Xpress/xpressmp" >> Makefile.local
@echo "# e.g. on linux: UNIX_XPRESS_DIR = /opt/xpressmp" >> Makefile.local
@echo >> Makefile.local
@echo "# Coin OR solvers (CLP, CBC) are enabled and built-in by default." >> Makefile.local
@echo "# To disable Coin OR support completely, uncomment the following line:">> Makefile.local
@echo "# USE_COINOR = OFF" >> Makefile.local
@echo >> Makefile.local
@echo "# If Coin OR solvers are enabled, by default 'make third_party' will download" >> Makefile.local
@echo "# the source code and compile it locally." >> Makefile.local
@echo "# To override this behavior, please define the below directories." >> Makefile.local
@echo "# Define UNIX_CBC_DIR to depend on external CBC dynamic library" >> Makefile.local
@echo "# e.g. UNIX_CBC_DIR = /opt/cbc-x.y.z" >> Makefile.local
@echo "# If you use a splitted version of CBC you can also define:" >> Makefile.local
@echo "# UNIX_CLP_DIR, UNIX_CGL_DIR, UNIX_OSI_DIR, UNIX_COINUTILS_DIR" >> Makefile.local
@echo "# note: by default they all point to UNIX_CBC_DIR" >> Makefile.local
@echo >> Makefile.local
@echo "## REQUIRED DEPENDENCIES ##" >> Makefile.local
@echo "# By default they will be automatically built -> nothing to define" >> Makefile.local
@echo "# Define UNIX_PROTOBUF_DIR to depend on external Protobuf dynamic library" >> Makefile.local
@echo "# e.g. UNIX_PROTOBUF_DIR = /opt/protobuf-x.y.z" >> Makefile.local
@echo "# Define UNIX_PROTOC_BINARY to use a custom version." >> Makefile.local
@echo "# e.g. UNIX_PROTOC_BINARY = /opt/protoc-x.y.z/bin/protoc" >> Makefile.local
@echo "# (default: UNIX_PROTOBUF_DIR/bin/protoc)" >> Makefile.local
@echo >> Makefile.local
@echo "# note: You don't need to run \"make third_party\" if you only use external dependencies" >> Makefile.local
@echo "# i.e. You have defined all UNIX_PROTOBUF_DIR and UNIX_CBC_DIR" >> Makefile.local
################
## Protobuf ##
################
# This uses Protobuf cmake-based build.
.PHONY: install_protobuf
install_protobuf: dependencies/install/lib/libprotobuf.a
PROTOBUF_SRCDIR = dependencies/sources/protobuf-$(PROTOBUF_TAG)
dependencies/install/lib/libprotobuf.a: $(PROTOBUF_SRCDIR) | dependencies/install
cd $(PROTOBUF_SRCDIR) && \
$(SET_COMPILER) $(CMAKE) -Hcmake -Bbuild_cmake \
-DCMAKE_PREFIX_PATH="$(OR_TOOLS_TOP)/dependencies/install" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \
-Dprotobuf_BUILD_TESTS=OFF \
-Dprotobuf_BUILD_EXAMPLES=OFF \
-DCMAKE_OSX_DEPLOYMENT_TARGET="$(MAC_MIN_VERSION)" \
-DCMAKE_INSTALL_PREFIX=../../install && \
$(CMAKE) --build build_cmake --config Release -v -- -j4 && \
$(CMAKE) --build build_cmake --config Release --target install
$(PROTOBUF_SRCDIR): patches/protobuf-$(PROTOBUF_TAG).patch | dependencies/sources
-$(DELREC) $(PROTOBUF_SRCDIR)
git clone --quiet -b $(PROTOBUF_TAG) https://github.com/google/protobuf.git $(PROTOBUF_SRCDIR)
cd $(PROTOBUF_SRCDIR) && git apply "$(OR_TOOLS_TOP)/patches/protobuf-$(PROTOBUF_TAG).patch"
# This is needed to find protocol buffers.
PROTOBUF_INC = -I$(UNIX_PROTOBUF_DIR)/include
PROTOBUF_SWIG = $(PROTOBUF_INC)
PROTOBUF_PROTOC_INC = $(PROTOBUF_INC)
# libprotobuf.a goes in a different subdirectory depending on the distribution
# and architecture, eg. "lib/" or "lib64/" for Fedora and Centos,
# "lib/x86_64-linux-gnu/" for Ubuntu (all on 64 bits), etc. So we wildcard it.
STATIC_PROTOBUF_LNK = $(wildcard \
$(UNIX_PROTOBUF_DIR)/lib*/libprotobuf.a \
$(UNIX_PROTOBUF_DIR)/lib*/libprotobuf.a@ \
$(UNIX_PROTOBUF_DIR)/lib/*/libprotobuf.a)
PROTOBUF_LNK = $(STATIC_PROTOBUF_LNK)
DEPENDENCIES_INC += $(PROTOBUF_INC)
SWIG_INC += $(PROTOBUF_SWIG)
DEPENDENCIES_LNK += $(PROTOBUF_LNK)
# Define Protoc
ifeq ($(PLATFORM),LINUX)
PROTOC = \
LD_LIBRARY_PATH="$(UNIX_PROTOBUF_DIR)/lib64":"$(UNIX_PROTOBUF_DIR)/lib":$(LD_LIBRARY_PATH) $(PROTOC_BINARY)
else
PROTOC = \
DYLD_LIBRARY_PATH="$(UNIX_PROTOBUF_DIR)/lib":$(DYLD_LIBRARY_PATH) $(PROTOC_BINARY)
endif
# Install Java protobuf
# - Compile generic message proto.
# - Compile duration.proto
dependencies/install/lib/protobuf.jar: | dependencies/install/lib/libprotobuf.a
cd dependencies/sources/protobuf-$(PROTOBUF_TAG)/java && \
$(PROTOC) --java_out=core/src/main/java -I../src \
../src/google/protobuf/descriptor.proto
cd dependencies/sources/protobuf-$(PROTOBUF_TAG)/java && \
$(PROTOC) --java_out=core/src/main/java -I../src \
../src/google/protobuf/duration.proto
cd dependencies/sources/protobuf-$(PROTOBUF_TAG)/java/core/src/main/java && \
"$(JAVAC_BIN)" com/google/protobuf/*java
cd dependencies/sources/protobuf-$(PROTOBUF_TAG)/java/core/src/main/java && \
"$(JAR_BIN)" cvf ../../../../../../../install/lib/protobuf.jar com/google/protobuf/*class
##################
## ABSEIL-CPP ##
##################
# This uses abseil-cpp cmake-based build.
install_absl: dependencies/install/lib/libabsl.a
dependencies/install/lib/libabsl.a: dependencies/sources/abseil-cpp-$(ABSL_TAG) | dependencies/install
cd dependencies/sources/abseil-cpp-$(ABSL_TAG) && \
$(SET_COMPILER) $(CMAKE) -H. -Bbuild_cmake \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DCMAKE_PREFIX_PATH="$(OR_TOOLS_TOP)/dependencies/install" \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_STATIC_LIBS=ON \
-DCMAKE_OSX_DEPLOYMENT_TARGET="$(MAC_MIN_VERSION)" \
-DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=../../install && \
$(CMAKE) --build build_cmake --config Release -v -- -j4 && \
$(CMAKE) --build build_cmake --config Release --target install
dependencies/sources/abseil-cpp-$(ABSL_TAG): | dependencies/sources
-$(DELREC) dependencies/sources/abseil-cpp-$(ABSL_TAG)
git clone --quiet https://github.com/abseil/abseil-cpp.git dependencies/sources/abseil-cpp-$(ABSL_TAG)
cd dependencies/sources/abseil-cpp-$(ABSL_TAG) && git reset --hard $(ABSL_TAG)
# cd dependencies/sources/abseil-cpp-$(ABSL_TAG) && git apply "$(OR_TOOLS_TOP)/patches/abseil-cpp-$(ABSL_TAG).patch"
ABSL_INC = -I$(UNIX_ABSL_DIR)/include
ABSL_SWIG = $(ABSL_INC)
_ABSL_STATIC_LIB_DIR = $(dir $(wildcard \
$(UNIX_ABSL_DIR)/lib*/libabsl_base.a \
$(UNIX_ABSL_DIR)/lib/*/libabsl_base.a))
STATIC_ABSL_LNK = \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_parse.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_usage.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_usage_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_marshalling.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_reflection.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_config.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_private_handle_accessor.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_commandlineflag.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_commandlineflag_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_flags_program_name.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_random_distributions.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_random_seed_sequences.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_random_internal_pool_urbg.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_random_internal_randen.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_random_internal_randen_hwaes.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_random_internal_randen_hwaes_impl.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_random_internal_randen_slow.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_random_internal_platform.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_random_internal_seed_material.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_random_seed_gen_exception.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_raw_hash_set.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_hashtablez_sampler.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_hash.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_city.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_low_level_hash.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_leak_check.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_statusor.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_status.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_cord.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_cordz_info.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_cord_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_cordz_functions.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_exponential_biased.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_cordz_handle.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_bad_optional_access.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_bad_variant_access.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_str_format_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_synchronization.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_stacktrace.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_symbolize.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_debugging_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_demangle_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_graphcycles_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_malloc_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_time.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_strings.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_strings_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_base.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_spinlock_wait.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_throw_delegate.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_int128.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_civil_time.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_time_zone.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_bad_any_cast_impl.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_raw_logging_internal.a \
$(_ABSL_STATIC_LIB_DIR)libabsl_log_severity.a
ABSL_LNK = $(STATIC_ABSL_LNK)
DEPENDENCIES_INC += $(ABSL_INC)
SWIG_INC += $(ABSL_SWIG)
DEPENDENCIES_LNK += $(ABSL_LNK)
###################
## COIN-OR-CBC ##
###################
.PHONY: install_cbc
ifeq ($(USE_COINOR),OFF)
install_cbc:
else
install_cbc: dependencies/install/lib/libCbc.a
CBC_SRCDIR = dependencies/sources/Cbc-$(CBC_TAG)
dependencies/install/lib/libCbc.a: install_cgl $(CBC_SRCDIR)
cd $(CBC_SRCDIR) && $(SET_COMPILER) $(SET_COIN_OPT) ./configure \
--prefix=$(OR_ROOT_FULL)/dependencies/install \
--enable-static --disable-shared \
--disable-debug \
--without-blas \
--without-lapack \
--without-glpk \
--with-pic \
--disable-dependency-tracking \
--enable-dependency-linking \
--enable-cbc-parallel \
ADD_CXXFLAGS="-w -DCBC_THREAD_SAFE -DCBC_NO_INTERRUPT $(MAC_VERSION) -std=c++11"
$(SET_COMPILER) $(SET_COIN_OPT) make -C $(CBC_SRCDIR)
$(SET_COMPILER) $(SET_COIN_OPT) make install -C $(CBC_SRCDIR)
$(CBC_SRCDIR): | dependencies/sources
-$(DELREC) $(CBC_SRCDIR)
git clone --quiet -b releases/$(CBC_TAG) https://github.com/coin-or/Cbc.git dependencies/sources/Cbc-$(CBC_TAG)
# This is needed to find CBC include files.
CBC_COIN_DIR = $(firstword $(wildcard $(UNIX_CBC_DIR)/include/cbc/coin \
$(UNIX_CBC_DIR)/include/coin))
CBC_INC = -I$(UNIX_CBC_DIR)/include -I$(CBC_COIN_DIR) -DUSE_CBC
CBC_SWIG = $(CBC_INC)
ifneq ($(wildcard $(UNIX_CBC_DIR)/lib/coin),)
UNIX_CBC_COIN = /coin
endif
STATIC_CBC_LNK = $(UNIX_CBC_DIR)/lib$(UNIX_CBC_COIN)/libCbcSolver.a \
$(UNIX_CBC_DIR)/lib$(UNIX_CBC_COIN)/libOsiCbc.a \
$(UNIX_CBC_DIR)/lib$(UNIX_CBC_COIN)/libCbc.a
CBC_LNK = $(STATIC_CBC_LNK)
###################
## COIN-OR-CGL ##
###################
.PHONY: install_cgl
install_cgl: dependencies/install/lib/libCgl.a
CGL_SRCDIR = dependencies/sources/Cgl-$(CGL_TAG)
dependencies/install/lib/libCgl.a: install_clp $(CGL_SRCDIR)
cd $(CGL_SRCDIR) && $(SET_COMPILER) $(SET_COIN_OPT) ./configure \
--prefix=$(OR_ROOT_FULL)/dependencies/install \
--enable-static --disable-shared \
--disable-debug \
--without-blas \
--without-lapack \
--without-glpk \
--with-pic \
--disable-dependency-tracking \
--enable-dependency-linking \
ADD_CXXFLAGS="-w $(MAC_VERSION) -std=c++11"
$(SET_COMPILER) $(SET_COIN_OPT) make -C $(CGL_SRCDIR)
$(SET_COMPILER) $(SET_COIN_OPT) make install -C $(CGL_SRCDIR)
$(CGL_SRCDIR): | dependencies/sources
-$(DELREC) $(CGL_SRCDIR)
git clone --quiet -b releases/$(CGL_TAG) https://github.com/coin-or/Cgl.git $(CGL_SRCDIR)
# This is needed to find CGL include files.
CGL_COIN_DIR = $(firstword $(wildcard $(UNIX_CGL_DIR)/include/cgl/coin \
$(UNIX_CGL_DIR)/include/coin))
CGL_INC = -I$(UNIX_CGL_DIR)/include -I$(CGL_COIN_DIR)
CGL_SWIG = $(CGL_INC)
ifneq ($(wildcard $(UNIX_CGL_DIR)/lib/coin),)
UNIX_CGL_COIN = /coin
endif
STATIC_CGL_LNK = $(UNIX_CGL_DIR)/lib$(UNIX_CGL_COIN)/libCgl.a
CGL_LNK = $(STATIC_CGL_LNK)
###################
## COIN-OR-CLP ##
###################
.PHONY: install_clp
install_clp: dependencies/install/lib/libClp.a
CLP_SRCDIR = dependencies/sources/Clp-$(CLP_TAG)
dependencies/install/lib/libClp.a: install_osi $(CLP_SRCDIR)
cd $(CLP_SRCDIR) && $(SET_COMPILER) $(SET_COIN_OPT) ./configure \
--prefix=$(OR_ROOT_FULL)/dependencies/install \
--enable-static --disable-shared \
--disable-debug \
--without-blas \
--without-lapack \
--without-glpk \
--with-pic \
--disable-dependency-tracking \
--enable-dependency-linking \
ADD_CXXFLAGS="-w $(MAC_VERSION) -std=c++11"
$(SET_COMPILER) $(SET_COIN_OPT) make -C $(CLP_SRCDIR)
$(SET_COMPILER) $(SET_COIN_OPT) make install -C $(CLP_SRCDIR)
$(CLP_SRCDIR): | dependencies/sources
-$(DELREC) $(CLP_SRCDIR)
git clone --quiet -b releases/$(CLP_TAG) https://github.com/coin-or/Clp.git $(CLP_SRCDIR)
# This is needed to find CLP include files.
CLP_COIN_DIR = $(firstword $(wildcard $(UNIX_CLP_DIR)/include/clp/coin \
$(UNIX_CLP_DIR)/include/coin))
CLP_INC = -I$(UNIX_CLP_DIR)/include -I$(CLP_COIN_DIR) -DUSE_CLP
CLP_SWIG = $(CLP_INC)
ifneq ($(wildcard $(UNIX_CLP_DIR)/lib/coin),)
UNIX_CLP_COIN = /coin
endif
STATIC_CLP_LNK = $(UNIX_CBC_DIR)/lib$(UNIX_CLP_COIN)/libClpSolver.a \
$(UNIX_CLP_DIR)/lib$(UNIX_CLP_COIN)/libOsiClp.a \
$(UNIX_CLP_DIR)/lib$(UNIX_CLP_COIN)/libClp.a
CLP_LNK = $(STATIC_CLP_LNK)
###################
## COIN-OR-OSI ##
###################
.PHONY: install_osi
install_osi: dependencies/install/lib/libOsi.a
OSI_SRCDIR = dependencies/sources/Osi-$(OSI_TAG)
dependencies/install/lib/libOsi.a: install_coinutils $(OSI_SRCDIR)
cd $(OSI_SRCDIR) && $(SET_COMPILER) $(SET_COIN_OPT) ./configure \
--prefix=$(OR_ROOT_FULL)/dependencies/install \
--enable-static --disable-shared \
--disable-debug \
--without-blas \
--without-lapack \
--without-glpk \
--with-pic \
--with-coinutils \
--disable-dependency-tracking \
--enable-dependency-linking \
ADD_CXXFLAGS="-w $(MAC_VERSION) -std=c++11"
$(SET_COMPILER) $(SET_COIN_OPT) make -C $(OSI_SRCDIR)
$(SET_COMPILER) $(SET_COIN_OPT) make install -C $(OSI_SRCDIR)
$(OSI_SRCDIR): | dependencies/sources
-$(DELREC) $(OSI_SRCDIR)
git clone --quiet -b releases/$(OSI_TAG) https://github.com/coin-or/Osi.git $(OSI_SRCDIR)
# This is needed to find OSI include files.
OSI_COIN_DIR = $(firstword $(wildcard $(UNIX_OSI_DIR)/include/osi/coin \
$(UNIX_OSI_DIR)/include/coin))
OSI_INC = -I$(UNIX_OSI_DIR)/include -I$(OSI_COIN_DIR)
OSI_SWIG = $(OSI_INC)
ifneq ($(wildcard $(UNIX_OSI_DIR)/lib/coin),)
UNIX_OSI_COIN = /coin
endif
STATIC_OSI_LNK = $(UNIX_OSI_DIR)/lib$(UNIX_OSI_COIN)/libOsi.a
OSI_LNK = $(STATIC_OSI_LNK)
#########################
## COIN-OR-COINUTILS ##
#########################
.PHONY: install_coinutils
install_coinutils: dependencies/install/lib/libCoinUtils.a
COINUTILS_SRCDIR = dependencies/sources/CoinUtils-$(COINUTILS_TAG)
dependencies/install/lib/libCoinUtils.a: $(COINUTILS_SRCDIR) | \
dependencies/install/lib/pkgconfig dependencies/install/include/coin
cd $(COINUTILS_SRCDIR) && $(SET_COMPILER) $(SET_COIN_OPT) ./configure \
--prefix=$(OR_ROOT_FULL)/dependencies/install \
--enable-static --disable-shared \
--disable-bzlib \
--disable-debug \
--without-blas \
--without-lapack \
--without-glpk \
--with-pic \
--disable-dependency-tracking \
--enable-dependency-linking \
ADD_CXXFLAGS="-w $(MAC_VERSION) -std=c++11"
$(SET_COMPILER) $(SET_COIN_OPT) make -C $(COINUTILS_SRCDIR)
$(SET_COMPILER) $(SET_COIN_OPT) make install -C $(COINUTILS_SRCDIR)
$(COINUTILS_SRCDIR): | dependencies/sources
-$(DELREC) $(COINUTILS_SRCDIR)
git clone --quiet -b releases/$(COINUTILS_TAG) https://github.com/coin-or/CoinUtils.git $(COINUTILS_SRCDIR)
# This is needed to find COINUTILS include files.
COINUTILS_COIN_DIR = $(firstword $(wildcard $(UNIX_COINUTILS_DIR)/include/coinutils/coin \
$(UNIX_COINUTILS_DIR)/include/coin))
COINUTILS_INC = -I$(UNIX_COINUTILS_DIR)/include -I$(COINUTILS_COIN_DIR)
COINUTILS_SWIG = $(COINUTILS_INC)
ifneq ($(wildcard $(UNIX_COINUTILS_DIR)/lib/coin),)
UNIX_COINUTILS_COIN = /coin
endif
STATIC_COINUTILS_LNK = $(UNIX_COINUTILS_DIR)/lib$(UNIX_COINUTILS_COIN)/libCoinUtils.a
COINUTILS_LNK = $(STATIC_COINUTILS_LNK)
############
## COIN ##
############
# Agregate all previous coin packages
COIN_INC = \
$(COINUTILS_INC) \
$(OSI_INC) \
$(CLP_INC) \
$(CGL_INC) \
$(CBC_INC)
COIN_SWIG = \
$(COINUTILS_SWIG) \
$(OSI_SWIG) \
$(CLP_SWIG) \
$(CGL_SWIG) \
$(CBC_SWIG)
COIN_LNK = \
$(CBC_LNK) \
$(CGL_LNK) \
$(CLP_LNK) \
$(OSI_LNK) \
$(COINUTILS_LNK)
DEPENDENCIES_INC += $(COIN_INC)
SWIG_INC += $(COIN_SWIG)
DEPENDENCIES_LNK += $(COIN_LNK)
endif # USE_COINOR
#########################
## SCIP ##
#########################
.PHONY: install_scip
ifeq ($(USE_SCIP),OFF)
install_scip: $(GEN_DIR)/ortools/linear_solver/lpi_glop.cc
$(GEN_DIR)/ortools/linear_solver/lpi_glop.cc: | $(GEN_DIR)/ortools/linear_solver
touch $(GEN_DIR)/ortools/linear_solver/lpi_glop.cc
else
install_scip: dependencies/install/lib/libscip.a $(GEN_DIR)/ortools/linear_solver/lpi_glop.cc
SCIP_SRCDIR = dependencies/sources/scip-$(SCIP_TAG)
dependencies/install/lib/libscip.a: $(SCIP_SRCDIR) | dependencies/install
cd $(SCIP_SRCDIR) && \
$(SET_COMPILER) $(CMAKE) -H. -Bbuild_cmake \
-DCMAKE_PREFIX_PATH="$(OR_TOOLS_TOP)/dependencies/install" \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_CXX_EXTENSIONS=OFF \
-DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DBUILD_SHARED_LIBS=OFF \
-DSHARED=OFF \
-DBUILD_STATIC_LIBS=ON \
-DBUILD_TESTING=OFF \
-DCMAKE_OSX_DEPLOYMENT_TARGET="$(MAC_MIN_VERSION)" \
-DREADLINE=OFF \
-DGMP=OFF \
-DPAPILO=OFF \
-DZIMPL=OFF \
-DIPOPT=OFF \
-DAMPL=OFF \
-DTPI="tny" \
-DEXPRINT="none" \
-DLPS="none" \
-DSYM="none" \
-DCMAKE_INSTALL_PREFIX=../../install && \
$(CMAKE) --build build_cmake --config Release -v -- -j4 && \
$(CMAKE) --build build_cmake --config Release --target install
$(SCIP_SRCDIR): | dependencies/sources
-$(DELREC) $(SCIP_SRCDIR)
git clone --quiet -b $(SCIP_TAG) https://github.com/scipopt/scip.git $(SCIP_SRCDIR)
# cd $(SCIP_SRCDIR) && git apply --ignore-whitespace "$(OR_TOOLS_TOP)/patches/scip-$(SCIP_TAG).patch"
$(GEN_DIR)/ortools/linear_solver/lpi_glop.cc: $(SCIP_SRCDIR) | $(GEN_DIR)/ortools/linear_solver
$(COPY) $(SCIP_SRCDIR)/src/lpi/lpi_glop.cpp $(GEN_DIR)/ortools/linear_solver/lpi_glop.cc
SCIP_INC = -I$(UNIX_SCIP_DIR)/include -DUSE_SCIP -DNO_CONFIG_HEADER
SCIP_SWIG = $(SCIP_INC)
SCIP_LNK = $(UNIX_SCIP_DIR)/lib/libscip.a
DEPENDENCIES_INC += $(SCIP_INC)
SWIG_INC += $(SCIP_SWIG)
DEPENDENCIES_LNK += $(SCIP_LNK)
endif
############
## SWIG ##
############
# Swig is only needed when building .Net, Java or Python wrapper
SWIG_BINARY = $(shell $(WHICH) $(UNIX_SWIG_BINARY))
#$(error "Can't find $(UNIX_SWIG_BINARY). Please verify UNIX_SWIG_BINARY")
SWIG_VERSION = $(shell $(SWIG_BINARY) -version | grep Version | cut -d " " -f 3)
ifeq ("$(SWIG_VERSION)","4.0.0")
SWIG_DOXYGEN = -doxygen
endif
ifeq ("$(SWIG_VERSION)","4.0.1")
SWIG_DOXYGEN = -doxygen
endif
ifeq ("$(SWIG_VERSION)","4.0.2")
SWIG_DOXYGEN = -doxygen
endif
test_doxy:
ifneq ("$(PYTHON_EXECUTABLE)","")
echo "Pass 1"
ifeq ($(shell "$(PYTHON_EXECUTABLE)" -c "from sys import version_info as v; print (str(v[0]))"),3)
echo "SWIG_PY_DOXYGEN = -doxygen"
endif
endif
echo \'$(shell "$(PYTHON_EXECUTABLE)" -c "from sys import version_info as v; print (str(v[0]))")\'
cmake_third_party: | dependencies
cmake -S . -B dependencies/ -DBUILD_DEPS=ON -DBUILD_EXAMPLES=ON -DBUILD_SAMPLES=ON -DUSE_COINOR=$(USE_COINOR) -DUSE_SCIP=$(USE_SCIP) -DUSE_GLPK=$(USE_GLPK) -DCMAKE_INSTALL_PREFIX=$(OR_ROOT_FULL)
.PHONY: clean_third_party # Clean everything. Remember to also delete archived dependencies, i.e. in the event of download failure, etc.
clean_third_party:
-$(DEL) Makefile.local
-$(DEL) dependencies/check.log
-$(DELREC) dependencies/sources/protobuf*
-$(DELREC) dependencies/sources/abseil-cpp*
-$(DELREC) dependencies/sources/google*
-$(DELREC) dependencies/sources/Cbc*
-$(DELREC) dependencies/sources/Cgl*
-$(DELREC) dependencies/sources/Clp*
-$(DELREC) dependencies/sources/Osi*
-$(DELREC) dependencies/sources/CoinUtils*
-$(DELREC) dependencies/sources/scip*
-$(DELREC) dependencies/sources/swig*
-$(DELREC) dependencies/sources/mono*
-$(DELREC) dependencies/sources/glpk*
-$(DELREC) dependencies/sources/pcre*
-$(DELREC) dependencies/sources/sparsehash*
-$(DELREC) dependencies/sources/libtool*
-$(DELREC) dependencies/sources/autoconf*
-$(DELREC) dependencies/sources/automake*
-$(DELREC) dependencies/sources/bison*
-$(DELREC) dependencies/sources/flex*
-$(DELREC) dependencies/sources/help2man*
-$(DELREC) dependencies/sources/patchelf*
-$(DELREC) dependencies/install
-$(DELREC) dependencies/*
-$(DELREC) include
-$(DELREC) share
-$(DELREC) lib/*.a
-$(DELREC) lib/cmake
-$(DELREC) lib/pkgconfig
.PHONY: detect_third_party # Show variables used to find third party
detect_third_party:
@echo Relevant info on third party:
@echo UNIX_PROTOBUF_DIR = $(UNIX_PROTOBUF_DIR)
@echo PROTOBUF_INC = $(PROTOBUF_INC)
@echo PROTOBUF_LNK = $(PROTOBUF_LNK)
@echo UNIX_CBC_DIR = $(UNIX_CBC_DIR)
@echo CBC_INC = $(CBC_INC)
@echo CBC_LNK = $(CBC_LNK)
@echo UNIX_CLP_DIR = $(UNIX_CLP_DIR)
@echo CLP_INC = $(CLP_INC)
@echo CLP_LNK = $(CLP_LNK)
@echo UNIX_CGL_DIR = $(UNIX_CGL_DIR)
@echo CGL_INC = $(CGL_INC)
@echo CGL_LNK = $(CGL_LNK)
@echo UNIX_OSI_DIR = $(UNIX_OSI_DIR)
@echo OSI_INC = $(OSI_INC)
@echo OSI_LNK = $(OSI_LNK)
@echo UNIX_COINUTILS_DIR = $(UNIX_COINUTILS_DIR)
@echo COINUTILS_INC = $(COINUTILS_INC)
@echo COINUTILS_LNK = $(COINUTILS_LNK)
@echo UNIX_SCIP_DIR = $(UNIX_SCIP_DIR)
@echo SCIP_INC = $(SCIP_INC)
@echo SCIP_LNK = $(SCIP_LNK)
@echo USE_COINOR = $(USE_COINOR)
@echo USE_SCIP = $(USE_SCIP)
ifdef UNIX_GLPK_DIR
@echo UNIX_GLPK_DIR = $(UNIX_GLPK_DIR)
@echo GLPK_INC = $(GLPK_INC)

View File

@@ -5,164 +5,17 @@ help_third_party:
@echo off & echo(
# Checks if the user has overwritten default libraries and binaries.
WINDOWS_ZLIB_DIR ?= $(OR_ROOT)dependencies/install
WINDOWS_ZLIB_PATH = $(subst /,$S,$(WINDOWS_ZLIB_DIR))
WINDOWS_ZLIB_NAME ?= zlib.lib
WINDOWS_PROTOBUF_DIR ?= $(OR_ROOT)dependencies/install
WINDOWS_PROTOBUF_PATH = $(subst /,$S,$(WINDOWS_PROTOBUF_DIR))
WINDOWS_ABSL_DIR ?= $(OR_ROOT)dependencies/install
WINDOWS_ABSL_PATH = $(subst /,$S,$(WINDOWS_ABSL_DIR))
USE_COINOR ?= ON
WINDOWS_CBC_DIR ?= $(OR_ROOT)dependencies/install
WINDOWS_CBC_PATH = $(subst /,$S,$(WINDOWS_CBC_DIR))
WINDOWS_CGL_DIR ?= $(WINDOWS_CBC_DIR)
WINDOWS_CGL_PATH = $(subst /,$S,$(WINDOWS_CGL_DIR))
WINDOWS_CLP_DIR ?= $(WINDOWS_CBC_DIR)
WINDOWS_CLP_PATH = $(subst /,$S,$(WINDOWS_CLP_DIR))
WINDOWS_OSI_DIR ?= $(WINDOWS_CBC_DIR)
WINDOWS_OSI_PATH = $(subst /,$S,$(WINDOWS_OSI_DIR))
WINDOWS_COINUTILS_DIR ?= $(WINDOWS_CBC_DIR)
WINDOWS_COINUTILS_PATH = $(subst /,$S,$(WINDOWS_COINUTILS_DIR))
USE_SCIP ?= ON
WINDOWS_SCIP_DIR ?= $(OR_ROOT)dependencies/install
WINDOWS_SCIP_PATH = $(subst /,$S,$(WINDOWS_SCIP_DIR))
WINDOWS_SWIG_BINARY ?= "$(OR_ROOT)dependencies\\install\\swigwin-$(SWIG_TAG)\\swig.exe"
# Variable use in others Makefiles
PROTOC = "$(WINDOWS_PROTOBUF_DIR)\\bin\\protoc.exe"
SWIG_BINARY = $(WINDOWS_SWIG_BINARY)
# tags of dependencies to checkout.
ZLIB_TAG = 1.2.11
ZLIB_ARCHIVE_TAG = 1211
PROTOBUF_TAG = v3.19.4
ABSL_TAG = 20211102.0
CBC_TAG = 2.10.7
CGL_TAG = 0.60.5
CLP_TAG = 1.17.7
OSI_TAG = 0.108.7
COINUTILS_TAG = 2.11.6
SWIG_TAG = 4.0.2
SCIP_TAG = v800
# Added in support of clean third party targets
TSVNCACHE_EXE = TSVNCache.exe
PROTOC = "$(OR_TOOLS_TOP)\\bin\\protoc.exe"
SWIG_BINARY = "$(OR_TOOLS_TOP)\\bin\\swig.exe"
# Main target.
.PHONY: third_party # Build OR-Tools Prerequisite
third_party: build_third_party
third_party: \
Makefile.local \
cmake_third_party
.PHONY: third_party_check # Check if third parties are all found
third_party_check: dependencies/check.log
dependencies/check.log: Makefile.local
ifeq ($(wildcard $(WINDOWS_ZLIB_DIR)/include/zlib.h),)
$(error Third party ZLIB files was not found! did you run 'make third_party' or set WINDOWS_ZLIB_DIR ?)
else
@echo ZLIB: found
endif
ifeq ($(wildcard $(WINDOWS_PROTOBUF_DIR)/include/google/protobuf/descriptor.h),)
$(error Third party Protobuf files was not found! did you run 'make third_party' or set WINDOWS_PROTOBUF_DIR ?)
else
@echo PROTOBUF: found
endif
ifeq ($(wildcard $(WINDOWS_COINUTILS_DIR)/include/coinutils/coin/CoinModel.hpp $(WINDOWS_COINUTILS_DIR)/include/coin/CoinModel.hpp),)
$(error Third party CoinUtils files was not found! did you run 'make third_party' or set WINDOWS_COINUTILS_DIR ?)
else
@echo COINUTILS: found
endif
ifeq ($(wildcard $(WINDOWS_OSI_DIR)/include/osi/coin/OsiSolverInterface.hpp $(WINDOWS_OSI_DIR)/include/coin/OsiSolverInterface.hpp),)
$(error Third party Osi files was not found! did you run 'make third_party' or set WINDOWS_OSI_DIR ?)
else
@echo OSI: found
endif
ifeq ($(wildcard $(WINDOWS_CLP_DIR)/include/clp/coin/ClpModel.hpp $(WINDOWS_CLP_DIR)/include/coin/ClpModel.hpp),)
$(error Third party Clp files was not found! did you run 'make third_party' or set WINDOWS_CLP_DIR ?)
else
@echo CLP: found
endif
ifeq ($(wildcard $(WINDOWS_CGL_DIR)/include/cgl/coin/CglParam.hpp $(WINDOWS_CGL_DIR)/include/coin/CglParam.hpp),)
$(error Third party Cgl files was not found! did you run 'make third_party' or set WINDOWS_CGL_DIR ?)
else
@echo CGL: found
endif
ifeq ($(USE_COINOR),OFF)
@echo Coin OR (CLP, CBC): disabled
else
ifeq ($(wildcard $(WINDOWS_CBC_DIR)/include/cbc/coin/CbcModel.hpp $(WINDOWS_CBC_DIR)/include/coin/CbcModel.hpp),)
$(error Third party Cbc files was not found! did you run 'make third_party' or set WINDOWS_CBC_DIR ?)
else
@echo CBC: found
endif
endif # USE_COINOR
ifeq ($(USE_SCIP),OFF)
@echo SCIP: disabled
else
ifeq ($(wildcard $(WINDOWS_SCIP_DIR)/include/scip/scip.h),)
$(error Third party SCIP files was not found! did you run 'make third_party' or set WINDOWS_SCIP_DIR ?)
else
@echo SCIP: found
endif
endif # USE_SCIP
ifndef WINDOWS_CPLEX_DIR
@echo CPLEX: not found
else
@echo CPLEX: found
endif
ifndef WINDOWS_GLPK_DIR
@echo GLPK: not found
else
@echo GLPK: found
endif
ifndef WINDOWS_XPRESS_DIR
@echo XPRESS: not found
else
@echo XPRESS: found
endif
$(TOUCH) dependencies\check.log
.PHONY: build_third_party
build_third_party: \
Makefile.local \
install_deps_directories \
install_zlib \
install_protobuf \
install_absl \
install_swig \
install_coin_cbc \
build_scip
download_third_party: \
dependencies/archives/zlib$(ZLIB_ARCHIVE_TAG).zip \
dependencies/sources/protobuf/autogen.sh \
dependencies/archives/swigwin-$(SWIG_TAG).zip \
dependencies/sources/Cbc-$(CBC_TAG)
# Directories
.PHONY: install_deps_directories
install_deps_directories: \
dependencies/install/bin \
dependencies/install/lib/coin \
dependencies/install/include/coin
dependencies/install:
$(MKDIR_P) dependencies$Sinstall
dependencies/install/bin: dependencies/install
$(MKDIR_P) dependencies$Sinstall$Sbin
dependencies/install/lib: dependencies/install
$(MKDIR_P) dependencies$Sinstall$Slib
dependencies/install/lib/coin: dependencies/install/lib
$(MKDIR_P) dependencies$Sinstall$Slib$Scoin
dependencies/install/include: dependencies/install
$(MKDIR_P) dependencies$Sinstall$Sinclude
dependencies/install/include/coin: dependencies/install/include
$(MKDIR_P) dependencies$Sinstall$Sinclude$Scoin
######################
## Makefile.local ##
@@ -187,384 +40,30 @@ Makefile.local: makefiles/Makefile.third_party.$(SYSTEM).mk
@echo # To disable support, uncomment the following line: >> Makefile.local
@echo # USE_SCIP = OFF >> Makefile.local
@echo # >> Makefile.local
@echo # By default, make third_party will download SCIP and compile it locally. >> Makefile.local
@echo # To override this behavior, define WINDOWS_SCIP_DIR to point to an installation>> Makefile.local
@echo # directory of the scip binary packaged to use it >> Makefile.local
@echo # e.g.: WINDOWS_SCIP_DIR = C:\Progra~1\SCIPOP~1.2 >> Makefile.local
@echo # note: You can use: 'dir "%ProgramFiles%\SCIPOp*" /x' to find the shortname >> Makefile.local
@echo # >> Makefile.local
@echo # Coin OR solvers (CLP, CBC) are enabled and built-in by default. >> Makefile.local
@echo # To disable support, uncomment the following line: >> Makefile.local
@echo # USE_COINOR = OFF >> Makefile.local
@echo # >> Makefile.local
@echo # Define WINDOWS_CLP_DIR, WINDOWS_CBC_DIR if you wish to use a custom version >> Makefile.local
@echo # e.g.: WINDOWS_CBC_DIR = C:\Progra~1\CoinOR\Cbc >> Makefile.local
@echo # WINDOWS_CLP_DIR = C:\Progra~1\CoinOR\Clp >> Makefile.local
@echo # >> Makefile.local
@echo ## REQUIRED DEPENDENCIES ## >> Makefile.local
@echo # By default they will be automatically built -> nothing to define >> Makefile.local
@echo # Define WINDOWS_PROTOBUF_DIR to depend on external Protobuf library >> Makefile.local
@echo # e.g.: WINDOWS_PROTOBUF_DIR = C:\Progra~1\Protobuf >> Makefile.local
@echo # >> Makefile.local
@echo # Define WINDOWS_ZLIB_DIR, WINDOWS_ZLIB_NAME >> Makefile.local
@echo # e.g.: WINDOWS_ZLIB_DIR = C:\Progra~1\zlib >> Makefile.local
@echo # >> Makefile.local
@echo # Define WINDOWS_SWIG_BINARY for using a custom swig binary >> Makefile.local
@echo # e.g.: WINDOWS_SWIG_BINARY = C:\Progra~1\swigwin >> Makefile.local
@echo # >> Makefile.local
@echo # Define absolute paths without trailing "\". E.g. "C:\Foo\Bar" >> Makefile.local
@echo # Paths must be without spaces, try to use 'dir "directory*" /x' to get the shortname without space of each directory >> Makefile.local
@echo # e.g. dir "%ProgramFiles%*" /x >> Makefile.local
############
## ZLIB ##
############
# Install zlib
.PHONY: install_zlib
install_zlib: dependencies/install/include/zlib.h dependencies/install/include/zconf.h dependencies/install/lib/zlib.lib
dependencies/install/include/zlib.h: dependencies/sources/zlib-$(ZLIB_TAG)/zlib.h | dependencies/install/include
$(COPY) dependencies$Ssources$Szlib-$(ZLIB_TAG)$Szlib.h dependencies$Sinstall$Sinclude$Szlib.h
dependencies/install/include/zconf.h: dependencies/sources/zlib-$(ZLIB_TAG)/zlib.h | dependencies/install/include
$(COPY) dependencies$Ssources$Szlib-$(ZLIB_TAG)$Szconf.h dependencies$Sinstall$Sinclude$Szconf.h
dependencies/install/lib/zlib.lib: dependencies/sources/zlib-$(ZLIB_TAG)/zlib.h | dependencies/install/lib
cd dependencies$Ssources$Szlib-$(ZLIB_TAG) && set MAKEFLAGS= && nmake -f win32$SMakefile.msc zlib.lib
$(COPY) dependencies$Ssources$Szlib-$(ZLIB_TAG)$Szlib.lib dependencies$Sinstall$Slib
dependencies/sources/zlib-$(ZLIB_TAG)/zlib.h: dependencies/archives/zlib$(ZLIB_ARCHIVE_TAG).zip
$(UNZIP) -q -d dependencies$Ssources dependencies$Sarchives$Szlib$(ZLIB_ARCHIVE_TAG).zip
-$(TOUCH) dependencies$Ssources$Szlib-$(ZLIB_TAG)$Szlib.h
dependencies/archives/zlib$(ZLIB_ARCHIVE_TAG).zip:
$(WGET) --quiet -P dependencies$Sarchives http://zlib.net/zlib$(ZLIB_ARCHIVE_TAG).zip
ZLIB_INC = /I"$(WINDOWS_ZLIB_PATH)\\include"
ZLIB_SWIG = -I"$(WINDOWS_ZLIB_DIR)/include"
ZLIB_LNK = "$(WINDOWS_ZLIB_PATH)\lib\$(WINDOWS_ZLIB_NAME)"
DEPENDENCIES_INC += $(ZLIB_INC)
SWIG_INC += $(ZLIB_SWIG)
DEPENDENCIES_LNK += $(ZLIB_LNK)
################
## Protobuf ##
################
# Install protocol buffers.
install_protobuf: dependencies/install/lib/libprotobuf.lib
PROTOBUF_SRCDIR = dependencies/sources/protobuf-$(PROTOBUF_TAG)
PROTOBUF_SRCPATH = dependencies\sources\protobuf-$(PROTOBUF_TAG)
dependencies/install/lib/libprotobuf.lib: $(PROTOBUF_SRCDIR) install_zlib
cd $(PROTOBUF_SRCPATH) && \
set MAKEFLAGS= && "$(CMAKE)" -Hcmake -Bbuild_cmake \
-DCMAKE_PREFIX_PATH=..\..\install \
-DCMAKE_BUILD_TYPE=Release \
-Dprotobuf_BUILD_TESTS=OFF \
-DBUILD_TESTING=OFF \
-DZLIB_ROOT=..\..\install \
-DCMAKE_INSTALL_PREFIX=..\..\install \
-G "NMake Makefiles" && \
"$(CMAKE)" --build build_cmake --config Release && \
"$(CMAKE)" --build build_cmake --config Release --target install
$(PROTOBUF_SRCDIR): | dependencies/sources
-$(DELREC) $(PROTOBUF_SRCDIR)
git clone --quiet -b $(PROTOBUF_TAG) https://github.com/protocolbuffers/protobuf.git $(PROTOBUF_SRCPATH)
cd $(PROTOBUF_SRCPATH) && git apply "$(OR_TOOLS_TOP)\patches\protobuf-$(PROTOBUF_TAG).patch"
PROTOBUF_INC = /I"$(WINDOWS_PROTOBUF_PATH)\\include"
PROTOBUF_SWIG = -I"$(WINDOWS_PROTOBUF_DIR)/include"
PROTOBUF_PROTOC_INC = -I"$(WINDOWS_PROTOBUF_DIR)/include"
DYNAMIC_PROTOBUF_LNK = "$(WINDOWS_PROTOBUF_PATH)\lib\libprotobuf.lib"
STATIC_PROTOBUF_LNK = "$(WINDOWS_PROTOBUF_PATH)\lib\libprotobuf.lib"
PROTOBUF_LNK = $(STATIC_PROTOBUF_LNK)
DEPENDENCIES_INC += $(PROTOBUF_INC)
SWIG_INC += $(PROTOBUF_SWIG)
DEPENDENCIES_LNK += $(PROTOBUF_LNK)
# Install Java protobuf
# - Compile generic message proto.
# - Compile duration.proto
dependencies/install/lib/protobuf.jar: | dependencies/install/lib/libprotobuf.lib
cd dependencies\\sources\\protobuf-$(PROTOBUF_TAG)\\java && \
..\\..\\..\\install\\bin\\protoc --java_out=core/src/main/java -I../src \
../src/google/protobuf/descriptor.proto
cd dependencies\\sources\\protobuf-$(PROTOBUF_TAG)\\java && \
..\\..\\..\\install\\bin\\protoc --java_out=core/src/main/java -I../src \
../src/google/protobuf/duration.proto
cd dependencies\\sources\\protobuf-$(PROTOBUF_TAG)\\java\\core\\src\\main\\java && "$(JAVAC_BIN)" com\\google\\protobuf\\*java
cd dependencies\\sources\\protobuf-$(PROTOBUF_TAG)\\java\\core\\src\\main\\java && "$(JAR_BIN)" cvf ..\\..\\..\\..\\..\\..\\..\\install\\lib\\protobuf.jar com\\google\\protobuf\\*class
##################
## ABSEIL-CPP ##
##################
# This uses abseil-cpp cmake-based build.
.PHONY: install_absl
install_absl: dependencies/install/lib/absl.lib
dependencies/install/lib/absl.lib: dependencies/sources/abseil-cpp-$(ABSL_TAG) | dependencies/install
cd dependencies\sources\abseil-cpp-$(ABSL_TAG) && \
set MAKEFLAGS= && \
"$(CMAKE)" -H. -Bbuild_cmake \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_PREFIX_PATH=..\..\install \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=..\..\install \
-G "NMake Makefiles" && \
"$(CMAKE)" --build build_cmake --config Release && \
"$(CMAKE)" --build build_cmake --config Release --target install
dependencies/sources/abseil-cpp-$(ABSL_TAG): | dependencies/sources
-$(DELREC) dependencies/sources/abseil-cpp-$(ABSL_TAG)
git clone --quiet https://github.com/abseil/abseil-cpp.git dependencies\sources\abseil-cpp-$(ABSL_TAG)
cd dependencies\sources\abseil-cpp-$(ABSL_TAG) && git reset --hard $(ABSL_TAG)
# cd dependencies\sources\abseil-cpp-$(ABSL_TAG) && git apply "$(OR_TOOLS_TOP)\patches\abseil-cpp-$(ABSL_TAG).patch"
ABSL_INC = /I"$(WINDOWS_ABSL_PATH)\\include"
ABSL_SWIG = -I"$(WINDOWS_ABSL_PATH)/include"
# Can't explicitly list all abseil-cpp libraries
# otherwise windows prompt seems to overflow...
STATIC_ABSL_LNK = \
"$(WINDOWS_ABSL_PATH)\lib\absl_*.lib"
DYNAMIC_ABSL_LNK = $(STATIC_ABSL_LNK)
ABSL_LNK = $(STATIC_ABSL_LNK)
DEPENDENCIES_INC += $(ABSL_INC)
SWIG_INC += $(ABSL_SWIG)
DEPENDENCIES_LNK += $(ABSL_LNK)
############
## COIN ##
############
# Install Coin CBC
install_coin_cbc: dependencies/install/bin/cbc.exe
CBC_SRCDIR = dependencies/sources/Cbc-$(CBC_TAG)
dependencies/install/bin/cbc.exe: $(CBC_SRCDIR)/Cbc/MSVisualStudio/v10/$(CBC_PLATFORM)/cbc.exe
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Cbc\MSVisualStudio\v10\$(CBC_PLATFORM)\*.lib dependencies\install\lib\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Cbc\src\*.hpp dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Clp\src\*.hpp dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Clp\src\OsiClp\*.hpp dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\CoinUtils\src\*.hpp dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Cgl\src\*.hpp dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Osi\src\Osi\*.hpp dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Cbc\src\*.h dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Clp\src\*.h dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\CoinUtils\src\*.h dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Cgl\src\*.h dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Osi\src\Osi\*.h dependencies\install\include\coin
$(COPY) dependencies\sources\Cbc-$(CBC_TAG)\Cbc\MSVisualStudio\v10\$(CBC_PLATFORM)\cbc.exe dependencies\install\bin
$(CBC_SRCDIR)/Cbc/MSVisualStudio/v10/$(CBC_PLATFORM)/cbc.exe: $(CBC_SRCDIR)
tools\win\upgrade_vs_project.cmd dependencies\\sources\\Cbc-$(CBC_TAG)\\Clp\\MSVisualStudio\\v10\\libOsiClp\\libOsiClp.vcxproj $(VS_RELEASE)
tools\win\upgrade_vs_project.cmd dependencies\\sources\\Cbc-$(CBC_TAG)\\Clp\\MSVisualStudio\\v10\\libClp\\libClp.vcxproj $(VS_RELEASE)
tools\win\upgrade_vs_project.cmd dependencies\\sources\\Cbc-$(CBC_TAG)\\Cbc\\MSVisualStudio\\v10\\libOsiCbc\\libOsiCbc.vcxproj $(VS_RELEASE)
tools\win\upgrade_vs_project.cmd dependencies\\sources\\Cbc-$(CBC_TAG)\\Cbc\\MSVisualStudio\\v10\\libCbc\\libCbc.vcxproj $(VS_RELEASE)
tools\win\upgrade_vs_project.cmd dependencies\\sources\\Cbc-$(CBC_TAG)\\Cbc\\MSVisualStudio\\v10\\cbc\\cbc.vcxproj $(VS_RELEASE)
tools\win\upgrade_vs_project.cmd dependencies\\sources\\Cbc-$(CBC_TAG)\\Cbc\\MSVisualStudio\\v10\\libCbcSolver\\libCbcSolver.vcxproj $(VS_RELEASE)
tools\win\upgrade_vs_project.cmd dependencies\\sources\\Cbc-$(CBC_TAG)\\Osi\\MSVisualStudio\\v10\\libOsi\\libOsi.vcxproj $(VS_RELEASE)
tools\win\upgrade_vs_project.cmd dependencies\\sources\\Cbc-$(CBC_TAG)\\CoinUtils\\MSVisualStudio\\v10\\libCoinUtils\\libCoinUtils.vcxproj $(VS_RELEASE)
tools\win\upgrade_vs_project.cmd dependencies\\sources\\Cbc-$(CBC_TAG)\\Cgl\\MSVisualStudio\\v10\\libCgl\\libCgl.vcxproj $(VS_RELEASE)
$(SED) -i 's/CBC_BUILD;/CBC_BUILD;CBC_THREAD_SAFE;CBC_NO_INTERRUPT;/g' dependencies\\sources\\Cbc-$(CBC_TAG)\\Cbc\\MSVisualStudio\\v10\\libCbcSolver\\libCbcSolver.vcxproj
cd dependencies\sources\Cbc-$(CBC_TAG)\Cbc\MSVisualStudio\v10 && msbuild Cbc.sln /t:cbc /p:Configuration=Release;BuildCmd=ReBuild
$(CBC_SRCDIR): | dependencies/sources
-$(DELREC) $(CBC_SRCDIR)
$(UNZIP) -q -d dependencies\sources dependencies\archives\Cbc-$(CBC_TAG).zip
# This is needed to find Coin include files and libraries.
COINUTILS_INC = /I"$(WINDOWS_COINUTILS_PATH)\\include" /I"$(WINDOWS_COINUTILS_PATH)\\include\\coin"
COINUTILS_SWIG = -I"$(WINDOWS_COINUTILS_DIR)/include" -I"$(WINDOWS_COINUTILS_DIR)/include/coin"
DYNAMIC_COINUTILS_LNK = "$(WINDOWS_COINUTILS_PATH)\lib\coin\libCoinUtils.lib"
STATIC_COINUTILS_LNK = "$(WINDOWS_COINUTILS_PATH)\lib\coin\libCoinUtils.lib"
COINUTILS_LNK = $(STATIC_COINUTILS_LNK)
OSI_INC = /I"$(WINDOWS_OSI_PATH)\\include" /I"$(WINDOWS_OSI_PATH)\\include\\coin"
OSI_SWIG = -I"$(WINDOWS_OSI_DIR)/include" -I"$(WINDOWS_OSI_DIR)/include/coin"
DYNAMIC_OSI_LNK = "$(WINDOWS_OSI_PATH)\lib\coin\libOsi.lib"
STATIC_OSI_LNK = "$(WINDOWS_OSI_PATH)\lib\coin\libOsi.lib"
OSI_LNK = $(STATIC_OSI_LNK)
CLP_INC = /I"$(WINDOWS_CLP_PATH)\\include" /I"$(WINDOWS_CLP_PATH)\\include\\coin" /DUSE_CLP
CLP_SWIG = -I"$(WINDOWS_CLP_DIR)/include" -I"$(WINDOWS_CLP_DIR)/include/coin" -DUSE_CLP
DYNAMIC_CLP_LNK = \
"$(WINDOWS_CLP_PATH)\lib\coin\libClp.lib" \
"$(WINDOWS_CLP_PATH)\lib\coin\libOsiClp.lib"
STATIC_CLP_LNK = \
"$(WINDOWS_CLP_PATH)\lib\coin\libClp.lib" \
"$(WINDOWS_CLP_PATH)\lib\coin\libOsiClp.lib"
CLP_LNK = $(STATIC_CLP_LNK)
CGL_INC = /I"$(WINDOWS_CGL_PATH)\\include" /I"$(WINDOWS_CGL_PATH)\\include\\coin"
CGL_SWIG = -I"$(WINDOWS_CGL_DIR)/include" -I"$(WINDOWS_CGL_DIR)/include/coin"
DYNAMIC_CGL_LNK = "$(WINDOWS_CGL_PATH)\lib\coin\libCgl.lib"
STATIC_CGL_LNK = "$(WINDOWS_CGL_PATH)\lib\coin\libCgl.lib"
CGL_LNK = $(STATIC_CGL_LNK)
CBC_INC = /I"$(WINDOWS_CBC_PATH)\\include" /I"$(WINDOWS_CBC_PATH)\\include\\coin" /DUSE_CBC
CBC_SWIG = -I"$(WINDOWS_CBC_DIR)/include" -I"$(WINDOWS_CBC_DIR)/include/coin" -DUSE_CBC
DYNAMIC_CBC_LNK = \
"$(WINDOWS_CBC_PATH)\lib\coin\libCbcSolver.lib" \
"$(WINDOWS_CBC_PATH)\lib\coin\libCbc.lib"
STATIC_CBC_LNK = \
"$(WINDOWS_CBC_PATH)\lib\coin\libCbcSolver.lib" \
"$(WINDOWS_CBC_PATH)\lib\coin\libCbc.lib"
CBC_LNK = $(STATIC_CBC_LNK)
# Agregate all previous coin packages
COIN_INC = \
$(COINUTILS_INC) \
$(OSI_INC) \
$(CLP_INC) \
$(CGL_INC) \
$(CBC_INC)
COIN_SWIG = \
$(COINUTILS_SWIG) \
$(OSI_SWIG) \
$(CLP_SWIG) \
$(CGL_SWIG) \
$(CBC_SWIG)
COIN_LNK = \
$(CBC_LNK) \
$(CGL_LNK) \
$(CLP_LNK) \
$(OSI_LNK) \
$(COINUTILS_LNK)
DEPENDENCIES_INC += $(COIN_INC)
SWIG_INC += $(COIN_SWIG)
DEPENDENCIES_LNK += $(COIN_LNK)
#########################
## SCIP ##
#########################
.PHONY: build_scip
ifeq ($(USE_SCIP),OFF)
build_scip: $(GEN_DIR)/ortools/linear_solver/lpi_glop.cc
$(GEN_DIR)/ortools/linear_solver/lpi_glop.cc: | $(GEN_DIR)/ortools/linear_solver
$(TOUCH) $(GEN_PATH)$Sortools$Slinear_solver$Slpi_glop.cc
else
build_scip: dependencies/install/lib/libscip.lib $(GEN_DIR)/ortools/linear_solver/lpi_glop.cc
SCIP_SRCDIR = dependencies/sources/scip-$(SCIP_TAG)
SCIP_SRCPATH = dependencies\sources\scip-$(SCIP_TAG)
dependencies/install/lib/libscip.lib: $(SCIP_SRCDIR)
-tools\win\rm -rf $(SCIP_SRCDIR)\build_cmake
cd $(SCIP_SRCPATH) && \
set MAKEFLAGS= && "$(CMAKE)" -H. -Bbuild_cmake \
-DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON \
-DCMAKE_PREFIX_PATH=..\..\install \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=OFF \
-DSHARED=OFF \
-DBUILD_TESTING=OFF \
-DCMAKE_INSTALL_PREFIX=..\..\install \
-DREADLINE=OFF \
-DGMP=OFF \
-DPAPILO=OFF \
-DZIMPL=OFF \
-DIPOPT=OFF \
-DAMPL=OFF \
-DTPI="tny" \
-DEXPRINT="none" \
-DLPS="none" \
-DSYM="none" \
-G "NMake Makefiles" && \
"$(CMAKE)" --build build_cmake --config Release && \
"$(CMAKE)" --build build_cmake --config Release --target install
lib /REMOVE:CMakeFiles\libscip.dir\lpi\lpi_none.c.obj $(OR_TOOLS_TOP)\dependencies\install\lib\libscip.lib
$(SCIP_SRCDIR): | dependencies/sources
-$(DELREC) $(SCIP_SRCDIR)
git clone --quiet -b $(SCIP_TAG) https://github.com/scipopt/scip.git $(SCIP_SRCPATH)
# cd $(SCIP_SRCPATH) && git apply "$(OR_TOOLS_TOP)\patches\scip-$(SCIP_TAG).patch"
$(GEN_DIR)/ortools/linear_solver/lpi_glop.cc: $(SCIP_SRCDIR) | $(GEN_DIR)/ortools/linear_solver
copy $(SCIP_SRCPATH)\src\lpi\lpi_glop.cpp $(GEN_PATH)\ortools\linear_solver\lpi_glop.cc
$(TOUCH) $(GEN_PATH)$Sortools$Slinear_solver$Slpi_glop.cc
SCIP_INC = /I"$(WINDOWS_SCIP_PATH)\\include" /DUSE_SCIP /DNO_CONFIG_HEADER
SCIP_SWIG = -I"$(WINDOWS_SCIP_DIR)/include" -DUSE_SCIP -DNO_CONFIG_HEADER
SCIP_LNK = "$(WINDOWS_SCIP_PATH)\lib\libscip.lib"
DEPENDENCIES_INC += $(SCIP_INC)
SWIG_INC += $(SCIP_SWIG)
DEPENDENCIES_LNK += $(SCIP_LNK)
endif
############
## SWIG ##
############
# Install SWIG.
install_swig: dependencies/install/swigwin-$(SWIG_TAG)/swig.exe
dependencies/install/swigwin-$(SWIG_TAG)/swig.exe: dependencies/archives/swigwin-$(SWIG_TAG).zip
$(UNZIP) -q -d dependencies$Sinstall dependencies$Sarchives$Sswigwin-$(SWIG_TAG).zip
$(TOUCH) dependencies$Sinstall$Sswigwin-$(SWIG_TAG)$Sswig.exe
SWIG_ARCHIVE:=http://prdownloads.sourceforge.net/swig/swigwin-$(SWIG_TAG).zip
dependencies/archives/swigwin-$(SWIG_TAG).zip:
$(WGET) --quiet -P dependencies$Sarchives --no-check-certificate $(SWIG_ARCHIVE)
# TODO: TBD: Don't know if this is a ubiquitous issue across platforms...
# Handle a couple of extraneous circumstances involving TortoiseSVN caching and .svn readonly attributes.
kill_tortoisesvn_cache:
$(TASKKILL) /IM "$(TSVNCACHE_EXE)" /F /FI "STATUS eq RUNNING"
remove_readonly_svn_attribs: kill_tortoisesvn_cache
if exist dependencies\sources\* $(ATTRIB) -r /s dependencies\sources\*
.PHONY: clean_third_party # Clean everything. Remember to also delete archived dependencies, i.e. in the event of download failure, etc.
clean_third_party: remove_readonly_svn_attribs
clean_third_party:
-$(DEL) Makefile.local
-$(DEL) dependencies\check.log
-$(DEL) dependencies\archives\swigwin*.zip
-$(DEL) dependencies\archives\sparsehash*.zip
-$(DEL) dependencies\archives\zlib*.zip
-$(DEL) dependencies\archives\v*.zip
-$(DEL) dependencies\archives\win_flex_bison*.zip
-$(DELREC) dependencies\sources\zlib*
-$(DELREC) dependencies\sources\protobuf*
-$(DELREC) dependencies\sources\abseil-cpp*
-$(DELREC) dependencies\sources\Cbc-*
-$(DELREC) dependencies\sources\scip*
-$(DELREC) dependencies\sources\google*
-$(DELREC) dependencies\sources\glpk*
-$(DELREC) dependencies\sources\sparsehash*
-$(DELREC) dependencies\install
-$(DELREC) dependencies\*
-$(DELREC) include
-$(DELREC) share
-$(DELREC) lib\*.lib
-$(DELREC) lib\cmake
-$(DELREC) lib\pkgconfig
.PHONY: detect_third_party # Show variables used to find third party
detect_third_party:
@echo Relevant info on third party:
@echo WINDOWS_ZLIB_DIR = $(WINDOWS_ZLIB_DIR)
@echo ZLIB_INC = $(ZLIB_INC)
@echo ZLIB_LNK = $(ZLIB_LNK)
@echo WINDOWS_PROTOBUF_DIR = $(WINDOWS_PROTOBUF_DIR)
@echo PROTOBUF_INC = $(PROTOBUF_INC)
@echo PROTOBUF_LNK = $(PROTOBUF_LNK)
@echo ABSL_INC = $(ABSL_INC)
@echo ABSL_LNK = $(ABSL_LNK)
@echo WINDOWS_CBC_DIR = $(WINDOWS_CBC_DIR)
@echo CBC_INC = $(CBC_INC)
@echo CBC_LNK = $(CBC_LNK)
@echo WINDOWS_CLP_DIR = $(WINDOWS_CLP_DIR)
@echo CLP_INC = $(CLP_INC)
@echo CLP_LNK = $(CLP_LNK)
@echo WINDOWS_SCIP_DIR = $(WINDOWS_SCIP_DIR)
@echo SCIP_INC = $(SCIP_INC)
@echo SCIP_LNK = $(SCIP_LNK)
@echo USE_COINOR = $(USE_COINOR)
@echo USE_SCIP = $(USE_SCIP)
ifdef WINDOWS_GLPK_DIR
@echo WINDOWS_GLPK_DIR = $(WINDOWS_GLPK_DIR)
@echo GLPK_INC = $(GLPK_INC)

View File

@@ -4,9 +4,9 @@
# Unix specific definitions
LIB_PREFIX = lib
DEP_BIN_DIR = $(OR_ROOT)dependencies/install/bin
DEP_BIN_DIR = $(OR_ROOT)bin
# C++ relevant directory
INC_DIR = $(OR_ROOT).
INC_DIR = $(OR_ROOT)include
SRC_DIR = $(OR_ROOT).
GEN_DIR = $(OR_ROOT)ortools/gen
GEN_PATH = $(subst /,$S,$(GEN_DIR))
@@ -86,17 +86,7 @@ PATH_TO_PYTHON_INCLUDE = $(shell python$(UNIX_PYTHON_VER) -c 'import sysconfig;
PYTHON_INC = -I$(PATH_TO_PYTHON_INCLUDE) -I$(PATH_TO_PYTHON_LIB) $(ADD_PYTHON_INC)
PYTHON_INC += $(shell pkg-config --cflags python$(MAJOR_PYTHON_VERSION) 2> /dev/null)
#PYTHON_LNK += $(shell pkg-config --libs python$(MAJOR_PYTHON_VERSION) 2> /dev/null)
#ifeq ("${PYTHON_LNK}","")
#PYTHON_LNK = "-lpython${UNIX_PYTHON_VERSION}"
#endif
# This is needed to find GLPK include files.
ifdef UNIX_GLPK_DIR
GLPK_INC = -I$(UNIX_GLPK_DIR)/include -DUSE_GLPK
GLPK_SWIG = $(GLPK_INC)
endif
ifdef UNIX_CPLEX_DIR
CPLEX_INC = -I$(UNIX_CPLEX_DIR)/cplex/include -DUSE_CPLEX
CPLEX_SWIG = $(CPLEX_INC)
@@ -152,16 +142,14 @@ ifeq ($(PLATFORM),LINUX)
POST_LIB =
LINK_FLAGS = \
-Wl,-rpath,'$$ORIGIN' \
-Wl,-rpath,'$$ORIGIN/../lib' \
-Wl,-rpath,'$$ORIGIN/../dependencies/install/lib64' \
-Wl,-rpath,'$$ORIGIN/../dependencies/install/lib'
-Wl,-rpath,'$$ORIGIN/../lib'
PYTHON_LDFLAGS = \
-Wl,-rpath,'$$ORIGIN' \
-Wl,-rpath,'$$ORIGIN/../../ortools' \
-Wl,-rpath,'$$ORIGIN/../../ortools/.libs' \
-Wl,-rpath,'$$ORIGIN/../../../../lib' \
-Wl,-rpath,'$$ORIGIN/../../../../dependencies/install/lib64' \
-Wl,-rpath,'$$ORIGIN/../../../../dependencies/install/lib'
-Wl,-rpath,'$$ORIGIN/../../../../lib'
endif # ifeq ($(PLATFORM),LINUX)
ifeq ($(PLATFORM),MACOSX)
MAC_VERSION = -mmacosx-version-min=$(MAC_MIN_VERSION)