From c014f5699f103ec06a2623cf573026c3d502eea1 Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Mon, 3 Jun 2019 11:09:02 -0700 Subject: [PATCH] Add Windows build instructions. PiperOrigin-RevId: 251269521 --- mlir/README.md | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/mlir/README.md b/mlir/README.md index a1d65a8..35fcc78 100644 --- a/mlir/README.md +++ b/mlir/README.md @@ -90,7 +90,7 @@ we aim to align on the same level of platform support as [LLVM](https://llvm.org/docs/GettingStarted.html#requirements). For now, MLIR has been tested on Linux and macOS, with recent versions of clang and with gcc 7. -``` +```sh git clone https://github.com/llvm/llvm-project.git git clone https://github.com/tensorflow/mlir llvm-project/llvm/projects/mlir mkdir llvm-project/build @@ -99,6 +99,20 @@ cmake -G Ninja ../llvm -DLLVM_BUILD_EXAMPLES=ON -DLLVM_ENABLE_CXX1Y=Y -DLLVM_TAR cmake --build . --target check-mlir ``` +To compile on Windows using Visual Studio 2017: + +```bat +REM In shell with Visual Studio environment set up, e.g., with command such as +REM \Auxiliary\Build\vcvarsall.bat" x64 +REM invoked. +git clone https://github.com/llvm/llvm-project.git +git clone https://github.com/tensorflow/mlir llvm-project\llvm\projects\mlir +mkdir llvm-project\build +cd llvm-project\build +cmake ..\llvm -G "Visual Studio 15 2017 Win64" -DLLVM_BUILD_EXAMPLES=ON -DLLVM_ENABLE_CXX1Y=Y -DLLVM_TARGETS_TO_BUILD="host" -DCMAKE_BUILD_TYPE=Release -Thost=x64 +cmake --build . --target check-mlir +``` + As a starter, you may try [the tutorial](g3doc/Tutorials/Toy/Ch-1.md) on building a compiler for a Toy language. -- 2.7.4