Files
ortools-clone/ortools/python/__init__.py.in
Mizux Seiha 53fa48120f cmake: Fix windows python.cmake runtime issue
note: libprotobuf.dll depends on utf8_validity.dll
when tested it seems WinDLL() will load it so we may only
manually load highs.dll and libprotobuf.dll
which should implicitly load the three others:
abseil_dll.dll, zlib1.dll and utf8_validity.dll
2024-11-04 10:45:04 +01:00

65 lines
1.7 KiB
Python

r'''
# OR-Tools
This is the reference documentation for Google OR-Tools.
This repository contains several component:
### Link with the C++ layer
- `ortools.init.python.init`,
### Knapsack solver
- `ortools.algorithms.python.knapsack_solver`,
### Graph and flow algorithms
- `ortools.graph.python.linear_sum_assignment`,
- `ortools.graph.python.max_flow`,
- `ortools.graph.python.min_cost_flow`,
### Routing library and legacy Constraint Programming Solver
- `ortools.constraint_solver.pywrapcp`,
### Minimalistic linear solver wrapper
- `ortools.linear_solver.python.model_builder`
### CP-SAT
- `ortools.sat.python.cp_model`,
- `ortools.util.python.sorted_interval_list`,
- `ortools.sat.cp_model_pb2`
- `ortools.sat.sat_parameters_pb2`
### Legacy linear solver wrapper
- `ortools.linear_solver.pywraplp`,
- `ortools.linear_solver.linear_solver_pb2`,
### Linear solver backends
- `ortools.bop.bop_parameters_pb2`,
- `ortools.glop.parameters_pb2`,
- `ortools.pdlp`,
### PSPLIB Parser
- `ortools.scheduling.python.rcpsp`,
'''
__docformat__ = "markdown" # explicitly disable rST processing above.
__version__ = "@PROJECT_VERSION@"
import os
def _load_ortools_libs():
"""Load shared libraries on Windows"""
if os.name == "nt":
try:
from ctypes import WinDLL
basedir = os.path.dirname(__file__)
except:
pass
else:
for dll in ["zlib1.dll", "abseil_dll.dll", "utf8_validity.dll", "libprotobuf.dll", "highs.dll"]:
dll_path = os.path.join(basedir, ".libs", dll)
if os.path.exists(dll_path):
print(f"load {dll_path}...")
WinDLL(dll_path)
_load_ortools_libs()