Skip to main content
7-Zip can be compiled from source for Windows, Linux, and macOS platforms. The build process varies depending on your target platform and compiler.

Source Structure

The 7-Zip source package is organized as follows:
  • DOC/ - Documentation files including readme.txt, license information
  • Asm/ - Assembler source code for optimized CRC, SHA, AES, and LZMA decoding
  • C/ - C source code
  • CPP/ - C++ source code
    • Common/ - Common modules
    • Windows/ - Windows-specific code
    • 7zip/ - Core 7-Zip modules
      • Archive/ - Archive format handlers
      • Bundles/ - Standalone binaries (Alone, Alone2, Format7z, etc.)
      • Compress/ - Compression/decompression codecs
      • Crypto/ - Encryption/decryption modules
      • UI/ - User interfaces (Console, GUI, FileManager)

Build Targets

The main build targets available in the Bundles directory:
TargetOutputDescription
Alone7za.exe / 7zaStandalone console version (7z/xz/cab/zip/gzip/bzip2/tar only)
Alone27zz.exe / 7zzStandalone console version (all formats)
Alone7z7zr.exe / 7zrStandalone console version (7z only, reduced)
Format7zF7z.dll / 7z.soAll formats as shared library
Console7z.exeConsole version (requires DLLs)
FileManager7zFM.exeFile Manager GUI (Windows)

Platform-Specific Guides

Select your platform to view detailed build instructions:

Windows

Build with Visual Studio or MSVC compiler

Linux

Build with GCC or Clang compiler

macOS

Build for Apple Silicon and Intel Macs

License Considerations

7-Zip is distributed under the GNU LGPL license, with the following exceptions:
  • unRAR code - Has additional license restrictions (see below)
  • Some code - Licensed under BSD 3-clause License

RAR Support Options

When building, you can control RAR support:
DISABLE_RAR=1 - Removes all RAR-related code from compilationDISABLE_RAR_COMPRESS=1 - Removes RAR decompression codecs while keeping the ability to list RAR archives and extract stored (uncompressed) files
RAR decompression codecs have license restrictions that may not be fully compatible with free-software licenses. The unRAR license allows:
  • Compiling and using under GNU LGPL rules
  • Fixing bugs in source code
  • Prohibits using sources to re-create the RAR compression algorithm

Build Methods

There are two primary approaches to building 7-Zip: Makefile builds provide the best optimization options and are used for all official releases.
  • Windows: Use nmake with Visual Studio compiler
  • Linux/macOS: Use make with GCC or Clang

2. IDE/Project Files (Development)

Project files (.dsp for Visual Studio) are available for development and debugging purposes.
All final 7-Zip binaries are compiled via makefiles to ensure optimal performance.

Assembler Support

7-Zip contains optimized assembler code for better performance:

x86/x64 Platforms

Windows: Requires Microsoft Macro Assembler (ml.exe for x86, ml64.exe for x64) Linux: Requires one of:

ARM64 Platform

Uses GNU assembler syntax with preprocessor, supported by both GCC and Clang.
JWasm doesn’t support some CPU instructions used in 7-Zip. Use Asmc or UASM for x86/x64 builds on Linux.

Compiler Requirements

Windows

  • Visual Studio 2017/2019/2022 (for x86, x64, arm64, arm)
  • Visual C++ 6.0 with Platform SDK (for legacy x86)
  • Windows SDK for macro assembler (ml.exe, ml64.exe)

Linux/Unix

  • GCC 4.8+ (GCC 9+ recommended for all warning flags)
  • Clang (modern version)
  • Optional: Asmc or UASM for assembler optimizations

macOS

  • Clang (from Xcode Command Line Tools)
  • Support for both Intel (x64) and Apple Silicon (arm64)

Next Steps

Choose your platform to continue:

Build docs developers (and LLMs) love