Skip to content

Cannot make tensorflow to use a local gcc installation? #336

@jesusandres-ferrer

Description

@jesusandres-ferrer

Hi,
I am bound to an old installation on a machine. I had to install a local gcc 4.8.1 and make my way through a bazel compilation (thanks to the community for their help :) ). However, now I am unable to compile tensorflow. This is the error I get:

gcc: unrecognized option '-no-canonical-prefixes'
cc1plus: error: unrecognized command line option "-std=c++11"
cc1plus: warning: unrecognized command line option "-Wno-free-nonheap-object"
ERROR: $HOME/tensorflow/google/protobuf/BUILD:29:1: C++ compilation of rule '//google/protobuf:protobuf_lite' failed: crosstool_wrapper_driver_is_not_gcc failed: error executing command third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object ... : com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.

I guess it is not getting the correct gcc, since if I run :

/path/to/local/gcc.4.8.1/bin/gcc -std=c++11  example.cc 

All is ok, but if I run

/usr/bin/gcc  -std=c++11 example.cc

I get the same error"

cc1plus: error: unrecognized command line option "-std=c++11"

If I add the --verbose_failures option, I get this additional information:

(cd $HOME/.cache/bazel/_bazel_$USER/2d4cdeea5be55811d371414ca0f7bd15/tensorflow && \
  exec env - \
    PATH=$HOME/jdk1.8.0_65/bin/:$HOME/local.gcc-4.8.1/bin:/usr/lib64/qt-3.3/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:$HOME/bin \
  third_party/gpus/crosstool/clang/bin/crosstool_wrapper_driver_is_not_gcc -U_FORTIFY_SOURCE '-D_FORTIFY_SOURCE=1' -fstack-protector -fPIE -Wall -Wunused-but-set-parameter -Wno-free-nonheap-object -fno-omit-frame-pointer -g0 -O2 -DNDEBUG -ffunction-sections -fdata-sections '-std=c++11' -iquote . -iquote bazel-out/local_linux-opt/genfiles -iquote external/bazel_tools -iquote bazel-out/local_linux-opt/genfiles/external/bazel_tools -isystem google/protobuf/src -isystem bazel-out/local_linux-opt/genfiles/google/protobuf/src -isystem external/bazel_tools/tools/cpp/gcc3 -DHAVE_PTHREAD -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare '-Wno-error=unused-function' -no-canonical-prefixes -Wno-builtin-macro-redefined '-D__DATE__="redacted"' '-D__TIMESTAMP__="redacted"' '-D__TIME__="redacted"' '-frandom-seed=bazel-out/local_linux-opt/bin/google/protobuf/_objs/protobuf_lite/google/protobuf/src/google/protobuf/wire_format_lite.o' -MD -MF bazel-out/local_linux-opt/bin/google/protobuf/_objs/protobuf_lite/google/protobuf/src/google/protobuf/wire_format_lite.d -c google/protobuf/src/google/protobuf/wire_format_lite.cc -o bazel-out/local_linux-opt/bin/google/protobuf/_objs/protobuf_lite/google/protobuf/src/google/protobuf/wire_format_lite.o)

How can I make it use the correct gcc ?

Thanks,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions