Add quick start docs for Linux.
Closes #95
COPYBARA_INTEGRATE_REVIEW=https://github.com/google/iree/pull/95 from stellaraccident:linux_quickstart f520988e861873f7ee948cc60311dcc403d9bc43
PiperOrigin-RevId: 276340891
diff --git a/.bazelrc b/.bazelrc
index f149cbb..b9b31b0 100644
--- a/.bazelrc
+++ b/.bazelrc
@@ -48,5 +48,5 @@
# The user.bazelrc file is not checked in but available for local mods.
# Always keep this at the end of the file so that user flags override.
-try-import user.bazelrc
+try-import %workspace%/user.bazelrc
diff --git a/README.md b/README.md
index 325239c..723aa50 100644
--- a/README.md
+++ b/README.md
@@ -7,13 +7,25 @@
## Table of Contents
+- [Quickstart](#quickstart)
- [Project Goals](#project-goals)
- [Milestones](#milestones)
- [Status](#status)
- [Dependencies](#dependencies)
-- [Quickstart](#quickstart)
- [License](#license)
+<a name="quickstart"></a>
+
+## Quickstart
+
+More Coming soon! Performing full model translation may require a few steps
+(such as ensuring you have a working TensorFlow build), however we'll have
+pre-translated example models that allow independent testing of the runtime
+portions.
+
+* [Getting Started on Windows](docs/getting_started_on_windows.md)
+* [Getting Started on Linux](docs/getting_started_on_linux.md)
+
<a name="project-goals"></a>
## Project Goals
@@ -156,12 +168,9 @@
### Build System and CI
-We are still working to port our build configuration to
-[Bazel](https://bazel.build/) and will be open sourcing the BUILD files and
-Starlark rules we use soon. We will also be maintaining a CMake build for
-integration with the dependent projects
-([Abseil](https://github.com/abseil/abseil-cpp) and
-[MLIR](https://github.com/tensorflow/mlir)).
+* We support Bazel for builds of all parts of the project.
+* We also maintain a CMake build for a subset of runtime components designed
+ to be used in other systems.
### Code and Style
@@ -232,17 +241,6 @@
[Swiftshader](https://github.com/google/swiftshader) is used to provide fast
hardware-independent testing of the Vulkan and SPIR-V portions of the toolchain.
-<a name="quickstart"></a>
-
-## Quickstart
-
-More Coming soon! Performing full model translation may require a few steps
-(such as ensuring you have a working TensorFlow build), however we'll have
-pre-translated example models that allow independent testing of the runtime
-portions.
-
-* [Getting Started on Windows](docs/getting_started_on_windows.md)
-
<a name="license"></a>
## License
diff --git a/docs/getting_started_on_linux.md b/docs/getting_started_on_linux.md
new file mode 100644
index 0000000..dbb9e95
--- /dev/null
+++ b/docs/getting_started_on_linux.md
@@ -0,0 +1,93 @@
+# Getting Started on Linux
+
+There are many Linux variants. This document provides project-specific
+requirements for setting up your environment and should be relatively
+translatable. It was written for a relatively recent, Debian-derived
+distribution. If you have issues on other systems, we accept issues or additions
+to the documentation.
+
+## Pre-requisites
+
+### Install Bazel >= 1.0
+
+*Optional if you will only be using the CMake build for runtime deps.*
+
+Follow the
+[install instructions](https://docs.bazel.build/versions/master/install-ubuntu.html)
+and verify with: `bazel --version`.
+
+### Install clang
+
+```
+sudo apt install clang
+```
+
+Verify version with `clang++ -v`. We have verified with the following versions:
+
+* 6.0.1
+
+### Install python, pip and dependencies
+
+Install python (note that if, on your distribution, python3 is the only option,
+you may be able to drop the "3").
+
+```
+sudo apt install python3 pip3
+```
+
+Verify python version with `python3 -V`. We have tested with >= 3.6. Some
+optional integrations (such as TensorFlow/Python may have more stringent
+requirements).
+
+Install packages:
+
+```
+sudo pip3 install numpy
+```
+
+## Building with Bazel
+
+We support both Bazel and CMake, however, the Bazel build covers more parts of
+the system (tests, integrations, bindings, etc) whereas (currently) CMake is
+maintained for the runtime components (which will be consumed by other
+projects). This section covers building with Bazel.
+
+### Environment variables
+
+The following environment variables must be set.
+
+```shell
+export CXX=clang++
+export CC=clang
+export PYTHON_BIN="$(which python3)"
+```
+
+### Optional: Setup user config aliases
+
+You can create a `user.bazelrc` in the repository root with extra bazel configs
+that may be useful. We usually have something like this (make sure to make
+replacements as needed):
+
+```
+build --disk_cache=/REPLACE/WITH/CACHE/DIR --experimental_guard_against_concurrent_changes
+build:debug --compilation_mode=dbg --copt=-O2 --per_file_copt=iree@-O0 --strip=never
+```
+
+### Build
+
+```shell
+# Run all tests (as of Oct-23-2019, all tests build but some still fail in the
+# OSS version).
+bazel test -k iree/... test/... bindings/python/...
+
+# Or build with optimizations disabled (just for IREE, not for deps) and
+# debug symbols retained. This assumes you have an alias like above setup):
+bazel test --config=debug bindings/python/...
+```
+
+In general, build artifacts will be under the `bazel-bin` directory at the top
+level.
+
+## Building with CMake
+
+TODO