Bazel build failed when Building an optimized serving binary #2259
Labels
stale
This label marks the issue/pr stale - to be closed automatically if no activity
stat:awaiting response
type:support
We are following the document to build an optimized tf-serving docker image.
Following the Dockerfile.devel and at the step of:
bazel build --color=yes --curses=yes --verbose_failures --output_filter=DONT_MATCH_ANYTHING --config=release tensorflow_serving/model_servers:tensorflow_model_server
there is an error occurs:
'''
ERROR: /root/.cache/bazel/bazel_root/e53bbb0b0da4e26d24b415310219b953/external/llvm-project/llvm/BUILD.bazel:251:11: Compiling llvm/lib/Support/BLAKE3/blake3.c failed: (Exit 1): gcc-10 failed: error executing command (from target @llvm-project//llvm:Support)
(cd /root/.cache/bazel/bazel_root/e53bbb0b0da4e26d24b415310219b953/execroot/tf_serving &&
exec env -
CC=/usr/bin/gcc-10
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/proc/self/cwd
/usr/bin/gcc-10 -U_FORTIFY_SOURCE -fstack-protector -Wall -Wthread-safety -Wself-assign -Wunused-but-set-parameter -Wno-free-nonheap-object -fcolor-diagnostics -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections -MD -MF bazel-out/k8-opt/bin/external/llvm-project/llvm/objs/Support/blake3.pic.d '-frandom-seed=bazel-out/k8-opt/bin/external/llvm-project/llvm/objs/Support/blake3.pic.o' -fPIC '-DLLVM_ON_UNIX=1' '-DHAVE_BACKTRACE=1' '-DBACKTRACE_HEADER=<execinfo.h>' '-DLTDL_SHLIB_EXT=".so"' '-DLLVM_PLUGIN_EXT=".so"' '-DLLVM_ENABLE_THREADS=1' '-DHAVE_DEREGISTER_FRAME=1' '-DHAVE_LIBPTHREAD=1' '-DHAVE_PTHREAD_GETNAME_NP=1' '-DHAVE_PTHREAD_H=1' '-DHAVE_PTHREAD_SETNAME_NP=1' '-DHAVE_REGISTER_FRAME=1' '-DHAVE_SETENV_R=1' '-DHAVE_STRERROR_R=1' '-DHAVE_SYSEXITS_H=1' '-DHAVE_UNISTD_H=1' -D_GNU_SOURCE '-DHAVE_MALLINFO=1' '-DHAVE_SBRK=1' '-DHAVE_STRUCT_STAT_ST_MTIM_TV_NSEC=1' -DHAVE_BUILTIN_THREAD_POINTER '-DLLVM_NATIVE_ARCH="X86"' '-DLLVM_NATIVE_ASMPARSER=LLVMInitializeX86AsmParser' '-DLLVM_NATIVE_ASMPRINTER=LLVMInitializeX86AsmPrinter' '-DLLVM_NATIVE_DISASSEMBLER=LLVMInitializeX86Disassembler' '-DLLVM_NATIVE_TARGET=LLVMInitializeX86Target' '-DLLVM_NATIVE_TARGETINFO=LLVMInitializeX86TargetInfo' '-DLLVM_NATIVE_TARGETMC=LLVMInitializeX86TargetMC' '-DLLVM_NATIVE_TARGETMCA=LLVMInitializeX86TargetMCA' '-DLLVM_HOST_TRIPLE="x86_64-unknown-linux-gnu"' '-DLLVM_DEFAULT_TARGET_TRIPLE="x86_64-unknown-linux-gnu"' '-DLLVM_VERSION_MAJOR=20' '-DLLVM_VERSION_MINOR=0' '-DLLVM_VERSION_PATCH=0' '-DLLVM_VERSION_STRING="20.0.0git"' -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS '-DLLVM_HAS_AArch64_TARGET=1' '-DLLVM_HAS_AMDGPU_TARGET=1' '-DLLVM_HAS_ARM_TARGET=1' '-DLLVM_HAS_NVPTX_TARGET=1' '-DLLVM_HAS_PowerPC_TARGET=1' '-DLLVM_HAS_RISCV_TARGET=1' '-DLLVM_HAS_SystemZ_TARGET=1' '-DLLVM_HAS_X86_TARGET=1' '-DBLAKE3_USE_NEON=0' -DBLAKE3_NO_AVX2 -DBLAKE3_NO_AVX512 -DBLAKE3_NO_SSE2 -DBLAKE3_NO_SSE41 '-DBAZEL_CURRENT_REPOSITORY="llvm-project"' -iquote external/llvm-project -iquote bazel-out/k8-opt/bin/external/llvm-project -isystem external/llvm-project/llvm/include -isystem bazel-out/k8-opt/bin/external/llvm-project/llvm/include -Wno-macro-redefined -Wno-sign-compare -Wno-deprecated-declarations -Wno-unused-but-set-variable -mavx -msse4.2 -w -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE="redacted"' '-D__TIMESTAMP="redacted"' '-D__TIME__="redacted"' -c external/llvm-project/llvm/lib/Support/BLAKE3/blake3.c -o bazel-out/k8-opt/bin/external/llvm-project/llvm/_objs/Support/blake3.pic.o)
Configuration: 40a136273ac932f455a47c0b666c3c9a76c2cae460a70bb86120df95ce4da60c
Execution platform: @local_execution_config_platform//:platform
gcc-10: error: unrecognized command-line option '-Wthread-safety'
gcc-10: error: unrecognized command-line option '-Wself-assign'
gcc-10: error: unrecognized command-line option '-fcolor-diagnostics'
'''
It seems that the gcc-10 not recognized the options?
how to fix that? thanks!
The text was updated successfully, but these errors were encountered: