<p dir="auto">With<br>
bazel 0.26.1<br>
gcc 7.4<br>
cuda 10.1 update 2</p>
<p dir="auto">and the latest git clone of tensorflow, I hit the following error at the bazel build command</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ERROR: /home/mh.naderan/.cache/bazel/_bazel_mh.naderan/dacf7a124fc721f30ac789c201b3b139/external/llvm/BUILD.bazel:201:1: C++ compilation of rule '@llvm//:llvm-tblgen' failed (Exit 1)
In file included from external/llvm/include/llvm/TableGen/Record.h:27:0,
                 from external/llvm/utils/TableGen/SubtargetFeatureInfo.h:13,
                 from external/llvm/utils/TableGen/SubtargetFeatureInfo.cpp:9:
external/llvm/include/llvm/Support/TrailingObjects.h: In static member function 'static void llvm::TrailingObjects&lt;BaseTy, TrailingTys&gt;::verifyTrailingObjectsAssertions()':
external/llvm/include/llvm/Support/TrailingObjects.h:252:24: error: 'is_final' is not a member of 'std'
     static_assert(std::is_final&lt;BaseTy&gt;(), &quot;BaseTy must be final.&quot;);
                        ^~~~~~~~
external/llvm/include/llvm/Support/TrailingObjects.h:252:24: note: suggested alternative: 'is_heap'
     static_assert(std::is_final&lt;BaseTy&gt;(), &quot;BaseTy must be final.&quot;);
                        ^~~~~~~~
                        is_heap
external/llvm/include/llvm/Support/TrailingObjects.h:252:39: error: expected primary-expression before '&gt;' token
     static_assert(std::is_final&lt;BaseTy&gt;(), &quot;BaseTy must be final.&quot;);
                                       ^
external/llvm/include/llvm/Support/TrailingObjects.h:252:41: error: expected primary-expression before ')' token
     static_assert(std::is_final&lt;BaseTy&gt;(), &quot;BaseTy must be final.&quot;);
                                         ^
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: 442.171s, Critical Path: 25.05s
INFO: 1254 processes: 1254 local.
FAILED: Build did NOT complete successfully
"><pre class="notranslate"><code class="notranslate">ERROR: /home/mh.naderan/.cache/bazel/_bazel_mh.naderan/dacf7a124fc721f30ac789c201b3b139/external/llvm/BUILD.bazel:201:1: C++ compilation of rule '@llvm//:llvm-tblgen' failed (Exit 1)
In file included from external/llvm/include/llvm/TableGen/Record.h:27:0,
                 from external/llvm/utils/TableGen/SubtargetFeatureInfo.h:13,
                 from external/llvm/utils/TableGen/SubtargetFeatureInfo.cpp:9:
external/llvm/include/llvm/Support/TrailingObjects.h: In static member function 'static void llvm::TrailingObjects&lt;BaseTy, TrailingTys&gt;::verifyTrailingObjectsAssertions()':
external/llvm/include/llvm/Support/TrailingObjects.h:252:24: error: 'is_final' is not a member of 'std'
     static_assert(std::is_final&lt;BaseTy&gt;(), "BaseTy must be final.");
                        ^~~~~~~~
external/llvm/include/llvm/Support/TrailingObjects.h:252:24: note: suggested alternative: 'is_heap'
     static_assert(std::is_final&lt;BaseTy&gt;(), "BaseTy must be final.");
                        ^~~~~~~~
                        is_heap
external/llvm/include/llvm/Support/TrailingObjects.h:252:39: error: expected primary-expression before '&gt;' token
     static_assert(std::is_final&lt;BaseTy&gt;(), "BaseTy must be final.");
                                       ^
external/llvm/include/llvm/Support/TrailingObjects.h:252:41: error: expected primary-expression before ')' token
     static_assert(std::is_final&lt;BaseTy&gt;(), "BaseTy must be final.");
                                         ^
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: 442.171s, Critical Path: 25.05s
INFO: 1254 processes: 1254 local.
FAILED: Build did NOT complete successfully

