Files
MX_Pmodule/qfit/build
T
2026-09-01 11:11:03 +02:00

34 lines
1.3 KiB
Python
Executable File

#!/usr/bin/env modbuild
# qFit (multiconformer model building), uv route from the sha-pinned GitHub
# tarball. Three upstream traps handled here:
# - use_scm_version needs git metadata the tarball lacks -> SETUPTOOLS_SCM_PRETEND_VERSION
# - numpy pinned <1.22 -> newest CPython with wheels is 3.10
# - MIQP solvers (cvxopt, cplex) are only in environment.yml, not
# install_requires -> pip them explicitly or qfit dies at runtime
pbuild::configure() {
# modbuild's shell strips ~/.local/bin from PATH; override with UV=/path/to/uv if needed
UV="${UV:-$HOME/.local/bin/uv}"
export UV_CACHE_DIR="/opt/psi/MX/.uv-cache"
export UV_PYTHON_INSTALL_DIR="$PREFIX/python"
"$UV" venv --python 3.10 "$PREFIX/venv" || std::die 42 "uv venv failed - is uv at \$UV?"
}
pbuild::compile() {
:
}
pbuild::install() {
UV="${UV:-$HOME/.local/bin/uv}"
export UV_CACHE_DIR="/opt/psi/MX/.uv-cache"
export CC=gcc
export SETUPTOOLS_SCM_PRETEND_VERSION="${V_PKG}"
# cplex is the IBM Community Edition pip wheel (problem-size limited);
# full CPLEX needs an academic license, see README
"$UV" pip install --python "$PREFIX/venv/bin/python" \
cvxopt cplex "$SRC_DIR" || \
std::die 42 "qfit install failed - check build log above"
[[ -x "$PREFIX/venv/bin/qfit_protein" ]] || std::die 42 "qfit_protein missing from venv"
}