Metadata-Version: 2.4
Name: lindo
Version: 17.0.0
Summary: Python interface to LINDO API
Home-page: http://www.lindo.com
Author: Lindo Systems, Inc.
Author-email: support@lindo.com
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Python :: 3.15
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.7
Description-Content-Type: text/markdown
Requires-Dist: numpy
Dynamic: author
Dynamic: author-email
Dynamic: classifier
Dynamic: description
Dynamic: description-content-type
Dynamic: home-page
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# The Python Interface to LINDO API.

This package requires LINDO API and a valid license key. Please refer to lindoapi/readme.html for LINDO API installation details.

## Installation for LINDO API 17

This python package can be installed with pip

For administrative users: 

```bash
> pip install lindo
```

For standard (non-administrative) users:

```bash
> pip install lindo --user
```

## Installation for LINDO API 16

This python package can be installed with pip

For administrative users: 

```bash
> pip install lindo==16.0.68
```

For standard (non-administrative) users:

```bash
> pip install lindo==16.0.68 --user
```

## Installation for LINDO API 15

This python package can be installed with pip

For administrative users: 

```bash
> pip install lindo==15.0.1
```

For standard (non-administrative) users:

```bash
> pip install lindo==15.0.1 --user
```
## Installation for LINDO API 14

This python package can be installed with pip

For administrative users: 

```bash
> pip install lindo==14.0.0
```

For standard (non-administrative) users:

```bash
> pip install lindo==14.0.0 --user
```

## Testing

A quick way to test the installation is to run
```bash
> python -m lindo_test
```

You can also try out the samples by 
```
> python samples/lp.py
```

## Possible errors due to misconfiguration

You may get the following error if your LINDOAPI_HOME environment variable is not set up.  

```
Error: Environment variable LINDOAPI_HOME should be set
```

To fix the problem follow these steps

### Using Windows
On the command line
```dos
> setx LINDOAPI_HOME "c:/lindoapi" 
```
### Using Mac or Linux
On the command line

For administrative users:
```     
$ export LINDOAPI_HOME="/opt/lindoapi"	
```    
For standard (non-administrative) users:
```    
$ export LINDOAPI_HOME="~/opt/lindoapi"	
```   
To have this variable set automatically, add the above line to your `~/.bashrc` or `~/.bash_profile` file.

## For Mac Users 
The LINDO api has two version that could be compatible with your machine osx64x86 and arm64. If you are using osx64x86 then your Python distribution must have been installed on an Intel Mac or using Rosetta, otherwise it will target arm64 .whl files when using pip. Similarly, if you are using a M1/M2 Mac when Python was installed on your machine Rosetta should have been disabled. The LINDO api supports Python 3.7-3.10 on osx64x86 and Python 3.10 on arm64. 

## How to Build Wheel and Install (for package managers)

### Linux ARM64 Wheels With Docker

Start Docker Desktop. On Apple Silicon, start a native ARM terminal with
`arch -arm64 /bin/zsh -l`; `uname -m` should print `arm64`. The Docker command
also explicitly selects Linux ARM64, independently of the terminal architecture.

Keep `LAPI-LINUX-ARM64-17.0.tar.gz` and `lndlic170.lic` in the repository root,
then run:

```bash
docker buildx build --platform linux/arm64 \
	--build-arg MANYLINUX_ARCH=aarch64 \
	--build-arg SDK_ARCHIVE=LAPI-LINUX-ARM64-17.0.tar.gz \
	--build-arg LINDO_PLATFORM=linux64arm \
	--secret id=lindo_license,src=lndlic170.lic \
	--target wheels \
	--output type=local,dest=wheelhouse/linux-arm64 .
```

The manylinux_2_34 ARM64 builder compiles CPython 3.9 through 3.15 wheels,
bundles linked libraries with auditwheel, and tests every installed wheel with
`python -m lindo_test` and the LP sample. Outputs are Linux `aarch64` wheels,
not macOS wheels. Auditwheel may also add an older compatible manylinux tag.

The license is mounted only during testing as
`/opt/lindoapi/license/lndapi170.lic`. It is excluded from the build context,
image layers, and exported wheels. Do not copy it into the Dockerfile. Review
native-library redistribution permissions before distributing the wheels.
The Dockerfile retains its Intel Linux defaults when these build arguments
are omitted.

### macOS Wheels With cibuildwheel

The manually triggered **macOS Wheels** GitHub Actions workflow targets CPython
3.9 through 3.15 on native Intel (`x86_64`) and Apple Silicon (`arm64`) runners.
It builds seven separate wheels per architecture, not universal2 or free-threaded
wheels. These targets are not certified until their builds and tests pass.

Before running the workflow, configure repository Actions secrets
`LINDO_LICENSE_MACOS_X86_64` and `LINDO_LICENSE_MACOS_ARM64` with the respective
LINDO API 17 license file contents. The licenses must work on the CI hosts;
machine-bound workstation licenses may not. The workflow uses the matching
macOS SDK archives already in this repository, excludes archived licenses, and
stores test licenses only in the runner's temporary SDK directory.

Run **Actions > macOS Wheels > Run workflow**. Successful jobs provide
`lindo-macos-x86_64` and `lindo-macos-arm64` wheel artifacts. There is no automatic
PyPI publication. cibuildwheel uses delocate to bundle linked native libraries
and repair their load paths. Confirm LINDO and third-party library redistribution
permissions before sharing these artifacts. A valid license and `LINDOAPI_HOME`
are still required by the Python package at runtime.

For a local native build, install Xcode Command Line Tools and the official
python.org interpreters for Python 3.9 through 3.15. cibuildwheel does not use
Homebrew or uv-managed interpreters as wheel-build interpreters and may require
system-wide interpreter installation. Extract the matching macOS SDK, place a
valid license at `$LINDOAPI_HOME/license/lndapi170.lic`, then run:

```bash
python3.13 -m venv .venv-macbuild
.venv-macbuild/bin/python -m pip install cibuildwheel==4.3.5
export LINDOAPI_HOME="/absolute/path/to/lindoapi"
export CIBW_PYTHON="$PWD/.venv-macbuild/bin/python"
bash MacBuild
```

Wheels are written to `wheelhouse/`. To check the matrix without building:

```bash
"$CIBW_PYTHON" -m cibuildwheel --platform macos --archs x86_64,arm64 --print-build-identifiers
```

The installed-wheel test creates and deletes a licensed solver environment and
fails on license or API errors. It is a smoke test, not a full optimization suite.

### Single-Interpreter Build

To build the python package on any operating system first start by creating a whl file. From the top of the lindoapi-python directory run the command.

```bash
> python -m build
```

If the command is successful a new directory named `dist` is created in the lindoapi-python directory. The new directory will have a two files with extension `.whl` and `.tar.gz`. For example, if you built it on Mac OS using Python 3.10 the new directory will look like this.

```bash
├── dist
│  ├── lindo-x.y.z-cp310-cp310-macosx_10_9_universal2.whl
│  └── lindo-x.y.z.tar.gz
```

The package can now be installed locally using the command.
```bash
> pip install dist/*.whl
```