</code></pre></div>
<p dir="auto"><strong>System information</strong></p>
<ul dir="auto">
<li>OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Linux RedHat 7.6</li>
<li>Mobile device (e.g. iPhone 8, Pixel 2, Samsung Galaxy) if the issue happens on mobile device: N/A</li>
<li>TensorFlow installed from (source or binary): source</li>
<li>TensorFlow version: master branch</li>
<li>Python version: N/A</li>
<li>Installed using virtualenv? pip? conda?: N/A</li>
<li>Bazel version (if compiling from source): 0.25.2</li>
<li>GCC/Compiler version (if compiling from source): cc version 8.2.1 20180905 (Red Hat 8.2.1-3)</li>
<li>CUDA/cuDNN version: N/A</li>
<li>GPU model and memory: N/A</li>
</ul>
<p dir="auto"><strong>Describe the problem</strong></p>
<p dir="auto">Compilation of LLVM is failing because '-std=c++0x' is being passed, but current LLVM uses C++14 features.</p>
<p dir="auto"><strong>Provide the exact sequence of commands / steps that you executed before running into the problem</strong></p>
<p dir="auto">bazel build --verbose_failures --config opt --config mkl //tensorflow/tools/pip_package:build_pip_package</p>
<p dir="auto"><strong>Any other info / logs</strong><br>
Include any logs or source code that would be helpful to diagnose the problem. If including tracebacks, please include the full traceback. Large logs and files should be attached.</p>
<p dir="auto">Note "-std=c++0x" option. I could probably fix this myself if I could figure out where it is coming from...</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="  /opt/rh/devtoolset-8/root/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/host/bin/tensorflow/compiler/mlir/lite/quantization/_objs/op_quant_spec_getters_gen/op_quant_spec_getters_gen.d '-frandom-seed=bazel-out/host/bin/tensorflow/compiler/mlir/lite/quantization/_objs/op_quant_spec_getters_gen/op_quant_spec_getters_gen.o' -DLLVM_ENABLE_STATS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DLLVM_BUILD_GLOBAL_ISEL -iquote . -iquote bazel-out/host/bin -iquote external/llvm -iquote bazel-out/host/bin/external/llvm -iquote external/zlib_archive -iquote bazel-out/host/bin/external/zlib_archive -iquote external/local_config_mlir -iquote bazel-out/host/bin/external/local_config_mlir -iquote external/bazel_tools -iquote bazel-out/host/bin/external/bazel_tools -isystem external/llvm/include -isystem bazel-out/host/bin/external/llvm/include -isystem external/zlib_archive -isystem bazel-out/host/bin/external/zlib_archive -isystem external/local_config_mlir/include -isystem bazel-out/host/bin/external/local_config_mlir/include -g0 '-march=native' -g0 -DEIGEN_AVOID_STL_ARRAY -Iexternal/gemmlowp -Wno-sign-compare '-ftemplate-depth=900' -fno-exceptions '-DINTEL_MKL=1' -DEIGEN_USE_VML -DENABLE_MKL -fopenmp -msse3 -pthread -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__=&quot;redacted&quot;' '-D__TIMESTAMP__=&quot;redacted&quot;' '-D__TIME__=&quot;redacted&quot;' -c tensorflow/compiler/mlir/lite/quantization/tools/op_quant_spec_getters_gen.cc -o bazel-out/host/bin/tensorflow/compiler/mlir/lite/quantization/_objs/op_quant_spec_getters_gen/op_quant_spec_getters_gen.o)
Execution platform: @bazel_tools//platforms:host_platform
In file included from external/llvm/include/llvm/TableGen/Record.h:27,
                 from tensorflow/compiler/mlir/lite/quantization/tools/op_quant_spec_getters_gen.cc:21:
external/llvm/include/llvm/Support/TrailingObjects.h: In static member function 'static void llvm::TrailingObjects&lt;BaseTy, TrailingTys&gt;::verifyTrailingObjectsAssertions()':
external/llvm/include/llvm/Support/TrailingObjects.h:252:24: error: 'is_final' is not a member of 'std'
     static_assert(std::is_final&lt;BaseTy&gt;(), &quot;BaseTy must be final.&quot;);
                        ^~~~~~~~"><pre class="notranslate"><code class="notranslate">  /opt/rh/devtoolset-8/root/usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-std=c++0x' -MD -MF bazel-out/host/bin/tensorflow/compiler/mlir/lite/quantization/_objs/op_quant_spec_getters_gen/op_quant_spec_getters_gen.d '-frandom-seed=bazel-out/host/bin/tensorflow/compiler/mlir/lite/quantization/_objs/op_quant_spec_getters_gen/op_quant_spec_getters_gen.o' -DLLVM_ENABLE_STATS -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -DLLVM_BUILD_GLOBAL_ISEL -iquote . -iquote bazel-out/host/bin -iquote external/llvm -iquote bazel-out/host/bin/external/llvm -iquote external/zlib_archive -iquote bazel-out/host/bin/external/zlib_archive -iquote external/local_config_mlir -iquote bazel-out/host/bin/external/local_config_mlir -iquote external/bazel_tools -iquote bazel-out/host/bin/external/bazel_tools -isystem external/llvm/include -isystem bazel-out/host/bin/external/llvm/include -isystem external/zlib_archive -isystem bazel-out/host/bin/external/zlib_archive -isystem external/local_config_mlir/include -isystem bazel-out/host/bin/external/local_config_mlir/include -g0 '-march=native' -g0 -DEIGEN_AVOID_STL_ARRAY -Iexternal/gemmlowp -Wno-sign-compare '-ftemplate-depth=900' -fno-exceptions '-DINTEL_MKL=1' -DEIGEN_USE_VML -DENABLE_MKL -fopenmp -msse3 -pthread -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c tensorflow/compiler/mlir/lite/quantization/tools/op_quant_spec_getters_gen.cc -o bazel-out/host/bin/tensorflow/compiler/mlir/lite/quantization/_objs/op_quant_spec_getters_gen/op_quant_spec_getters_gen.o)
Execution platform: @bazel_tools//platforms:host_platform
In file included from external/llvm/include/llvm/TableGen/Record.h:27,
                 from tensorflow/compiler/mlir/lite/quantization/tools/op_quant_spec_getters_gen.cc:21:
external/llvm/include/llvm/Support/TrailingObjects.h: In static member function 'static void llvm::TrailingObjects&lt;BaseTy, TrailingTys&gt;::verifyTrailingObjectsAssertions()':
external/llvm/include/llvm/Support/TrailingObjects.h:252:24: error: 'is_final' is not a member of 'std'
     static_assert(std::is_final&lt;BaseTy&gt;(), "BaseTy must be final.");
                        ^~~~~~~~
</code></pre></div>