Practical overview
When it fits
Use Mcl when a C++ project needs pairing-based cryptography and its target curve, compiler, processor instructions, and build environment align with the library's documented support.
Who it is for
- C++ developers implementing pairing-based cryptographic operations.
- Cryptographic software developers selecting support for BN curves or BLS12-381.
- Developers evaluating a portable library with documented builds across multiple operating systems and processor architectures.
Documented uses
- Add pairing-based cryptographic operations to a C++ application.
- Build cryptographic features that use BN curves or BLS12-381 pairings.
- Compile a static or shared Mcl library using the documented Makefile or CMake workflow.
Requirements & limits
The repository is public and identifies its license as BSD-3-Clause.
- The documented pairing support covers BN curves and BLS12-381; the README also lists BN254, BN_SNARK1, BN381_1, BN462, and BLS12_377.
- The default configuration supports up to 384 bits for Fp and 256 bits for Fr; larger curve parameters may require configuration changes and regeneration of low-level functions.
- Mcl v4 requires BMI2 and ADX instruction sets, while the README notes breaking changes in versions 3 and 4.
- Compiler requirements vary by platform, and some architecture targets have distinct toolchain instructions.
- GMP is needed only for building test programs; OpenMP is optional.
Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.
Build Mcl with Make on Linux or macOS
Compile Mcl and produce its documented static or shared library on x86-64 Linux or macOS.
Before you start
- A Linux or macOS development environment on x86-64.
- A C++ compiler; clang++ is required except for x86-64 Linux and Windows with MinGW.
- Git and Make.
Steps
Clone the Mcl repository and change into its directory.
Run the command below; where required, specify
CXX=clang++.make -j4Use the generated
lib/libmcl.astatic library orlib/libmcl.soshared library.
Expected outcome
A compiled Mcl library is produced in the repository's `lib` directory.
Guide limitations
- The documented Makefile commands cover x86-64 Linux and macOS; other targets have distinct instructions.
- GMP is required only to build test programs, and OpenMP is optional.
- Mcl v4 requires BMI2 and ADX instruction sets.
Build Mcl with CMake on Linux or macOS
Configure and compile Mcl using its documented CMake path.
Before you start
- A Linux or macOS development environment on x86-64.
- CMake and Make.
- A C++ compiler; clang++ is required except for x86-64 Linux and Windows with MinGW.
Steps
Create a
builddirectory in the Mcl repository and change into it.Run
cmake ...Run
maketo compile the project; where required, configure CMake with-DCMAKE_CXX_COMPILER=clang++.
Expected outcome
The project is configured and compiled through its documented CMake workflow.
Guide limitations
- The listed CMake commands specifically cover x86-64 Linux and macOS, with a separate compiler option noted for other platforms.
- Mcl v4 requires BMI2 and ADX instruction sets.
Sources & review
Source record details
- Source availability
- Active
- Sources checked
- 14 October 2026
- Original website title
- herumi/mcl · Official homepage title · retained in its source language

