Mac compile script based on v0.6.2#613
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds a macOS-focused installation path for building modkit from source with the tch/PyTorch-backed open-chromatin stack, plus companion documentation in the mdBook docs. It fits into the existing repository by extending the current build-note/docs story with a scripted Apple/macOS workflow.
Changes:
- Adds a new
mac_compile_modkit.shinstaller that sets up toolchains, clones the repo, prepares Python/PyTorch, and buildsmodkit. - Adds configurable Python selection via system Python,
pyenv, oruv. - Adds a new mdBook page describing the macOS installation workflow and troubleshooting steps.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 12 comments.
| File | Description |
|---|---|
mac_compile_modkit.sh |
New end-to-end macOS build/install script for compiling modkit with PyTorch/libtorch-based support. |
book/src/mac_compile_modkit.md |
New user-facing documentation for the macOS installation workflow and common troubleshooting steps. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ration and automatic setup in ~/.zprofile
|
Tested on Sunday, May 3, 2026 at 7:30PM PDT Versioning issue noted in #614 |
…ersion mismatch warning
|
|
||
| ### macOS (Apple Silicon) | ||
|
|
||
| A script is provided to compile modkit on Apple Silicon Macs with Metal GPU (MPS) acceleration. |
There was a problem hiding this comment.
Could you change this to say that these steps (installing pytorch, having a python provider, etc) are only required if you want to use the open-chromatin model in Modkit? For all of the other functionality I don't think the user needs to worry about python at all.
| bash mac_compile_modkit.sh ~/tools | ||
| ``` | ||
|
|
||
| Installs the latest modkit to `~/tools` using system Python. Takes 10–15 minutes. |
There was a problem hiding this comment.
Could you mention that python isn't really used by Modkit and that it's only required to get the correct version of torchlib on the Mac machine? It's up to you, but you may consider having a toggle in the script that makes a "no features" version of Modkit and skips the python parts all together.
|
Hello @SuhasSrinivasan, I really appreciate this contribution. My only concern is that a new user to Modkit may read this and think that they need python and pytorch to use Modkit at all. You and I both know this isn't true and that the only subcommand which optionally uses torchlib is Basically, it's entirely a matter of appearance, I'd like the "compile from source" for any OS to still be the same basic two steps: (1) install cargo, (2) use cargo to compile Modkit. I appreciate that your script will build an optimized version of Modkit, but I think it's just a little more advanced than what is absolutely necessary to get started. I mentioned this in the comments, and it's up to you, but you may consider making the |
| # Prerequisites: Apple Silicon Mac running macOS 12.3 or later | ||
| # | ||
| # What this script does: | ||
| # 0. Installs Xcode Command Line Tools |
There was a problem hiding this comment.
I don't think that git comes installed on a "fresh" Mac, so maybe this step isn't necessary? I appreciate that this script is supposed to be a "dot-slash" style script that handles everything but what is the user story around getting to the start line here? Does someone clone the repo from GitHub by downloading the source, wget-ting the script? Maybe add those details to the documentation you've added (👍 on that by the way).
| To override for a single run: | ||
|
|
||
| ```bash | ||
| RAYON_NUM_THREADS=8 modkit pileup input.bam output.bed |
There was a problem hiding this comment.
As of Modkit v0.6.2 rayon isn't used in pileup at all but I suppose this doesn't hurt anything. Could you add a comment that you should still use the --threads argument?
book/srcuvandpyenvthrough config