Skip to content

Commit 9ade107

Browse files
committed
Add Homebrew installation and usage documentation
- Add Homebrew quick start section to getting-started.md - Add Homebrew usage section to running.md - Update README with Homebrew option in Try MFC table - Add macOS Homebrew quick start section to README - Clarify that -n X sets the number of MPI processes
1 parent c73b091 commit 9ade107

File tree

3 files changed

+54
-1
lines changed

3 files changed

+54
-1
lines changed

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ MFC runs at exascale on the world's fastest supercomputers:
6060
| Path | Command |
6161
| --- | --- |
6262
| **Codespaces** (fastest) | Click the "Codespaces" badge above to launch in 1 click |
63+
| **Homebrew (macOS)** | `brew install mflowcode/mfc/mfc && mfc run $(brew --prefix mfc)/examples/1D_sodshocktube/case.py -n 2` |
6364
| **Local build** | `./mfc.sh build -j $(nproc) && ./mfc.sh test -j $(nproc)` |
6465

6566
**Welcome!**
@@ -136,7 +137,23 @@ Click <kbd> <> Code</kbd> (green button at top right) → <kbd>Codespaces</kbd>
136137
137138
You can navigate [to this webpage](https://mflowcode.github.io/documentation/md_getting-started.html) to get you get started using MFC on your local machine, cluster, or supercomputer!
138139
It's rather straightforward.
139-
We'll give a brief introdocution for MacOS below.
140+
141+
### macOS quick start (Homebrew)
142+
143+
Install the prebuilt package and run an example:
144+
145+
```bash
146+
brew install mflowcode/mfc/mfc
147+
mkdir -p ~/mfc_quickstart && cd ~/mfc_quickstart
148+
cp $(brew --prefix mfc)/examples/1D_sodshocktube/case.py .
149+
mfc run case.py -n 2
150+
```
151+
152+
Use `-n X` to select the number of MPI processes. For developer commands (`build`, `test`, etc.), clone the repo and use `./mfc.sh`.
153+
154+
### macOS from source
155+
156+
We'll give a brief introduction for building from source on MacOS below.
140157
Using [brew](https://brew.sh), install MFC's dependencies:
141158
```shell
142159
brew install coreutils python cmake fftw hdf5 gcc boost open-mpi lapack

docs/documentation/getting-started.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,28 @@ git clone https://github.com/MFlowCode/MFC.git
99
cd MFC
1010
```
1111

12+
## Install via Homebrew (macOS)
13+
14+
On macOS, install prebuilt MFC via Homebrew:
15+
16+
```bash
17+
brew install mflowcode/mfc/mfc
18+
```
19+
20+
Run a quick example:
21+
22+
```bash
23+
mkdir -p ~/mfc_quickstart && cd ~/mfc_quickstart
24+
cp $(brew --prefix mfc)/examples/1D_sodshocktube/case.py .
25+
# Use -n X to choose the number of MPI processes
26+
mfc run case.py -n 2
27+
```
28+
29+
Notes:
30+
- The Homebrew wrapper supports only `mfc run ...`. Developer commands like `build`, `test`, `clean` are available when you clone the repo and use `./mfc.sh`.
31+
- The package bundles a Python venv and prebuilt binaries; no additional setup is required.
32+
- Examples are installed at `$(brew --prefix mfc)/examples/`.
33+
1234
## Build Environment
1335

1436
MFC can be built in multiple ways on various operating systems.

docs/documentation/running.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,20 @@ A full (and up-to-date) list of available arguments can be acquired with `./mfc.
88
MFC supports running simulations locally (Linux, MacOS, and Windows) as well as
99
several supercomputer clusters, both interactively and through batch submission.
1010

11+
## Using the Homebrew package (macOS)
12+
13+
If you installed MFC via Homebrew, run cases with the `mfc` wrapper:
14+
15+
```bash
16+
mfc run <path/to/case.py> -n 2
17+
```
18+
19+
- Use `-n X` to control the number of MPI processes (ranks).
20+
- Only the `run` command is supported in the Homebrew wrapper.
21+
- To use developer commands (`build`, `test`, `clean`, etc.), clone the repository and use `./mfc.sh`.
22+
- The wrapper passes through runtime flags like `-t pre_process simulation`, `-n`, and others; it always runs with preinstalled binaries.
23+
- Examples live at `$(brew --prefix mfc)/examples/`.
24+
1125
> [!IMPORTANT]
1226
> Running simulations locally should work out of the box. On supported clusters,
1327
> you can append `-c <computer name>` on the command line to instruct the MFC toolchain

0 commit comments

Comments
 (0)