Skip to content

Conversation

@Mohit-Lakra
Copy link

@Mohit-Lakra Mohit-Lakra commented Jan 8, 2026

Fixes #124
This PR removes the blockers I described above:

  • [build-system] now depends on setuptools and numpy>=1.23.5,<2, so Poetry can fetch a wheel that exists on Python
    3.11. The lockfile is updated so sparseqr points to commit 535df76 (v1.4.1), which builds on arm64.
  • volesti/external/PackedCSparse/FloatArray.h only includes <immintrin.h> when the compiler actually defines SSE/AVX
    macros, and the .template qualifiers in volesti/include/sampling/mmcs.hpp and parallel_mmcs.hpp are removed so clang
    accepts the code.
  • setup.py sets -std=c++17 via CXXFLAGS instead of feeding it to the C compiler, keeping the lp_solve C sources on
    legal flags.

To reproduce the working setup on macOS 14.6 (M2), you need Homebrew’s GLPK/GMP/SWIG for swiglpk. Then:

one-time: install native deps

brew install glpk gmp swig

use Python 3.11 for the Poetry environment and point swiglpk at Homebrew’s include/lib

env -u CONDA_PREFIX -u CONDA_DEFAULT_ENV -u CONDA_SHLVL -u CONDA_PROMPT_MODIFIER
-u CONDA_EXE -u _CONDA_EXE -u _CONDA_ROOT -u CONDA_PYTHON_EXE -u _CE_CONDA -u _CE_M
GLPK_HEADER_PATH=/opt/homebrew/include
LDFLAGS="-L/opt/homebrew/lib"
CPPFLAGS="-I/opt/homebrew/include"
PATH="$HOME/.local/bin:$PATH"
poetry env use $(which python3.11)

env …same… poetry install
env …same… poetry run python tests/fba.py

Those commands now complete successfully. I also ran the other test scripts in tests/ (full_dimensional.py,
max_ball.py, scaling.py, rounding.py, sampling.py) under the same environment and they pass.

@Mohit-Lakra
Copy link
Author

Mohit-Lakra commented Jan 8, 2026

@vissarion, @TolisChal
I identified an issue where the build setup fails on Mac M-series systems, so I’ve submitted a PR to modernize setup.py and the related dependencies. This should fix the installation errors for those users. Happy to get a review when convenient.

@Mohit-Lakra
Copy link
Author

Note for Reviewers: I have verified this builds successfully on macOS (M2) locally.

This PR currently focuses on the Python build system (setup.py, poetry). To fully compile the C++ extensions on macOS, a few patches are needed in the volesti submodule (guarding intrinsics for ARM64).

I can submit those C++ fixes as a separate upstream PR to volesti and update the submodule here once merged. Let me know if you prefer that workflow!

@Mohit-Lakra
Copy link
Author

Mohit-Lakra commented Jan 8, 2026

image

Verification Update: Full Success on macOS M2 (Apple Silicon)

I have successfully verified that this build correctly links the C++ backend and performs high-dimensional sampling on macOS ARM64.

The Test: I loaded the E. coli core model via cobra and passed the stoichiometric matrix directly to the dingo C++ engine to bypass file parser inconsistencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

poetry install fails on Apple M-series (numpy pin, volesti build errors)

1 participant