0

I'm attempting to build tensorflow from source on CentOS 6.2 using gcc. I updated gcc globally from 4.6.6 to 5.2.0, so that may be causing some problems. Glibc 2.17 is in a local directory, but the version of the system default Glibc is 2.12.

I get the following error:

ERROR: /usr/local/app/.cache/bazel/_bazel_mqq/51871d27dfe77ebce0294c6560736a2c/external/jemalloc/BUILD:10:1: C++ compilation of rule '@jemalloc//:jemalloc' failed: gcc failed: error executing command (cd /usr/local/app/.cache/bazel/_bazel_mqq/51871d27dfe77ebce0294c6560736a2c/execroot/tensorflow && \ exec env - \ PATH=/data6/jimpan/env/java/jdk1.8.0_131/bin:/data6/jimpan/env/python3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/jdk/bin:/usr/local/jdk/jre/bin:/opt/CollabNet_Subversion/bin/:/usr/local/app/java/bin:/usr/local/app/bin \ PWD=/proc/self/cwd \ PYTHON_BIN_PATH=/data6/jimpan/env/python3/bin/python3 \ PYTHON_LIB_PATH=/data6/jimpan/env/python3/lib/python3.5/site-packages \ TF_NEED_CUDA=0 \ TF_NEED_OPENCL=0 \ /usr/local/bin/gcc -U_FORTIFY_SOURCE -fstack-protector -Wall -B/usr/local/bin -B/usr/bin -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 '-D_FORTIFY_SOURCE=1' -DNDEBUG -ffunction-sections -fdata-sections '-mcpu=native' -MD -MF bazel-out/local-py3-opt/bin/external/jemalloc/_objs/jemalloc/external/jemalloc/src/pages.pic.d -fPIC -iquote external/jemalloc -iquote bazel-out/local-py3-opt/genfiles/external/jemalloc -iquote external/bazel_tools -iquote bazel-out/local-py3-opt/genfiles/external/bazel_tools -isystem external/jemalloc/include -isystem bazel-out/local-py3-opt/genfiles/external/jemalloc/include -isystem external/bazel_tools/tools/cpp/gcc3 -O3 -funroll-loops -D_GNU_SOURCE -D_REENTRANT -fno-canonical-system-headers -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' -c external/jemalloc/src/pages.c -o bazel-out/local-py3-opt/bin/external/jemalloc/_objs/jemalloc/external/jemalloc/src/pages.pic.o): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1. gcc: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead external/jemalloc/src/pages.c: In function 'je_pages_huge': external/jemalloc/src/pages.c:203:30: error: 'MADV_HUGEPAGE' undeclared (first use in this function) return (madvise(addr, size, MADV_HUGEPAGE) != 0); ^ external/jemalloc/src/pages.c:203:30: note: each undeclared identifier is reported only once for each function it appears in external/jemalloc/src/pages.c: In function 'je_pages_nohuge': external/jemalloc/src/pages.c:217:30: error: 'MADV_NOHUGEPAGE' undeclared (first use in this function) return (madvise(addr, size, MADV_NOHUGEPAGE) != 0); ^ external/jemalloc/src/pages.c: In function 'je_pages_huge': external/jemalloc/src/pages.c:207:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ external/jemalloc/src/pages.c: In function 'je_pages_nohuge': external/jemalloc/src/pages.c:221:1: warning: control reaches end of non-void function [-Wreturn-type] } ^

/usr/local/app is the $HOME path of my system.

I guess the problem lies in gcc, but I'm stuck now and don't know how to proceed.

5
  • What does which gcc says? And gcc -version? Commented Jul 25, 2017 at 10:48
  • @DamienMartin-guillerez 5.2.0
    – Jim07
    Commented Jul 25, 2017 at 14:05
  • What about which gcc? /usr/local/bin/gcc? Commented Jul 25, 2017 at 15:35
  • Yes, /usr/local/bin/gcc
    – Jim07
    Commented Jul 26, 2017 at 3:35
  • I am betting on a configuration issue for jemalloc. Would be interesting to get some people from the tensorflow team to look at it. The C++ configuration sounds correct to me. Commented Jul 26, 2017 at 9:02

1 Answer 1

0

It seems that jemalloc's build is misconfigured (it's missing MADV_NOHUGEPAGE define). I found this tensorflow issue that is related.

Not the answer you're looking for? Browse other questions tagged or ask your own question.