Skip to content

Commit

Permalink
[build] Make XLS build capable of aarch64 by upgrading some deps.
Browse files Browse the repository at this point in the history
Also try to make the README console session syntax highlight properly in
GitHub's syntax highlighting solution (highlight.js I think) by putting prompts
on each line that's not "output", including comment lines.

PiperOrigin-RevId: 357272823
  • Loading branch information
cdleary authored and copybara-github committed Feb 12, 2021
1 parent ae79567 commit 840b5d5
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 33 deletions.
21 changes: 11 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,21 @@ Note that we start by assuming [Bazel has been
installed](https://docs.bazel.build/versions/master/install-ubuntu.html).

```console
# Follow the bazel install instructions:
# https://docs.bazel.build/versions/master/install-ubuntu.html
#
# Afterwards we observe:
~$ git clone https://github.com/google/xls.git
~$ cd xls

$ bazel --version
~/xls$ # Follow the bazel install instructions:
~/xls$ # https://docs.bazel.build/versions/master/install-ubuntu.html
~/xls$ # Afterwards we observe:
~/xls$ bazel --version
bazel 4.0.0

# Note we're going to tell Ubuntu that `/usr/bin/env python` is actually python3
# here, since that is not the case by default on Ubuntu 20.04.
$ sudo apt install python3-distutils python3-dev libtinfo5 python3-is-python
~/xls$ # Note we're going to tell Ubuntu that `/usr/bin/env python` is actually python3
~/xls$ # here, since that is not the case by default on Ubuntu 20.04.
~/xls$ sudo apt install python3-distutils python3-dev libtinfo5 python3-is-python

# Now build/test everything in optimized build mode.
$ bazel test -c opt ...
~/xls$ # Now build/test everything in optimized build mode.
~/xls$ bazel test -c opt ...
```

A reference build/test environment setup is also provided via `Dockerfile`:
Expand Down
9 changes: 3 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "com_grail_bazel_toolchain",
urls = [
"https://github.com/grailbio/bazel-toolchain/archive/f4c17a3ae40f927ff62cc0fb8fe22b1530871807.zip",
"https://github.com/grailbio/bazel-toolchain/archive/f2d1ba2c9d713b2aa6e7063f6d11dd3d64aa402a.zip",
],
strip_prefix = "bazel-toolchain-f4c17a3ae40f927ff62cc0fb8fe22b1530871807",
sha256 = "715fd98d566ed1304cb53e0c640427cf0916ec6db89588e3ac2b6a87632276d4",
strip_prefix = "bazel-toolchain-f2d1ba2c9d713b2aa6e7063f6d11dd3d64aa402a",
sha256 = "0246482b21a04667825c655d3b4f8f796d842817b2e11f536bbfed5673cbfd97",
patches = ["//dependency_support/com_grail_bazel_toolchain:google_workstation_workaround.patch"],
)
load("@com_grail_bazel_toolchain//toolchain:deps.bzl", "bazel_toolchain_dependencies")
Expand Down Expand Up @@ -39,6 +39,3 @@ initialize_external_repositories()
# the call to pip_install fails.
load("@com_github_grpc_grpc//bazel:grpc_extra_deps.bzl", "grpc_extra_deps")
grpc_extra_deps()

load("@xls_pip_deps//:requirements.bzl", "pip_install")
pip_install()
4 changes: 2 additions & 2 deletions dependency_support/initialize_external.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
load("@com_google_protobuf//:protobuf_deps.bzl", "protobuf_deps")
load("@pybind11_bazel//:python_configure.bzl", "python_configure")
load("@io_bazel_rules_closure//closure:repositories.bzl", "rules_closure_dependencies", "rules_closure_toolchains")
load("@rules_python//python:pip.bzl", "pip_import")
load("@rules_python//python:pip.bzl", "pip_install")
load("//dependency_support/boost:initialize.bzl", initialize_boost = "initialize")

def initialize_external_repositories():
Expand All @@ -28,7 +28,7 @@ def initialize_external_repositories():
python_configure(name = "local_config_python")
rules_closure_dependencies()
rules_closure_toolchains()
pip_import(
pip_install(
name = "xls_pip_deps",
requirements = "//dependency_support:pip_requirements.txt",
python_interpreter = "python3",
Expand Down
5 changes: 2 additions & 3 deletions dependency_support/load_external.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,8 @@ def load_external_repositories():

http_archive(
name = "rules_python",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.0.2/rules_python-0.0.2.tar.gz",
strip_prefix = "rules_python-0.0.2",
sha256 = "b5668cde8bb6e3515057ef465a35ad712214962f0b3a314e551204266c7be90c",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.1.0/rules_python-0.1.0.tar.gz",
sha256 = "b6d46438523a3ec0f3cead544190ee13223a52f6a6765a29eae7b7cc24cc83a0",
)

http_archive(
Expand Down
4 changes: 2 additions & 2 deletions dependency_support/pip_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ Jinja2==2.11.2
werkzeug==1.0.1
itsdangerous==1.1.0
click==7.1.2
numpy==1.18.4
numpy==1.20.0
markupsafe==1.1.1
scipy==1.5.0
scipy==1.6.0
termcolor==1.1.0
psutil==5.7.0
portpicker==1.3.1
Expand Down
21 changes: 11 additions & 10 deletions docs_src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,21 @@ Note that we start by assuming [Bazel has been
installed](https://docs.bazel.build/versions/master/install-ubuntu.html).

```console
# Follow the bazel install instructions:
# https://docs.bazel.build/versions/master/install-ubuntu.html
#
# Afterwards we observe:
~$ git clone https://github.com/google/xls.git
~$ cd xls

$ bazel --version
~/xls$ # Follow the bazel install instructions:
~/xls$ # https://docs.bazel.build/versions/master/install-ubuntu.html
~/xls$ # Afterwards we observe:
~/xls$ bazel --version
bazel 4.0.0

# Note we're going to tell Ubuntu that `/usr/bin/env python` is actually python3
# here, since that is not the case by default on Ubuntu 20.04.
$ sudo apt install python3-distutils python3-dev libtinfo5 python3-is-python
~/xls$ # Note we're going to tell Ubuntu that `/usr/bin/env python` is actually python3
~/xls$ # here, since that is not the case by default on Ubuntu 20.04.
~/xls$ sudo apt install python3-distutils python3-dev libtinfo5 python3-is-python

# Now build/test everything in optimized build mode.
$ bazel test -c opt ...
~/xls$ # Now build/test everything in optimized build mode.
~/xls$ bazel test -c opt ...
```

A reference build/test environment setup is also provided via `Dockerfile`:
Expand Down
4 changes: 4 additions & 0 deletions xls/jit/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ cc_library(
"//xls/ir:value",
"//xls/ir:value_helpers",
"//xls/ir:value_view",
"@llvm//:AArch64AsmParser", # build_cleaner: keep
"@llvm//:AArch64CodeGen", # build_cleaner: keep
"@llvm//:Analysis",
"@llvm//:Core",
"@llvm//:ExecutionEngine",
Expand Down Expand Up @@ -178,6 +180,8 @@ cc_library(
"//xls/ir:ir_parser",
"//xls/ir:type",
"//xls/ir:value",
"@llvm//:AArch64AsmParser", # build_cleaner: keep
"@llvm//:AArch64CodeGen", # build_cleaner: keep
"@llvm//:Core",
"@llvm//:OrcJIT",
"@llvm//:Support",
Expand Down

0 comments on commit 840b5d5

Please sign in to comment.