While working on upgrading TensorFlow to v1.15.0 I noticed any attempt to build TF on GCC 4.8.5 failed with:
cc1plus: warning: command line option '-Wno-implicit-function-declaration' is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: unrecognized command line option "-Wno-shift-negative-value" [enabled by default]
ERROR: /root/.cache/bazel/_bazel_root/b2507dc3eab2b61a24c0cd86dae84c09/external/local_config_mlir/BUILD:1508:1: C++ compilation of rule '@local_config_mlir//:TableGen' failed (Exit 1)
gcc: error: unrecognized command line option '-std=c++14'
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 15.813s, Critical Path: 1.53s
INFO: 359 processes: 359 local.
FAILED: Build did NOT complete successfully
Traceback (most recent call last):
File "build_tf.py", line 87, in <module>
main()
File "build_tf.py", line 68, in main
False)
File "/root/ngraph-bridge/tools/build_utils.py", line 231, in build_tensorflow
command_executor(cmd)
File "/root/ngraph-bridge/tools/build_utils.py", line 60, in command_executor
raise Exception("Error running command: " + cmd)
Exception: Error running command: bazel build --config=opt --config=noaws --config=nohdfs --config=noignite --config=nokafka --config=nonccl //tensorflow/tools/pip_package:build_pip_package
This indicates that there are clearly c++14 calls during TF build which is not supported by GCC 4.8.5.
A quick scan of the TensorFlow r1.15 branch shows that:
While working on upgrading TensorFlow to v1.15.0 I noticed any attempt to build TF on GCC 4.8.5 failed with:
This indicates that there are clearly
c++14
calls during TF build which is not supported byGCC 4.8.5
.A quick scan of the TensorFlow r1.15 branch shows that:
All need to be compiled with
copts = ["-std=c++14"]
which is not available on GCC 4.8.5 Here is one example: https://github.com/tensorflow/tensorflow/blob/r1.15/tensorflow/compiler/mlir/BUILD#L25Surprisingly enough, for TF 2.0 branch they don’t have that option set anywhere, but it’s globally set in master now for all platforms going forward: https://github.com/tensorflow/tensorflow/blob/master/.bazelrc#L254
So chances are
TensorFlow v1.15.x
andTensorFlow v2.1.x
can only be used with GCC 5 and newer.