gcc: error: unrecognized command line option '-mfpu=neon-vfpv4' - tensorflow

gcc: error: unrecognized command line option '-mfpu=neon-vfpv4' while building tensorflow from source. I have used bazel build -c opt --copt="-mfpu=neon-vfpv4" --copt="-funsafe-math-optimizations" --copt="-ftree-vectorize" --copt="-fomit-frame-pointer" --local_resources 1024,1.0,1.0 --verbose_failures tensorflow/tools/pip_package:build_pip_package to build it

Don't add --copt="-mfpu=neon-vfpv4" to your command line as this is not a flag gcc supports.

This flag is used on ARM architectures. If you are compiling under x86/amd64, just remove it.
$ gcc -mfpu=neon-vfpv4
gcc: error: unrecognized command line option '-mfpu=neon-vfpv4'
gcc: fatal error: no input files
compilation terminated.
$ arm-none-eabi-gcc -mfpu=neon-vfpv4
arm-none-eabi-gcc: fatal error: no input files
compilation terminated.

Related

configure jellyfish issue cannot run C compiled programs with MinGW g++

I am trying to install jellyfish using GNU bash, version 4.4.23(1)-release (x86_64-pc-msys). I have gcc and g++withversion 6.3.0 (MinGW.org GCC-6.3.0-1)`. When I run the configure file I get the error below:
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.exe
checking for suffix of executables... .exe
checking whether we are cross compiling... configure: error: in `/c/Users/bjwil/Downloads/jellyfish-2.2.10':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
./configure: line 38: sort: No such file or directory
./configure: line 35: sed: No such file or directory
Then inside the config.log file I get starting with first error after COLLECT_GCC=C:\MinGW\bin\gcc.exe:
configure:3778: gcc -V >&5
gcc.exe: error: unrecognized command line option '-V'
gcc.exe: fatal error: no input files
compilation terminated.
configure:3789: $? = 1
configure:3778: gcc -qversion >&5
gcc.exe: error: unrecognized command line option '-qversion'; did you mean '--version'?
gcc.exe: fatal error: no input files
compilation terminated.
configure:3789: $? = 1
configure:3809: checking whether the C compiler works
configure:3831: gcc conftest.c >&5
configure:3835: $? = 0
configure:3883: result: yes
configure:3886: checking for C compiler default output file name
configure:3888: result: a.exe
configure:3894: checking for suffix of executables
configure:3901: gcc -o conftest.exe conftest.c >&5
configure:3905: $? = 0
configure:3927: result: .exe
configure:3949: checking whether we are cross compiling
configure:3957: gcc -o conftest.exe conftest.c >&5
configure:3961: $? = 0
configure:3968: ./conftest.exe
./configure: line 3970: ./conftest.exe: Permission denied
configure:3972: $? = 126
configure:3979: error: in `/c/Users/bjwil/Downloads/jellyfish-2.2.10':
configure:3981: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
Works fine in Ubuntu 64-bit.

can't MAKE tensorflow Raspberry pi examples

I installed tensorflow on the Raspberry Pi 3, running Jessie and did that in two ways, via the .whl file / pip install for Python 2.7.:
https://github.com/samjabrahams/tensorflow-on-raspberry-pi
as well as a full compile via:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/makefile
Both installs (I did them on different OS images) where successfull and went through without error.
Next, I wanted to compile the official Raspberry Pi examples from tensorflow's git repository:
https://github.com/tensorflow/tensorflow/tree/master/tensorflow/contrib/pi_examples
However, none of the examples does compile (neither the camera example nor the image recognition), both give the same error and Google doesn't tell me anything:
make -f tensorflow/contrib/pi_examples/camera/Makefile gcc --std=c++11
-O0 -I/usr/local/include -I. -I/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/downloads
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/downloads/eigen/
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/gen/proto/
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/../../makefile/gen/proto_text/
-c tensorflow/contrib/pi_examples/camera/camera.cc -o /home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/gen/obj/tensorflow/contrib/pi_examples/camera/camera.o
In file included from ./tensorflow/core/platform/mutex.h:31:0,
from ./tensorflow/core/framework/variant.h:31,
from ./tensorflow/core/framework/allocator.h:26,
from ./tensorflow/core/framework/tensor.h:20,
from tensorflow/contrib/pi_examples/camera/camera.cc:33:
./tensorflow/core/platform/default/mutex.h:25:22: fatal error:
nsync_cv.h: No such file or directory #include "nsync_cv.h"
^ compilation terminated. tensorflow/contrib/pi_examples/camera/Makefile:80: recipe for target
'/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/gen/obj/tensorflow/contrib/pi_examples/camera/camera.o'
failed make: ***
[/home/pi/tensorflow/tensorflow/contrib/pi_examples/camera/gen/obj/tensorflow/contrib/pi_examples/camera/camera.o]
Error 1
as well as:
make -f tensorflow/contrib/pi_examples/label_image/Makefile gcc
--std=c++11 -O0 -I/usr/local/include -I. -I/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/../../makefile/downloads
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/../../makefile/downloads/eigen/
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/../../makefile/gen/proto/
-I/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/../../makefile/gen/proto_text/
-c tensorflow/contrib/pi_examples/label_image/label_image.cc -o /home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/gen/obj/tensorflow/contrib/pi_examples/label_image/label_image.o
In file included from ./tensorflow/core/platform/mutex.h:31:0,
from ./tensorflow/core/framework/variant.h:31,
from ./tensorflow/core/framework/allocator.h:26,
from ./tensorflow/core/framework/tensor.h:20,
from tensorflow/contrib/pi_examples/label_image/label_image.cc:33:
./tensorflow/core/platform/default/mutex.h:25:22: fatal error:
nsync_cv.h: No such file or directory #include "nsync_cv.h"
^ compilation terminated. tensorflow/contrib/pi_examples/label_image/Makefile:79: recipe for
target
'/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/gen/obj/tensorflow/contrib/pi_examples/label_image/label_image.o'
failed make: ***
[/home/pi/tensorflow/tensorflow/contrib/pi_examples/label_image/gen/obj/tensorflow/contrib/pi_examples/label_image/label_image.o]
Error 1
How can I locate / add / compile "nsync_cv.h"?
And btw:
export HOST_NSYNC_LIB=`tensorflow/contrib/makefile/compile_nsync.sh`
gives me:
g++ -M -std=c++11 -DNSYNC_USE_CPP11_TIMEPOINT -DNSYNC_ATOMIC_CPP11
-I../../platform/c++11 -I../../platform/gcc -I../../platform/posix -pthread -I../../public -I../../internal ../../internal/*.c ../../testing/*.c ../../platform/c++11/src/nsync_semaphore_mutex.cc
../../platform/c++11/src/per_thread_waiter.cc
../../platform/c++11/src/yield.cc
../../platform/c++11/src/time_rep_timespec.cc
../../platform/c++11/src/nsync_panic.cc \
../../platform/c++11/src/start_thread.cc > dependfile make: 'nsync.a' is up to date.
I once compiled tensorflow with the makefile on a nvidia Jetson TX1 and I could compile and run the examples by adding some lines to the Makefiles of the examples:
after line 18:
NSYNCLIBDIR := $(TFMAKEFILE_DIR)/downloads/nsync/builds/default.linux.c++11 !!!change folder default.linux.c++11 to where your libnsync.a is!!!
NSYNCLIBS := $(NSYNCLIBDIR)/libnsync.a
after line 26:
NSYNC := $(TFMAKEFILE_DIR)/downloads/nsync/public/
after line 36:
-L$(NSYNCLIBDIR) \
after line 43:
-I$(NSYNC) \
after line 51:
-lnsync \
change line 72 to:
$(EXECUTABLE_NAME): $(EXECUTABLE_OBJS) $(TFLIBS) $(NSYNCLIBS)
Hope it works with that changes, good luck :)

tensorflow build fail at october 6 2016

Ubuntu 16.04
gcc 5.4.0
java 1.8.0_91
bazel 0.3.1 (download the releases , haven't build from source because it build fail)
I change the config file follow the discussion here and here because it works for ./configure.
I clone the lastest code and configure without GPU. Here is my build instruction at the root directory of tensorflow
bazel build -c opt //tensorflow/tools/pip_package:build_pip_package
The error log:
ERROR: /home/gt/.cache/bazel/_bazel_gt/3d5d29ec73796bda2fc5b2dffed26f47/external/protobuf/BUILD:333:1: Linking of rule '#protobuf//:protoc' failed: gcc failed: error executing command /usr/bin/gcc -o bazel-out/host/bin/external/protobuf/protoc -Wl,-no-as-needed -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,--gc-sections ... (remaining 1 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
bazel-out/host/bin/external/protobuf/_objs/protoc/external/protobuf/src/google/protobuf/compiler/main.o: In function `main':
main.cc:(.text.startup.main+0x2db): undefined reference to `vtable for google::protobuf::compiler::php::Generator'
main.cc:(.text.startup.main+0x642): undefined reference to `vtable for google::protobuf::compiler::php::Generator'
main.cc:(.text.startup.main+0x740): undefined reference to `vtable for google::protobuf::compiler::php::Generator'
collect2: error: ld returned 1 exit status
Target //tensorflow/tools/pip_package:build_pip_package failed to build
Use --verbose_failures to see the command lines of failed build steps.
This is a bug in protobuf, we signaled it already two weeks ago. See https://github.com/google/protobuf/issues/2133

SyntaxNet Bazel build failed: gcc: error: unrecognized command line option '-h'

Trying to install SyntaxNet on Ubuntu 14.04 LTS, build fails with gcc unrecognized command line option '-h'.
Searched gcc documentation and there seems to be no such command line option.
Have anybody seen this?
sudo /home/user/bin/bazel test --linkopt=-headerpad_max_install_names --spawn_strategy=standalone --genrule_strategy=standalone \
syntaxnet/... util/utf8/...
INFO: Found 65 targets and 12 test targets...
ERROR: /home/user/.cache/bazel/_bazel_root/1a72b3057373bad6ae8a8f20db5423d4/external/re2/BUILD:9:1: Linking of rule '#re2//:re2' failed: gcc failed: error executing command /usr/bin/gcc -shared -o bazel-out/local-opt/bin/external/re2/libre2.so -pthread -no-canonical-prefixes -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' ... (remaining 3 argument(s) skipped): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
gcc: error: unrecognized command line option '-h'
INFO: Elapsed time: 0.857s, Critical Path: 0.45s

clang does not compile a simple c file

I've just installed clang in to cygwin:
clang version 3.1 (trunk 151024)
TargetL i386-pc-cygwin
Thread model: posix
However when trying to compile a simple c file (only main), the error occured:
clang version 3.1 (trunk 151024)
Target: i386-pc-cygwin
Thread model: posix
"/usr/local/bin/clang" -cc1 -triple i386-pc-cygwin -S -disable-free -main-file-name t.c -mrelocation-model static -mdisable-fp-elim -mconstructor-aliases -target-cpu pentium4 -momit-leaf-frame-pointer -v -resource-dir /usr/local/bin/../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -fno-dwarf-directory-asm -fdebug-compilation-dir /toolchain4 -ferror-limit 19 -fmessage-length 0 -mstackrealign -fno-use-cxa-atexit -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option -o /cygdrive/c/Users/Br0ther/AppData/Local/Temp/t-zyOz8h.s -x c t.c
clang: error: unable to execute command: Program could not be executed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information.
clang: error: unable to execute command: Program could not be executed
clang: note: diagnostic msg: Error generating preprocessed source(s).
Any body out there knows what causes the problem? I have no idea what is the meaning of the message:
clang: error: unable to execute command: Program could not be executed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
Your help is greatly appreciated
NK
If these two lines are worrying you:
clang: error: unable to execute command: Program could not be executed
clang: error: clang frontend command failed due to signal
(use -v to see invocation)
then might I suggest you (as suggested in the error message) change your command to see the invocation line it uses:
"/usr/local/bin/clang" -v -cc1 -triple i386-pc-cygwin ...
Then you will know the name of the program and you can investigate why it's not on your path (for example).
Thank you for all suggestions.
However, the issue is fixed by increasing the heap size of cygwin.
Thanks