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

Raspberry Pi Bazel Build "Define appropriate PLATFORM macro" error #3469

Closed
samjabrahams opened this issue Jul 22, 2016 · 6 comments
Closed

Raspberry Pi Bazel Build "Define appropriate PLATFORM macro" error #3469

samjabrahams opened this issue Jul 22, 2016 · 6 comments
Assignees

Comments

@samjabrahams
Copy link
Contributor

@samjabrahams samjabrahams commented Jul 22, 2016

When building TensorFlow on Raspberry Pi with Bazel, the pre-compiler end up throwing this error:

Define the appropriate PLATFORM_<foo> macro for this platform

From what I've been able to gather, here's the cause of the issue:

  1. Because Raspberry Pi uses an ARM CPU, the IS_MOBILE_PLATFORM macro is defined in `tensorflow/core/platform/platform.h
  2. Later, when trying to compile png.h, gif.h, or jpeg.h, the if/else statements fall through, leaving with the default option to throw an error.

Environment info

Operating System: Raspbian GNU/Linux, version 8.0

Installed version of CUDA and cuDNN: N/A

Installed from source.

  1. The commit hash : e95f4e7
  2. The output of bazel version :
Build label: 0.2.1-2016-06-13 (@447f7f3)
Build target: bazel-out/local_linux-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Jun 13 19:05:24 2016 (1465844724)
Build timestamp: 1465844724
Build timestamp as int: 1465844724

Steps to reproduce

  1. Build TensorFlow from source on Raspberry Pi as described in this guide without deleting this line from tensorflow/core/platform/platform.h, which defines IS_MOBILE_PLATFORM when compiling on ARM devices.

What have you tried?

  1. Deleted the line mentioned above, which fixes the problem for local builds

Logs or other output that would be helpful

define_macro_error.txt

@samjabrahams
Copy link
Contributor Author

@samjabrahams samjabrahams commented Jul 22, 2016

According to this post on StackExchange, it looks like there's no reliable, automatic way to detect if building for Raspberry Pi.

Would it be possible to add in a #if !defined(PLATFORM_RASPBERRY_PI) line in platform.h and define the macro manually in Bazel with --copt="-D PLATFORM_RASPBERRY_PI"?

@danbri
Copy link

@danbri danbri commented Sep 7, 2016

@petewarden any thoughts?

@petewarden
Copy link
Member

@petewarden petewarden commented Sep 17, 2016

No update on this one I'm afraid. I've been focused on the makefile approach to building for the Pi, and I'm not familiar enough with Bazel to suggest the right way to handle this.

@drpngx
Copy link
Contributor

@drpngx drpngx commented Jan 23, 2017

Closing this -- we only support Makefile builds right now.

@drpngx drpngx closed this Jan 23, 2017
@samjabrahams
Copy link
Contributor Author

@samjabrahams samjabrahams commented Jan 23, 2017

Ok, no worries- I'll keep maintaining my repo for those who want a Python interface on their Raspberry Pi.

@EddieOne
Copy link

@EddieOne EddieOne commented Jul 25, 2017

Long build process on the Raspberry Pi.

When you wake up the next morning and it's finished compiling

At this stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.