Skip to content

Commit

Permalink
Fix building on raspberry pi. (tensorflow#2230)
Browse files Browse the repository at this point in the history
  • Loading branch information
DanBmh authored Nov 6, 2020
1 parent c36d7b1 commit 92de2e5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ def is_windows():
return platform.system() == "Windows"


def is_raspi_arm():
return os.uname()[4] == "armv7l"


def get_tf_header_dir():
import tensorflow as tf

Expand All @@ -60,6 +64,8 @@ def get_tf_shared_lib_dir():
if is_windows():
tf_shared_lib_dir = tf.sysconfig.get_compile_flags()[0][2:-7] + "python"
return tf_shared_lib_dir.replace("\\", "/")
elif is_raspi_arm():
return tf.sysconfig.get_compile_flags()[0][2:-7] + "python"
else:
return tf.sysconfig.get_link_flags()[0][2:]

Expand All @@ -75,6 +81,9 @@ def get_shared_lib_name():
elif is_windows():
# Windows
return "_pywrap_tensorflow_internal.lib"
elif is_raspi_arm():
# The below command for linux would return an empty list
return "_pywrap_tensorflow_internal.so"
else:
# Linux
return namespec[1][3:]
Expand Down

0 comments on commit 92de2e5

Please sign in to comment.