Documentation

macOS Installation Guide

Complete guide for installing and running ManifoldScript on macOS, with optimizations for both Intel and Apple Silicon Macs.

System Requirements

Apple Silicon Macs

  • • macOS 13.0 Ventura or later
  • • M1, M2, or M3 series chip
  • • 8GB RAM (16GB recommended)
  • • 20GB free disk space
  • • Metal support (built-in)

Intel Macs

  • • macOS 12.0 Monterey or later
  • • Intel Core i5/i7/i9 (6th gen or newer)
  • • AMD Radeon Pro GPU or Intel Iris Pro
  • • 16GB RAM (32GB recommended)
  • • 30GB free disk space

Installation Methods

Method 1: Homebrew (Recommended)

bash
1# Install Homebrew if not already installed
2/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
3
4# Add Homebrew to PATH (Apple Silicon)
5echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zshrc
6eval "$(/opt/homebrew/bin/brew shellenv)"
7
8# Install ManifoldScript via Homebrew
9brew tap manifoldscript/tap
10brew install manifoldscript
11
12# Verify installation
13manifoldscript --version
14manifoldscript --check-system

Method 2: Direct Download

bash
1# Download the installer
2curl -O https://github.com/manifoldscript/manifoldscript/releases/latest/download/manifoldscript-macos.pkg
3
4# Install the package
5sudo installer -pkg manifoldscript-macos.pkg -target /
6
7# Add to PATH
8echo 'export PATH="/usr/local/manifoldscript/bin:$PATH"' >> ~/.zshrc
9source ~/.zshrc
10
11# Verify installation
12manifoldscript --version

Method 3: Build from Source

bash
1# Install Rust
2curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
3source ~/.cargo/env
4
5# Install Xcode Command Line Tools
6xcode-select --install
7
8# Clone repository
9git clone https://github.com/manifoldscript/manifoldscript.git
10cd manifoldscript
11
12# Build for Apple Silicon
13cargo build --release --target aarch64-apple-darwin --features metal
14
15# Build for Intel
16cargo build --release --target x86_64-apple-darwin --features metal
17
18# Install
19sudo cp target/aarch64-apple-darwin/release/manifoldscript /usr/local/bin/

Apple Silicon Configuration

Apple Silicon Optimization Flow

graph TB subgraph "Apple Silicon Architecture" A[P cores] --> B[Performance Cluster] C[E cores] --> D[Efficiency Cluster] B --> E[Unified Memory] D --> E E --> F[GPU] E --> G[Neural Engine] F --> H[Metal Framework] G --> H end subgraph "ManifoldScript Optimization" I[Compiler] --> J[ARM NEON] I --> K[Metal Shaders] I --> L[ANE Operations] J --> M[CPU Execution] K --> N[GPU Execution] L --> O[ML Acceleration] end H --> N classDef apple fill:#e3f2fd classDef manifold fill:#e8f5e9 class A,B,C,D,E,F,G,H apple class I,J,K,L,M,N,O manifold

Optimization Configuration

manifoldscript
1// Enable Apple Silicon optimizations
2@apple_silicon
3config {
4 use_neural_engine = true
5 unified_memory = true
6 arm_neon = true
7}
8
9// Neural Engine utilization
10@ane_accelerated
11function ml_inference() {
12 // Leverage 16-core Neural Engine
13}
14
15// Unified memory optimization
16@zero_copy
17function cpu_gpu_transfer() {
18 // No copy between CPU and GPU
19}
20
21// ARM NEON vectorization
22@neon_vectorized
23function vector_ops() {
24 // SIMD optimizations
25}

Intel Mac Configuration

Intel-specific Settings

bash
1# Enable Intel-specific optimizations
2export MANIFOLDSCRIPT_ARCH=x86_64
3export INTEL_METAL_FORCE_INLINE=1
4
5# Configure for discrete GPU
6export METAL_DEVICE_WRAPPER_TYPE=1
7
8# Set performance mode
9sudo pmset -a gpuswitch 2
10
11# Verify GPU selection
12system_profiler SPDisplaysDataType

Intel Optimization Code

manifoldscript
1// Intel optimizations
2@intel_optimized
3config {
4 avx2_instructions = true
5 gpu_prefer_discrete = true
6 cpu_threads = 8
7}
8
9// AVX2 vectorization
10@avx2_vectorized
11function avx_ops() {
12 // 256-bit SIMD operations
13}
14
15// Discrete GPU preference
16@force_discrete_gpu
17function gpu_intensive() {
18 // Use AMD Radeon Pro
19}
20
21// Multi-threading for Intel
22@parallel_threads(8)
23function parallel_compute() {
24 // Utilize all cores
25}

Development Environment Setup

VS Code Configuration

json
1{
2 "manifoldscript.languageServer": {
3 "path": "/usr/local/bin/manifoldscript-lsp",
4 "features": {
5 "completion": true,
6 "diagnostics": true,
7 "formatting": true
8 }
9 },
10 "editor.formatOnSave": true,
11 "editor.defaultFormatter": "manifoldscript.manifoldscript",
12 "[manifoldscript]": {
13 "editor.suggest.insertMode": "replace"
14 }
15}

Vim/Neovim Configuration

vim
1" Add to ~/.vimrc or init.vim
2autocmd BufNewFile,BufRead *.ms set filetype=manifoldscript
3
4" LSP configuration
5lua << EOF
6require'lspconfig'.manifoldscript.setup{
7 cmd = {"/usr/local/bin/manifoldscript-lsp"},
8 filetypes = {"manifoldscript"},
9 root_dir = require('lspconfig').util.root_pattern(".git"),
10}
11EOF
12
13" Syntax highlighting
14autocmd FileType manifoldscript set syntax=manifoldscript

Performance Monitoring

macOS Performance Tools

bash
1# Monitor GPU usage
2sudo powermetrics --samplers gpu_power -i 1000
3
4# Monitor CPU/GPU activity
5sudo powermetrics --samplers cpu_power,gpu_power -i 1000
6
7# Check thermal state
8sudo powermetrics --samplers thermal -i 1000
9
10# Monitor memory pressure
11vm_stat
12
13# ManifoldScript-specific monitoring
14manifoldscript monitor --system
15manifoldscript profile --output profile.json
16
17# Activity Monitor for GPU
18open -a "Activity Monitor"
19# View: Window > GPU History
60%
Performance gain on M-series
100GB/s
Unified memory bandwidth
15W
Typical power consumption

Troubleshooting

Installation Blocked by Gatekeeper

Error: “manifoldscript” cannot be opened because Apple cannot check it for malicious software

bash
1# Allow app from unidentified developer
2xattr -dr com.apple.quarantine /usr/local/bin/manifoldscript
3
4# Or allow via System Preferences
5# System Preferences > Security & Privacy > General
6# Click "Allow Anyway" next to the blocked app
7
8# For package installation
9sudo spctl --master-disable
10# Install, then re-enable
11sudo spctl --master-enable

Metal Not Available

Error: Metal framework not available

bash
1# Check Metal support
2system_profiler SPDisplaysDataType | grep Metal
3
4# Update macOS
5softwareupdate --all --install --force
6
7# Reset graphics framework
8sudo killall -KILL WindowServer
9
10# Check for Metal-compatible GPU
11system_profiler SPDisplaysDataType

Performance Issues on Intel Mac

Warning: Poor GPU performance detected

bash
1# Switch to discrete GPU
2sudo pmset -a gpuswitch 2
3
4# Check GPU status
5system_profiler SPDisplaysDataType
6
7# Reset GPU drivers
8sudo kextunload -b com.apple.driver.AMDRadeonX4000GLDriver
9sudo kextload -b com.apple.driver.AMDRadeonX4000GLDriver
10
11# Update graphics drivers
12softwareupdate --background