Add Windows build instructions.
authorJacques Pienaar <jpienaar@google.com>
Mon, 3 Jun 2019 18:09:02 +0000 (11:09 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Tue, 4 Jun 2019 02:26:37 +0000 (19:26 -0700)
PiperOrigin-RevId: 251269521

mlir/README.md

index a1d65a8..35fcc78 100644 (file)
@@ -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   <visual-studio-install>\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.