New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling on Jetson TX1 aarch64 kernel with arm32 userspace fails #1264

Open
wtfuzz opened this Issue May 14, 2016 · 10 comments

Comments

Projects
None yet
7 participants
@wtfuzz

wtfuzz commented May 14, 2016

ubuntu@tegra-ubuntu:~$ uname -a
Linux tegra-ubuntu 3.10.67-g458d45c #1 SMP PREEMPT Mon Feb 8 17:44:18 PST 2016 aarch64 aarch64 aarch64 GNU/Linux

protobuf 3.0.0-beta-2 was compiled with --enable-shared=no, and static protoc copied into ~/bazel/third-party/protobuf/protoc-linux-arm32.exe

ubuntu@tegra-ubuntu:~/bazel-0.2.2$ ./compile.sh
INFO: You can skip this first step by providing a path to the bazel binary as second argument:
INFO:    ./compile.sh compile /path/to/bazel
🍃  Building Bazel from scratch......
🍃  Building Bazel with Bazel.
ERROR: No toolchain found for cpu 'arm'. Valid cpus are: [
  k8,
  armeabi-v7a,
].
INFO: Elapsed time: 5.387s

Building output/bazel
@kchodorow

This comment has been minimized.

Contributor

kchodorow commented May 16, 2016

This sounds similar to #1251, based on https://github.com/bazelbuild/bazel/blob/master/tools/cpp/CROSSTOOL#L26-L27 I'm guess we need to make "arm" return k8, too, but assigning to @damienmg for followup since I'm not too familiar with the CROSSTOOL stuff.

@wtfuzz

This comment has been minimized.

wtfuzz commented May 16, 2016

I did get it work. There were a few things that needed to be done.

This fork compiles on arm:
https://github.com/wtfuzz/bazel

Sent from my iPhone

On May 16, 2016, at 8:56 AM, Kristina notifications@github.com wrote:

This sounds similar to #1251, based on https://github.com/bazelbuild/bazel/blob/master/tools/cpp/CROSSTOOL#L26-L27 I'm guess we need to make "arm" return k8, too, but assigning to @damienmg for followup since I'm not too familiar with the CROSSTOOL stuff.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@wtfuzz

This comment has been minimized.

wtfuzz commented May 16, 2016

The main culprit was cc_configure.bzl which defaults to returning "k8" (i386) when it doesn't recognize any other arch.

wtfuzz@ddc37b2

On May 16, 2016, at 8:56 AM, Kristina notifications@github.com wrote:

This sounds similar to #1251, based on https://github.com/bazelbuild/bazel/blob/master/tools/cpp/CROSSTOOL#L26-L27 I'm guess we need to make "arm" return k8, too, but assigning to @damienmg for followup since I'm not too familiar with the CROSSTOOL stuff.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@kchodorow

This comment has been minimized.

Contributor

kchodorow commented May 16, 2016

Great! Would you like to submit it as a pull request?

@wtfuzz

This comment has been minimized.

wtfuzz commented May 16, 2016

I'm traveling this week, but I'll get a PR submitted when I can.

On May 16, 2016, at 11:08 AM, Kristina notifications@github.com wrote:

Great! Would you like to submit it as a pull request?


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub

@damienmg

This comment has been minimized.

Contributor

damienmg commented May 17, 2016

Nice! ping me when you send it.

@damienmg damienmg removed their assignment May 25, 2016

@syed-ahmed

This comment has been minimized.

syed-ahmed commented Jul 5, 2016

Hi,
I ran into a similar error on a Jetson TX1 board. It says "ERROR: No toolchain found for cpu 'unknown'". I will try rebuilding with this change by @wtfuzz. Do I still need to do this step: protobuf 3.0.0-beta-2 was compiled with --enable-shared=no, and static protoc copied into ~/bazel/third-party/protobuf/protoc-linux-arm32.exe? is bazel build limited to arm32 only?

@datlife

This comment has been minimized.

datlife commented Jan 21, 2017

I confirm that by adding the following lines in tools/cpp/cc_configure.bzl helped me fix the Error: NO tool-chain found for 'arm'.

My hardware is NVIDIA Jetson TK1. (linux armv7l)

# Add an if statement to  _get_cpu_value()
result = repository_ctx.execute(["uname", "-m"])
if result.stdout.strip() in ["arm", "armv7l", "aarch64"]:
	return "arm"
return "k8" if result.stdout.strip() in ["amd64", "x86_64", "x64"] else "piii"

datlife added a commit to datlife/bazel that referenced this issue Jan 21, 2017

Update _get_cpu_value() to fix issue bazelbuild#1264
I have tested on NVIDA Jetson TK1 and bazel was able to compile.
@damienmg

This comment has been minimized.

Contributor

damienmg commented Jan 23, 2017

FYI: From the Bazel side, we would be happy to accept those patch as pull request to make your use case work better out of the box :)

bazel-io pushed a commit that referenced this issue Jan 24, 2017

Update _get_cpu_value() to fix issue #1264
I have tested on NVIDA Jetson TK1 and bazel was able to compile. 

I believe with this quick fix would make bazel installation on Linux ARM devices easier. I have been spending 5 hours to figure out a correct way to install bazel.

Closes #2389.

--
Reviewed-on: #2389
PiperOrigin-RevId: 145401787
MOS_MIGRATED_REVID=145401787

bazel-io pushed a commit that referenced this issue Apr 7, 2017

Add "aarch64" to the set of ARM CPU archs
This change, suggested by @tylerfox at
tensorflow/tensorflow#851 (comment)
allows Bazel 0.4.5 to be built on a Jetson TX1 with JetPack 3.0.

The other of @tylerfox's suggested changes was made in 7c4afb6.

Refs #1264

Closes #2703.
PiperOrigin-RevId: 152498304
@spidi123q

This comment has been minimized.

spidi123q commented Sep 29, 2017

download the binary for armv7l(pi 3) with this link below
https://drive.google.com/open?id=0B7NeIJaVzSxIZmZHUnVzZjBjVDg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment