macOS compile modkit - v0.6.3#619
Open
SuhasSrinivasan wants to merge 17 commits into
Open
Conversation
…nt controls and usage examples
…ration and automatic setup in ~/.zprofile
…ersion mismatch warning
…c and the verbose echo line are gone; no trace remains.
MODKIT_MPS_SUPPORT added (default 0):
Documented in the file header, print_usage(), and the config section
Validated at the top of main() (rejects anything other than 0 or 1)
Controls all MPS-specific behaviour throughout
main() — resolve_python_toolchain, create_venv, install_pytorch are now inside if [[ "${MODKIT_MPS_SUPPORT}" == "1" ]]. The header summary only prints Python controls when MPS is enabled.
setup_environment_variables() — split into two branches:
MPS=1: full existing behaviour (LIBTORCH vars, venv activation, path verification), but without RAYON
MPS=0: generates a slim setup_modkit_env.sh that only exports PATH and no sourcing/libtorch verification happens
build_modkit() — uses --features accelerate,tch (MPS=1) or --features accelerate (MPS=0); step title, GPU Support field, and troubleshooting tips all reflect the active mode.
save_installation_info() — always writes paths/versions/quick-start; Python/PyTorch/venv fields and run examples only appended when MPS=1; Runtime Threading section removed.
macOS version check — the strict 12.3 requirement is now gated on MODKIT_MPS_SUPPORT=1, so users on earlier macOS can still do a no-MPS build.
There was a problem hiding this comment.
Pull request overview
Adds a macOS (Apple Silicon) install/compile path for modkit via a new automation script and accompanying documentation, aiming to make MPS (Metal) GPU-enabled builds opt-in.
Changes:
- Added
mac_compile_modkit.shto automate dependency installation, repo checkout, optional Python/PyTorch setup, and building modkit. - Added mdBook documentation page and nav entry describing macOS compilation and MPS/Python controls.
- Updated
README.mdto point users to the new macOS compilation path.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| README.md | Adds a macOS (Apple Silicon) section pointing to the new script and guide. |
| mac_compile_modkit.sh | New end-to-end macOS installer/compiler script with optional MPS/PyTorch support. |
| book/src/SUMMARY.md | Adds the new macOS compilation page to the mdBook navigation. |
| book/src/mac_compile_modkit.md | New documentation page explaining script usage, options, and troubleshooting. |
Comments suppressed due to low confidence (2)
mac_compile_modkit.sh:819
- Same issue as above: in a sourced script
$0refers to the parent shell, so the usage guidance is inaccurate. Prefer${BASH_SOURCE[0]}(or equivalent) for usage text in this generated script.
if [[ "${BASH_SOURCE[0]}" == "${0}" ]]; then
echo "Error: This script must be sourced, not executed."
echo "Usage: source ${0} <installation_directory> [--verbose]"
exit 1
book/src/mac_compile_modkit.md:150
- These MPS rebuild instructions use
cargo build --features accelerate,tchfrom the repo root, but the workspace root is a virtual manifest and themodkitpackage itself doesn't define these features. As written, this command will fail. Please update to the correct build invocation for this workspace that produces an MPS-enabled open-chromatin build.
source ~/tools/setup_modkit_env.sh ~/tools
cd ~/tools/modkit
cargo clean
cargo build --release --features accelerate,tch
</details>
---
💡 <a href="/nanoporetech/modkit/new/master?filename=.github/instructions/*.instructions.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add Copilot custom instructions</a> for smarter, more guided reviews. <a href="https://docs.github.com/en/copilot/customizing-copilot/adding-repository-custom-instructions-for-github-copilot" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn how to get started</a>.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MODKIT_MPS_SUPPORT=1 bash mac_compile_modkit.sh