Skip to content

Commit e45bd02

Browse files
committed
quick start
1 parent d659884 commit e45bd02

File tree

2 files changed

+190
-8
lines changed

2 files changed

+190
-8
lines changed

.github/workflows/homebrew.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,15 +52,17 @@ jobs:
5252
5353
echo "Installing MFC from local tap..."
5454
# Note: brew may exit with code 1 due to dylib fixup warnings on some Python packages (non-fatal)
55-
# We check for successful installation (🍺 symbol) rather than just exit code
55+
# We verify installation using brew commands rather than parsing log output
5656
set +e # Don't fail immediately on error
5757
brew install --build-from-source --verbose mflowcode/test/mfc 2>&1 | tee /tmp/brew-install.log
5858
brew_exit_code=$?
5959
set -e
6060
61-
# Check if the formula actually installed successfully
62-
if grep -q "🍺.*mfc.*built in" /tmp/brew-install.log; then
61+
# Verify installation using brew list (more robust than log parsing)
62+
if brew list mflowcode/test/mfc &>/dev/null; then
6363
echo "✅ MFC installed successfully (ignoring dylib relocation warnings)"
64+
# Optionally verify with brew info
65+
brew info mflowcode/test/mfc
6466
exit 0
6567
else
6668
echo "❌ MFC installation failed"

packaging/homebrew/HOMEBREW.md

Lines changed: 185 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,101 @@ This document describes the Homebrew formula for installing MFC on macOS systems
66

77
The Homebrew formula enables one-command installation of MFC on macOS (both Intel and Apple Silicon). The formula handles all dependencies, builds the three main MFC binaries, and installs them in a standard Homebrew location.
88

