Files
ortools-clone/ortools/python/__init__.py.in
Mizux Seiha d3af4d76c9 cmake: Fix and enabled shared lib support with MSVC
* Add decldll to proto
* rework init to make it working for MSVC
* fix test_xprs_interface build
dotnet: Fix MSVC shared libs support
  * Fix csproj to include libortools.dll
java: Fix MSVC shared_libs support
  * Fix runtime jar to include libortools.dll
python: Fix MSVC shared_libs support
  * fix __init__.py.in loading for MSVC
2025-02-04 19:42:22 +01:00

66 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", "re2.dll", "libprotobuf.dll", "highs.dll", "ortools.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()