Skip to content

Commit 55cf508

Browse files
authored
Fix building on raspberry pi. (#2230)
1 parent 34a54f2 commit 55cf508

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

configure.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def is_windows():
4444
return platform.system() == "Windows"
4545

4646

47+
def is_raspi_arm():
48+
return os.uname()[4] == "armv7l"
49+
50+
4751
def get_tf_header_dir():
4852
import tensorflow as tf
4953

@@ -60,6 +64,8 @@ def get_tf_shared_lib_dir():
6064
if is_windows():
6165
tf_shared_lib_dir = tf.sysconfig.get_compile_flags()[0][2:-7] + "python"
6266
return tf_shared_lib_dir.replace("\\", "/")
67+
elif is_raspi_arm():
68+
return tf.sysconfig.get_compile_flags()[0][2:-7] + "python"
6369
else:
6470
return tf.sysconfig.get_link_flags()[0][2:]
6571

@@ -75,6 +81,9 @@ def get_shared_lib_name():
7581
elif is_windows():
7682
# Windows
7783
return "_pywrap_tensorflow_internal.lib"
84+
elif is_raspi_arm():
85+
# The below command for linux would return an empty list
86+
return "_pywrap_tensorflow_internal.so"
7887
else:
7988
# Linux
8089
return namespec[1][3:]

0 commit comments

Comments
 (0)