Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Issue compiling tensorflow serving in Docker in Mac OS Sierra #542
I'm getting a compilation error when compiling tensorflow serving on Mac OS Sierra docker:
C++ compilation of rule '@org_tensorflow//tensorflow/core/kernels:svd_op' failed: gcc failed: error executing command /usr/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG ... (remaining 107 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 4
I've attached BUILD.txt file.
This frequently turns out to be related to insufficient memory to compile the code. The following should help, in the memory cases.
Look for the text “gcc: internal compiler error: Killed (program cc1plus)” in your error output. When the memory is exhausted during a compile phase, this error is often found in the error text.
Someone just had a similar issue. They were able to successfully compile with 4GB of RAM. Which seems to be an improvement over what has been needed in similar past issues.
You could try replacing this line in the Dockerfile:
“RUN bazel build -c opt tensorflow_serving/... && \”
“RUN bazel build -c opt --jobs 1 --local_resources 5000,1.0,1.0 --verbose_failures tensorflow_serving/... && \”
This forces Bazel to reduce the resources it will try to use during the build. If the build is now requiring less RAM than in the past, the 5000 value may be able to be decreased. The —jobs 1, in my case, has helped when the build fails in the linking phase.