lean2/doc/make/msys2.md
2014-10-06 15:13:24 -07:00

1.8 KiB

Lean for Windows

A native Lean binary for Windows can be generated using msys2. It is easy to install all dependencies, it produces native 64/32-binaries, and supports a C++11 compiler.

Installing dependencies

The official webpage provides one-click installers. We assume that you install msys2 at c:\msys64. Once installed it, you can run msys2 shell from the start menu. It has a package management system, pacman, which is used in Arch Linux.

Here are the commands to install all dependencies needed to compile Lean on your machine.

# Install gcc (4.9.1)
pacman -S mingw-w64-x86_64-gcc

# Install mpfr, gmp, lua
pacman -S mingw-w64-x86_64-mpfr mingw-w64-x86_64-gmp mingw-w64-x86_64-lua

# Install python, ninja, cmake
pacman -S mingw-w64-x86_64-python2 mingw-w64-x86_64-ninja mingw-w64-x86_64-cmake

# Install git
pacman -S git

Close the msys2 shell and add c:\msys64\mingw64\bin into the PATH environment variable.

  • Windows 7/8: Control Panel > System and Security > System > Advanced System Settings > Environment Variables... > Edit User variable Path

Build Lean

In the msys2 shell, execute the following commands.

cd /c/
git clone https://github.com/leanprover/lean
cd lean
mkdir build && cd build
cmake -D CMAKE_CXX_COMPILER=g++.exe -G Ninja ../src
ninja

Build Lean using Boost

To install Boost in the msys2 shell, use the following command:

pacman -S mingw-w64-x86_64-boost

In the msys2 shell, execute the following commands.

cd /c/
git clone https://github.com/leanprover/lean
cd lean
mkdir build && cd build
cmake -D CMAKE_CXX_COMPILER=g++.exe -D BOOST=ON -G Ninja ../src
ninja