Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
94ffbe9
smlp package build files for MacOS, created by Claude Sonnet 4.5
mdmitry1 Mar 6, 2026
b79753c
Removed references to GIT_BRANCH - build will be done from the curren…
mdmitry1 Mar 6, 2026
ed11d71
z3 4.16.0
konstantin-korovin Mar 6, 2026
5f3db3f
package_test/python3.11/venv/run_dora: fixed: git branch for mac
konstantin-korovin Mar 6, 2026
a5e17ad
package_test/python3.11/venv/run_dora: dbg
konstantin-korovin Mar 6, 2026
c1d903c
dbg off
konstantin-korovin Mar 6, 2026
12a15b0
Fixed copy-paste error
mdmitry1 Mar 7, 2026
6fc0627
Merge branch 'smlp_python311_mac' of https://github.com/SMLP-Systems/…
konstantin-korovin Mar 7, 2026
8a9c022
Removed manylinux files in order not to confuse Mac
mdmitry1 Mar 7, 2026
a77b645
Removed Linux wheel, which probably confuses Mac
mdmitry1 Mar 7, 2026
47f4424
build_macos.sh: set -x
konstantin-korovin Mar 7, 2026
3e43ffa
build_macos.sh: env vars for gcc
konstantin-korovin Mar 9, 2026
fc4b3d9
Merge branch 'poly-macos' into smlp_python311_mac
konstantin-korovin Mar 9, 2026
dfcc98f
tcl-tk to cocoa patch
konstantin-korovin Mar 9, 2026
ee9798e
Merge branch 'poly-macos-cocooa' into smlp_python311_mac
konstantin-korovin Mar 9, 2026
c838275
dbg
konstantin-korovin Mar 9, 2026
50225ec
setup.py: fix: z3 pkgconfig
konstantin-korovin Mar 10, 2026
d558fdc
next
konstantin-korovin Mar 10, 2026
9489300
setup.py: added z3 lib paths in native.ini
konstantin-korovin Mar 10, 2026
38b5de6
build_macos.sh; setup.py; repair_wheel.py: workaround of setting DYLD…
konstantin-korovin Mar 11, 2026
a44b1d2
pyproject.toml: patch for standalone smlp
konstantin-korovin Mar 11, 2026
4bcc87b
merge
konstantin-korovin Mar 11, 2026
2930997
repair_wheel.py: fix: correct path to libpython3.11.dylib in libsmlp.…
konstantin-korovin Mar 11, 2026
eb8a7b5
smlp_plots.py: matplotlib: commented backend
konstantin-korovin Mar 21, 2026
d315d5e
add: repair_path.sh
konstantin-korovin Mar 22, 2026
fd2b502
setup,py: removed git switch
konstantin-korovin Mar 22, 2026
2fa6107
repair_path.sh: fix
konstantin-korovin Mar 22, 2026
c199260
dist/smlp-0.1.0-cp311-cp311-macosx_26_0_arm64.whl: working on mac
konstantin-korovin Mar 22, 2026
bf9a3b6
print: Loading libraries...
konstantin-korovin Mar 22, 2026
4c5fdc8
pyproject.toml: smlp version
konstantin-korovin Mar 22, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions build_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
#!/usr/bin/env bash
# =============================================================================
# build_macos.sh – macOS equivalent of the manylinux Dockerfile
#
# Installs all prerequisites via Homebrew + pip, clones the smlp repo on the
# requested branch, builds a wheel, and repairs it with delocate so all
# dylib dependencies are bundled (equivalent to auditwheel on Linux).
#
# Usage:
# ./build_macos.sh
#
# The finished wheel is left in ./dist/
# =============================================================================
set -euo pipefail

set -x

PYTHON_VERSION="3.11"

# ---------------------------------------------------------------------------
# 1. System packages via Homebrew
# ---------------------------------------------------------------------------
echo "[build] Installing Homebrew packages..."
if ! command -v brew &>/dev/null; then
echo "ERROR: Homebrew not found. Install it from https://brew.sh" >&2
exit 1
fi

CC="$(brew --prefix)/bin/gcc-15"
CXX="$(brew --prefix)/bin/g++-15"

brew install wget git make m4 pkg-config gmp

# ---------------------------------------------------------------------------
# 2. Python 3.11
# ---------------------------------------------------------------------------
echo "[build] Checking Python ${PYTHON_VERSION}..."
if ! command -v python3.11 &>/dev/null; then
echo "[build] Installing Python ${PYTHON_VERSION} via Homebrew..."
brew install python@3.11
fi

PYTHON="$(command -v python3.11)"
PIP="${PYTHON} -m pip"

echo "[build] Using Python: ${PYTHON}"
echo "[build] Python version: $(${PYTHON} --version)"

# ---------------------------------------------------------------------------
# 3. Python build tools
# ---------------------------------------------------------------------------
echo "[build] Installing Python build tools..."
${PIP} install --upgrade pip
${PIP} install "setuptools >= 71.1.0"
#${PIP} install meson ninja "z3-solver==4.8.12" delocate

${PIP} install meson ninja "z3-solver==4.16.0" delocate

# ---------------------------------------------------------------------------
# 4. Environment
# ---------------------------------------------------------------------------
# On macOS, Homebrew installs binaries into $(brew --prefix)/bin
BREW_PREFIX="$(brew --prefix)"
export PATH="${BREW_PREFIX}/bin:${HOME}/.local/bin:${PATH}"

# Point setup.py at the z3-solver installed for this Python
PY_SITE="$(${PYTHON} -c "import site; print(site.getsitepackages()[0])")"
export Z3_PREFIX="${PY_SITE}/z3"

# GMP is installed by Homebrew – reuse it so setup.py skips the source build
export GMP_ROOT="${BREW_PREFIX}/opt/gmp"

echo "[build] Z3_PREFIX=${Z3_PREFIX}"
echo "[build] GMP_ROOT=${GMP_ROOT}"

# DLD_PATH is a workaround of MacOS purging DYLD_LIBRARY_PATH when calling python processes

export DLD_PATH="${Z3_PREFIX}/lib"

echo "[DLD_PATH] $DLD_PATH"

# ---------------------------------------------------------------------------
# 5. Build wheel
# ---------------------------------------------------------------------------
echo "[build] Building wheel..."
${PYTHON} -m pip wheel . -w dist/

# ---------------------------------------------------------------------------
# 7. Repair wheel with delocate (macOS equivalent of auditwheel)
# ---------------------------------------------------------------------------
echo "[build] Repairing wheel with delocate..."


${PYTHON} repair_wheel.py dist/

#----- Fix libpython3.11.dylib path in the .so inside the whl into @rpath/libpython3.11.dylib

echo "[./repair_path.sh] Fixing path to libpython3.11.dylib in .so"
./repair_path.sh


#---------


echo ""
echo "======================================================"
echo " Build complete. Wheel is in: $PWD/dist/"
echo "======================================================"
Binary file not shown.
Binary file not shown.
71 changes: 0 additions & 71 deletions manylinux_2_28/repair_wheel.py

This file was deleted.

Loading