diff --git a/cmake/cpp.cmake b/cmake/cpp.cmake index 229d2bfb5f..b22615698a 100644 --- a/cmake/cpp.cmake +++ b/cmake/cpp.cmake @@ -19,6 +19,15 @@ list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_BOP" # enable BOP support "USE_GLOP" # enable GLOP support ) +if(USE_COINOR) + list(APPEND OR_TOOLS_COMPILE_DEFINITIONS + "USE_CBC" # enable COIN-OR CBC support + "USE_CLP" # enable COIN-OR CLP support + ) +endif() +if(USE_GLPK) + list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_GLPK") +endif() if(USE_PDLP) list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_PDLP") set(PDLP_DIR pdlp) @@ -27,15 +36,6 @@ if(USE_SCIP) list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_SCIP") set(GSCIP_DIR gscip) endif() -if(USE_GLPK) - list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_GLPK") -endif() -if(USE_COINOR) - list(APPEND OR_TOOLS_COMPILE_DEFINITIONS - "USE_CBC" # enable COIN-OR CBC support - "USE_CLP" # enable COIN-OR CLP support - ) -endif() if(USE_CPLEX) list(APPEND OR_TOOLS_COMPILE_DEFINITIONS "USE_CPLEX") endif() diff --git a/cmake/dotnet.cmake b/cmake/dotnet.cmake index 38d2d9767c..289dfae27b 100644 --- a/cmake/dotnet.cmake +++ b/cmake/dotnet.cmake @@ -77,6 +77,9 @@ endif() if(USE_GLPK) list(APPEND FLAGS "-DUSE_GLPK") endif() +if(USE_PDLP) + list(APPEND FLAGS "-DUSE_PDLP") +endif() if(USE_SCIP) list(APPEND FLAGS "-DUSE_SCIP") endif() @@ -100,6 +103,10 @@ file(GLOB_RECURSE proto_dotnet_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/sat/*.proto" "ortools/util/*.proto" ) +if(USE_PDLP) + file(GLOB_RECURSE pdlp_proto_dotnet_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/pdlp/*.proto") + list(APPEND proto_dotnet_files ${pdlp_proto_dotnet_files}) +endif() list(REMOVE_ITEM proto_dotnet_files "ortools/constraint_solver/demon_profiler.proto") list(REMOVE_ITEM proto_dotnet_files "ortools/constraint_solver/assignment.proto") foreach(PROTO_FILE IN LISTS proto_dotnet_files) diff --git a/cmake/java.cmake b/cmake/java.cmake index 577b02ae48..eff85ec03a 100644 --- a/cmake/java.cmake +++ b/cmake/java.cmake @@ -72,6 +72,9 @@ endif() if(USE_GLPK) list(APPEND FLAGS "-DUSE_GLPK") endif() +if(USE_PDLP) + list(APPEND FLAGS "-DUSE_PDLP") +endif() if(USE_SCIP) list(APPEND FLAGS "-DUSE_SCIP") endif() @@ -85,6 +88,10 @@ file(GLOB_RECURSE proto_java_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/sat/*.proto" "ortools/util/*.proto" ) +if(USE_PDLP) + file(GLOB_RECURSE pdlp_proto_java_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/pdlp/*.proto") + list(APPEND proto_java_files ${pdlp_proto_java_files}) +endif() list(REMOVE_ITEM proto_java_files "ortools/constraint_solver/demon_profiler.proto") list(REMOVE_ITEM proto_java_files "ortools/constraint_solver/assignment.proto") foreach(PROTO_FILE IN LISTS proto_java_files) diff --git a/cmake/python.cmake b/cmake/python.cmake index 279291b276..0e314782b9 100644 --- a/cmake/python.cmake +++ b/cmake/python.cmake @@ -124,6 +124,10 @@ file(GLOB_RECURSE proto_py_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/util/*.proto" "ortools/scheduling/*.proto" ) +if(USE_PDLP) + file(GLOB_RECURSE pdlp_proto_py_files RELATIVE ${PROJECT_SOURCE_DIR} "ortools/pdlp/*.proto") + list(APPEND proto_py_files ${pdlp_proto_py_files}) +endif() list(REMOVE_ITEM proto_py_files "ortools/constraint_solver/demon_profiler.proto") foreach(PROTO_FILE IN LISTS proto_py_files) #message(STATUS "protoc proto(py): ${PROTO_FILE}") @@ -155,6 +159,9 @@ endif() if(USE_GLPK) list(APPEND FLAGS "-DUSE_GLPK") endif() +if(USE_PDLP) + list(APPEND FLAGS "-DUSE_PDLP") +endif() if(USE_SCIP) list(APPEND FLAGS "-DUSE_SCIP") endif() @@ -183,6 +190,7 @@ file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/linear_solver/__init__.py CONTENT "") file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/model_builder/__init__.py CONTENT "") file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/model_builder/python/__init__.py CONTENT "") file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/packing/__init__.py CONTENT "") +file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/pdlp/__init__.py CONTENT "") file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/sat/__init__.py CONTENT "") file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/sat/python/__init__.py CONTENT "") file(GENERATE OUTPUT ${PYTHON_PROJECT_DIR}/scheduling/__init__.py CONTENT "") diff --git a/ortools/linear_solver/csharp/linear_solver.i b/ortools/linear_solver/csharp/linear_solver.i index 0d3ad75e73..ab503fb0d9 100644 --- a/ortools/linear_solver/csharp/linear_solver.i +++ b/ortools/linear_solver/csharp/linear_solver.i @@ -88,6 +88,7 @@ CONVERT_VECTOR(operations_research::MPVariable, MPVariable) %unignore operations_research::MPSolver::CLP_LINEAR_PROGRAMMING; %unignore operations_research::MPSolver::GLOP_LINEAR_PROGRAMMING; %unignore operations_research::MPSolver::GLPK_LINEAR_PROGRAMMING; +%unignore operations_research::MPSolver::PDLP_LINEAR_PROGRAMMING; %unignore operations_research::MPSolver::SCIP_MIXED_INTEGER_PROGRAMMING; %unignore operations_research::MPSolver::CBC_MIXED_INTEGER_PROGRAMMING; %unignore operations_research::MPSolver::GLPK_MIXED_INTEGER_PROGRAMMING; diff --git a/ortools/linear_solver/java/linear_solver.i b/ortools/linear_solver/java/linear_solver.i index ce638e4139..fdafdfddb6 100644 --- a/ortools/linear_solver/java/linear_solver.i +++ b/ortools/linear_solver/java/linear_solver.i @@ -301,6 +301,7 @@ PROTO2_RETURN( %unignore operations_research::MPSolver::GLOP_LINEAR_PROGRAMMING; %unignore operations_research::MPSolver::CLP_LINEAR_PROGRAMMING; %unignore operations_research::MPSolver::GLPK_LINEAR_PROGRAMMING; +%unignore operations_research::MPSolver::PDLP_LINEAR_PROGRAMMING; %unignore operations_research::MPSolver::SCIP_MIXED_INTEGER_PROGRAMMING; %unignore operations_research::MPSolver::CBC_MIXED_INTEGER_PROGRAMMING; %unignore operations_research::MPSolver::GLPK_MIXED_INTEGER_PROGRAMMING; diff --git a/ortools/linear_solver/python/linear_solver.i b/ortools/linear_solver/python/linear_solver.i index 2dfd5889d0..b61a22fc13 100644 --- a/ortools/linear_solver/python/linear_solver.i +++ b/ortools/linear_solver/python/linear_solver.i @@ -266,6 +266,7 @@ PY_CONVERT(MPVariable); %unignore operations_research::MPSolver::GLOP_LINEAR_PROGRAMMING; %unignore operations_research::MPSolver::CLP_LINEAR_PROGRAMMING; %unignore operations_research::MPSolver::GLPK_LINEAR_PROGRAMMING; +%unignore operations_research::MPSolver::PDLP_LINEAR_PROGRAMMING; %unignore operations_research::MPSolver::SCIP_MIXED_INTEGER_PROGRAMMING; %unignore operations_research::MPSolver::CBC_MIXED_INTEGER_PROGRAMMING; %unignore operations_research::MPSolver::GLPK_MIXED_INTEGER_PROGRAMMING; diff --git a/ortools/python/setup.py.in b/ortools/python/setup.py.in index e895d510ec..c3ca4cd1aa 100644 --- a/ortools/python/setup.py.in +++ b/ortools/python/setup.py.in @@ -56,6 +56,7 @@ setup( '@PROJECT_NAME@.linear_solver':['$', '*.pyi'], '@PROJECT_NAME@.model_builder.python':['$', '*.pyi'], '@PROJECT_NAME@.packing':['*.pyi'], + '@PROJECT_NAME@.pdlp':['*.pyi'], '@PROJECT_NAME@.sat.python':['$', '*.pyi'], '@PROJECT_NAME@.scheduling':['$', '*.pyi'], '@PROJECT_NAME@.util.python':['$', '*.pyi'],