I am trying to compile tensorflow_io onto my Ubuntu 22.04.2 target machine that does not offer GPU nor AVX instruction. I am finding that the compile errors out on curve25519.c. Is there a dependency that I need pre-installed before compiling? Here is the trace:
ERROR: /home/user/.cache/bazel/_bazel_user/d7752e78d6f81d5a4b8e51449d25c837/external/boringssl/BUILD:130:11: Compiling src/third_party/fiat/curve25519.c failed: (Exit 1): gcc failed: error executing command
(cd /home/user/.cache/bazel/_bazel_user/d7752e78d6f81d5a4b8e51449d25c837/sandbox/linux-sandbox/242/execroot/org_tensorflow_io && \
exec env - \
PATH=/home/user/.cache/bazelisk/downloads/bazelbuild/bazel-5.1.1-linux-x86_64/bin:/home/user/miniconda3/envs/tf/bin:/home/user/miniconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin \
PWD=/proc/self/cwd \
TF_HEADER_DIR=/home/user/miniconda3/envs/tf/lib/python3.9/site-packages/tensorflow/include \
TF_SHARED_LIBRARY_DIR=/home/user/miniconda3/envs/tf/lib/python3.9/site-packages/tensorflow \
TF_SHARED_LIBRARY_NAME=libtensorflow_framework.so.2 \
avariable=2 \
/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -MD -MF bazel-out/k8-fastbuild/bin/external/boringssl/_objs/crypto/curve25519.pic.d '-frandom-seed=bazel-out/k8-fastbuild/bin/external/boringssl/_objs/crypto/curve25519.pic.o' -fPIC -iquote external/boringssl -iquote bazel-out/k8-fastbuild/bin/external/boringssl -isystem external/boringssl/src/include -isystem bazel-out/k8-fastbuild/bin/external/boringssl/src/include '-fvisibility=hidden' '-D_GLIBCXX_USE_CXX11_ABI=1' '-DEIGEN_MAX_ALIGN_BYTES=64' '-march=native' -Wno-sign-compare -Wa,--noexecstack '-D_XOPEN_SOURCE=700' -Wall -Werror '-Wformat=2' -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wshadow -fno-common '-std=c11' -Wmissing-prototypes -Wold-style-definition -Wstrict-prototypes -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/boringssl/src/third_party/fiat/curve25519.c -o bazel-out/k8-fastbuild/bin/external/boringssl/_objs/crypto/curve25519.pic.o)
# Configuration: 683c4395567a3d925cdf6244b42f976fe0687d86f7973f0af39694471ed5243f
# Execution platform: @local_execution_config_platform//:platform
Use --sandbox_debug to see verbose messages from the sandbox
external/boringssl/src/third_party/fiat/curve25519.c:511:57: error: argument 2 of type 'const uint8_t[32]' {aka 'const unsigned char[32]'} with mismatched bound [-Werror=array-parameter=]
511 | int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t s[32]) {
| ~~~~~~~~~~~~~~^~~~~
In file included from external/boringssl/src/third_party/fiat/curve25519.c:41:
external/boringssl/src/third_party/fiat/internal.h:117:58: note: previously declared as 'const uint8_t *' {aka 'const unsigned char *'}
117 | int x25519_ge_frombytes_vartime(ge_p3 *h, const uint8_t *s);
| ~~~~~~~~~~~~~~~^
external/boringssl/src/third_party/fiat/curve25519.c:831:57: error: argument 2 of type 'const uint8_t *' {aka 'const unsigned char *'} declared as a pointer [-Werror=array-parameter=]
831 | void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t *a) {
| ~~~~~~~~~~~~~~~^
In file included from external/boringssl/src/third_party/fiat/curve25519.c:41:
external/boringssl/src/third_party/fiat/internal.h:125:56: note: previously declared as an array 'const uint8_t[32]' {aka 'const unsigned char[32]'}
125 | void x25519_ge_scalarmult_base(ge_p3 *h, const uint8_t a[32]);
| ~~~~~~~~~~~~~~^~~~~
cc1: all warnings being treated as errors
INFO: Elapsed time: 619.024s, Critical Path: 20.71s
INFO: 305 processes: 65 internal, 240 linux-sandbox.
Background: I am working on building out CPU only instance of tensorflow. I have made several successful tensorflow wheel files and they successfully install and run. Intructions followed from https://www.tensorflow.org/install/source
The trouble comes when I install the Object Detection Framework. https://github.com/tensorflow/models/tree/master/research/object_detection First problem (solved) was object detection wants tensorflow 2.12.0 which it installed (over my compiled 2.14.0 latest) and failed on illegal instruction, probably AVX. So I compiled tensorflow 2.12.0 with which object detection is happy and leaves my self compiled installation in place.
Which leads to my current problem: Object Detection installs tensorflow_io which is not part of the base source compiled for tensorflow. After installation of tensorflow_io I'm plagued again with "illegal instruction".
So trying to compile tensorflow_io from here https://github.com/tensorflow/io/blob/master/docs/development.md Unfortunately I'm not quite able to follow to the "T". I am on Ubuntu 22.04.2 instead of 20. Also I am not sudo'ing as I am installing tensorflow (and hopefully _io into a conda virtual environment). Other than that I have done everything else.
My goal is to learn the ins and outs on small problem domains before deciding to invest in more appropriate hardware. I also like the idea of not bringing every little thing I want to do up to collab_net. I prefer to see that as a last resort.
For anyone else stumbling on this issue. I finally keyed in on this from the compiler trace cc1: all warnings being treated as errors
and found How can I compile without warnings being treated as errors?
I went with this answer https://stackoverflow.com/a/11561283/2624395 and changed all 978 instances of -Werror to a more innocuous -Wno-sign-compare in my copy of the project. But in hindsight I should've tried this answer https://stackoverflow.com/a/11561340/2624395 first on my build command specifying -Wno-error:
bazel build -s --verbose_failures --copt="-march=native" --copt="-Wno-sign-compare" --copt="-Wno-error" //tensorflow_io/... //tensorflow_io_gcs_filesystem/... --local_cpu_resources=2 --experimental_repo_remote_exec
the compile is lumbering along well past the original compile issue.
compile completed in about an hour. That was the last of my build issues, the framework is running now