9+
## Quick Start Guide
10+
11+
### Prerequisites
12+
13+
- macOS 11 (Big Sur) or later
14+
- [Homebrew](https://brew.sh/) installed on your system
15+
- Internet connection for downloading dependencies
16+
17+
### Installation
18+
19+
The installation method depends on how the formula is distributed:
20+
21+
#### Option 1: Official Homebrew Repository (Future)
22+
23+
Once the formula is accepted into `homebrew-core`, install with:
24+
25+
```bash
26+
brew install mfc
27+
```
28+
29+
#### Option 2: Third-Party Tap
30+
31+
If the formula is available in a tap repository:
32+
33+
```bash
34+
# Add the tap
35+
brew tap MFlowCode/mfc
36+
37+
# Install MFC
38+
brew install MFlowCode/mfc/mfc
39+
```
40+
41+
#### Option 3: Install from Local Formula File
42+
43+
If you have the formula file locally (e.g., from cloning the MFC repository):
44+
45+
```bash
46+
# Install directly from the formula file
47+
brew install --build-from-source /path/to/MFC/packaging/homebrew/mfc.rb
48+
```
49+
50+
Or create a local tap:
51+
52+
```bash
53+
# Create a local tap
54+
brew tap-new MFlowCode/local
55+
56+
# Copy the formula to the tap
57+
cp packaging/homebrew/mfc.rb $(brew --repository)/Library/Taps/MFlowCode/homebrew-local/Formula/mfc.rb
58+
59+
# Install from the local tap
60+
brew install MFlowCode/local/mfc
61+
```
62+
63+
#### Option 4: Install from GitHub Repository
64+
65+
If the formula is in a GitHub repository:
66+
67+
```bash
68+
brew install MFlowCode/MFC/packaging/homebrew/mfc.rb
69+
```
70+
71+
### Verification
72+
73+
After installation, verify that MFC is installed correctly:
74+
75+
```bash
76+
# Check that the mfc command is available
77+
mfc --help
78+
79+
# Verify binaries are installed
80+
which pre_process simulation post_process
81+
82+
# Run Homebrew's built-in tests
83+
brew test mfc
84+
```
85+
86+
### Basic Usage
87+
88+
Once installed, you can start using MFC immediately:
89+
90+
```bash
91+
# Get help
92+
mfc --help
93+
94+
# Copy an example case to your working directory
95+
cp $(brew --prefix mfc)/examples/1D_sodshocktube/case.py .
96+
97+
# Run a simulation case
98+
mfc run case.py
99+
100+
# Or run directly from the installed examples
101+
mfc run $(brew --prefix mfc)/examples/1D_sodshocktube/case.py
102+
```
103+
9104
## What Gets Installed
10105

11106
When users run `brew install mfc`, they get:
@@ -141,29 +236,114 @@ After installation completes, Homebrew displays usage information including:
141236

142237
## Usage Examples
143238

144-
Once installed, users can immediately start using MFC:
239+
Once installed, users can immediately start using MFC. Here are common usage patterns:
240+
241+
### Running Example Cases
145242

146243
```bash
244+
# List available examples
245+
ls $(brew --prefix mfc)/examples
246+
147247
# Copy an example case to your working directory
148248
cp $(brew --prefix mfc)/examples/1D_sodshocktube/case.py .
149249

150-
# Run a test case
250+
# Run a test case (recommended: copy to working directory first)
151251
mfc run case.py
152252

153253
# Or run directly from the installed examples directory
154254
mfc run $(brew --prefix mfc)/examples/1D_sodshocktube/case.py
155255

156-
# Run just preprocessing
256+
# Run with specific number of processors
257+
mfc run case.py -j 4
258+
```
259+
260+
### Using Individual Binaries
261+
262+
You can also use the binaries directly:
263+
264+
```bash
265+
# Run preprocessing step
157266
pre_process -i input.dat
158267

159268
# Run simulation
160269
simulation -i input.dat
161270

162-
# Post-process results
271+
# Run post-processing
163272
post_process -i input.dat
273+
274+
# Check binary versions
275+
pre_process --version
276+
simulation --version
277+
post_process --version
278+
```
279+
280+
### Common MFC Commands
281+
282+
```bash
283+
# Get help
284+
mfc --help
285+
286+
# Build MFC (if you have source code)
287+
mfc build
288+
289+
# Run tests
290+
mfc test
291+
292+
# Clean build artifacts
293+
mfc clean
294+
295+
# Check system requirements
296+
mfc syscheck
297+
```
298+
299+
### Working with Your Own Cases
300+
301+
```bash
302+
# Create a new case directory
303+
mkdir my_case
304+
cd my_case
305+
306+
# Create your case.py file (see MFC documentation for format)
307+
# Then run it
308+
mfc run case.py
309+
310+
# Run with custom parameters
311+
mfc run case.py --param value
312+
```
313+
314+
### Finding Installed Files
315+
316+
```bash
317+
# Get the installation prefix
318+
brew --prefix mfc
319+
320+
# Find examples
321+
ls $(brew --prefix mfc)/examples
322+
323+
# Find toolchain
324+
ls $(brew --prefix mfc)/toolchain
325+
326+
# Check installed version
327+
brew info mfc
328+
```
329+
330+
### Troubleshooting
331+
332+
```bash
333+
# Verify installation
334+
brew list mfc
335+
336+
# Check for issues
337+
brew doctor
338+
339+
# Reinstall if needed
340+
brew reinstall mfc
341+
342+
# View installation logs
343+
brew install --verbose mfc
164344
```
165345

166-
Note: The `brew --prefix mfc` command returns the "opt" symlink location (e.g., `/usr/local/opt/mfc` or `/opt/homebrew/opt/mfc`), not the actual versioned Cellar path. The "opt" directory points to the currently active version in the Cellar, making examples work on both Intel and Apple Silicon systems. If you need the actual versioned installation path, look in the Cellar directory (e.g., `/usr/local/Cellar/mfc/VERSION`).
346+
**Note**: The `brew --prefix mfc` command returns the "opt" symlink location (e.g., `/usr/local/opt/mfc` or `/opt/homebrew/opt/mfc`), not the actual versioned Cellar path. The "opt" directory points to the currently active version in the Cellar, making examples work on both Intel and Apple Silicon systems. If you need the actual versioned installation path, look in the Cellar directory (e.g., `/usr/local/Cellar/mfc/VERSION`).
167347

168348
## Distribution
169349

0 commit comments

Comments
 (0)