Metadata-Version: 2.1
Name: compas_sandbox_native
Version: 0.1.0
Summary: In-process IPOPT solver for compas_sandbox (nanobind binding, statically linked)
License: EPL-2.0
Classifier: Development Status :: 3 - Alpha
Classifier: Topic :: Scientific/Engineering
Classifier: Programming Language :: Python :: 3
Project-URL: Repository, https://github.com/petrasvestartas/compas_sandbox
Requires-Python: >=3.9
Requires-Dist: numpy>=1.24
Description-Content-Type: text/markdown

# compas_sandbox_native

IPOPT (with the MUMPS linear solver) compiled into a Python extension module with
[nanobind](https://github.com/wjakob/nanobind), so `compas_sandbox` can solve CRA
problems in-process: no bundled executable, no subprocess, no `.nl` files.

## Building

The extension links the static IPOPT tree produced by `packaging/build_ipopt.sh`:

```bash
packaging/build_ipopt.sh                  # stages into build/ipopt/stage
pip install ./native                      # picks the stage tree up automatically
```

Point `IPOPT_PREFIX` at a different stage tree to override. Extra link flags (e.g. a
static Fortran runtime) go in `IPOPT_EXTRA_LINK`.

## Usage

Installed alongside `compas_sandbox`, the `nlp` backend discovers it automatically:

```python
from compas_sandbox.equilibrium import cra_solve_native
cra_solve_native(assembly)   # same inputs and results as cra_solve
```
