Skip to content
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

Closed
wtfuzz opened this issue May 14, 2016 · 11 comments
Closed

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

wtfuzz opened this issue May 14, 2016 · 11 comments
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Configurability Issues for Configurability team type: bug

Comments

@wtfuzz
Copy link

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
Copy link
Contributor

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
Copy link
Author

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
Copy link
Author

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
Copy link
Contributor

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

@wtfuzz
Copy link
Author

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
Copy link
Contributor

Nice! ping me when you send it.

@damienmg damienmg removed their assignment May 25, 2016
@syed-ahmed
Copy link

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
Copy link

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
I have tested on NVIDA Jetson TK1 and bazel was able to compile.
@damienmg
Copy link
Contributor

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
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
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
Copy link

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

@gregestren gregestren added team-Configurability Issues for Configurability team P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed category: extensibility > configurability P2 We'll consider working on this in future. (Assignee optional) labels Dec 4, 2018
@aiuto
Copy link
Contributor

aiuto commented Jun 8, 2020

Closing for staleness. We can still take a patch, but so much has changed in 3 years that this might not even be applicable any more.

@aiuto aiuto closed this as completed Jun 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Configurability Issues for Configurability team type: bug
Projects
None yet
Development

No branches or pull requests

9 participants