Skip to main content
7-Zip can be compiled on macOS for both Intel (x64) and Apple Silicon (arm64) platforms using Clang.

Requirements

Xcode Command Line Tools

Install the Xcode Command Line Tools to get the Clang compiler and build tools:
Verify installation:
You don’t need the full Xcode IDE - just the Command Line Tools are sufficient.

Quick Start

1

Navigate to Source Directory

2

Build for Your Architecture

3

Run the Binary

Build Configurations

Apple Silicon (ARM64)

The ARM64 build includes assembler optimizations:
Configuration (from var_mac_arm64.mak):
Output: b/m_arm64/7zz

Intel x64

Configuration (from var_mac_x64.mak):
Output: b/m_x64/7zz

Architecture-Specific Details

Apple Silicon Optimizations

Apple Silicon builds use ARM64 assembler for performance:
Assembler Features:
  • Uses GNU assembler syntax with preprocessor
  • Supported natively by Clang for ARM64
  • Includes optimizations for LZMA decoding
  • Hardware-accelerated cryptography where available
The assembler code is located in:

Architecture Variants

You can customize the ARM64 architecture flags in var_mac_arm64.mak:
The default configuration uses -arch arm64 which is compatible with all Apple Silicon processors.

Build All Targets

Navigate to the main makefile directory and build everything:
This builds all UI and Bundle targets.

Specific Build Targets

7zz (All Formats)

7za (Limited Formats)

7zr (7z Format Only)

Shared Library

Output: 7z.dylib

Using makefile.gcc

You can also use the generic makefile.gcc for macOS:
This auto-detects the platform but may not use optimal flags.

Compiler Flags

macOS builds use Clang-specific warning flags (from warn_clang_mac.mak):
Optimization level: -O2

Universal Binaries

To create a universal binary (both Intel and ARM64):
1

Build for ARM64

2

Build for x64

3

Combine with lipo

4

Verify

RAR Support Options

Control RAR support at build time:

Disable All RAR Support

Disable RAR Decompression Only

RAR decompression codecs have license restrictions. Use DISABLE_RAR_COMPRESS=1 to build a version that can list RAR archives but not decompress them.

Output Directories

macOS builds output to platform-specific directories:
  • b/m_arm64/ - Apple Silicon builds
  • b/m_x64/ - Intel builds
  • _o/ - Default makefile.gcc builds

Installation

Install the built binary system-wide:
Verify:

Troubleshooting

You need to install Xcode Command Line Tools:
On macOS, pthread is part of the system libraries. Ensure you’re using the macOS-specific makefiles:
Make sure you’re using the correct makefile for your Mac:
  • Apple Silicon: cmpl_mac_arm64.mak
  • Intel: cmpl_mac_x64.mak
Check your architecture:
If building shared libraries, ensure they’re in a location where dyld can find them:

Performance Testing

Benchmark your build:
This runs the built-in benchmark to test compression/decompression performance.

Differences from p7zip

7-Zip for macOS is the official port from Igor Pavlov, distinct from the older p7zip project:
7-Zip for macOS (this build):
  • Current version (26.00 in this source)
  • Up-to-date with Windows version
  • Official support from 7-Zip developer
p7zip (legacy):
  • Last version: 16.02 (outdated)
  • Independent community port
  • No longer actively maintained

Next Steps

  • Test archive operations: ./b/m_arm64/7zz --help
  • Create archives: ./b/m_arm64/7zz a archive.7z files/
  • Extract archives: ./b/m_arm64/7zz x archive.7z

See Also