I get a linking error after updating Movesense library from 1.8.1 to 1.9.0 in my project and even in the hello world sample project. Has anyone else has this problem and can offer a solution?
I am running the SDK on
Ubuntu 18.04.2 LTS
arm-none-eabi-gcc 7.3.1
Same problem with gcc-arm-none-eabi-7-2017-q4
Here is the output of the linking failure after calling ninja:
FAILED: Movesense
: && /usr/bin/arm-none-eabi-gcc -W -Wall -[...] ../platform/nRF5x/linker/gcc/appflash.ld CMakeFiles/Movesense.dir/App.cpp.obj CMakeFiles/Movesense.dir/HelloWorldService.cpp.obj CMakeFiles/Movesense.dir/generated/sbem-code/sbem_definitions.cpp.obj CMakeFiles/Movesense.dir/generated/app-resources/resources.cpp.obj CMakeFiles/Movesense.dir/app-metadata/metadata.cpp.obj -o Movesense /home/lukas/Projects/movesense/movesense-device-lib/MovesenseCoreLib/lib/GCCARM/libmovesense-coreD.a -lm -lstdc++ && :
lto1: internal compiler error: bytecode stream: expected tag round_div_expr instead of reference_type
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.
lto-wrapper: fatal error: /usr/bin/arm-none-eabi-gcc returned 1 exit status
compilation terminated.
/usr/bin/../lib/gcc/arm-none-eabi/7.3.1/../../../../arm-none-eabi/bin/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
With Movesense 1.8.1 everything works fine:
git checkout 38be3c2
[...]
cmake -G Ninja -DMOVESENSE_CORE_LIBRARY=../MovesenseCoreLib/ -DCMAKE_TOOLCHAIN_FILE=../MovesenseCoreLib/toolchain/gcc-nrf52.cmake ../samples/hello_world_app
[...]
ninja
[...]
[8/8] Linking CXX executable Movesense
Thanks in advance!
From CHANGES.md (& README.md) since 1.9.0
REQUIRED: Use Windows build environment only (due to above GNU OSX bug)
REQUIRED: Use GNU Toolchain for ARM v. 7.2.1 2017q4
This situation is unfortunate and will be rectified in the coming 2.0 release with a new docker based build environment.
Full Disclaimer: I work for the Movesense team
Related
I am trying to build a project (PDFium) using clang.
It keeps giving me this error
ld.lld: error: unable to find library -latomic
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
ninja: build stopped: subcommand failed.
I have these installed on my system
libatomic_ops 7.6.14-1
clang 14.0.6-2
lib32-clang 14.0.6-1
libatomic1
And about LD_LIBRARY_PATH
$ export LD_LIBRARY_PATH=/usr/lib64:/usr/lib32:/usr/local/lib:/usr/lib
$ sudo ldconfig
I have tried it on Debian, Arch and Ubuntu.
I have a C++ project with CMake build system. When I compile using GCC it compiles fine. But when I tried to use NDK toolchain, it shows the following error.
Linking CXX executable ../bin/my_app
/opt/r19c/linux-x86_64/toolchains/llvm/prebuilt/linux-x86_64/lib/gcc/aarch64-linux-android/4.9.x/../../../../aarch64-linux-android/bin/ld:
cannot find -lpthread
clang++: error: linker command failed with exit code 1 (use -v to see invocation)
How can I fix this issue?
I have been working this problem for more than a week. I installed the free version of QT off the QT site. I am trying to set up a cross compile environment for a Beaglebone Black ARM 8 platform. I have set up the compiler options using GNU ARM 6.3.0 GNU compiler -- The same compiler that is on my BBB. I successfully created the cross-compile environment and the Beaglebone device. The connect test worked correctly as well.
Here is the simple C++ application that I am trying to compile,
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
return 0;
}
Here is what my QT gcc compile options look like,
Here is my kit setup,
Here is my device setup,
When I build the default QT simple application I get these errors,
Running Windows Runtime device detection.
C:/Qt/5.11.0/winrt_armv7_msvc2015/bin/winrtrunner.exe --list-devices
Found 2 Windows Runtime devices.
Running "C:\Program Files (x86)\CMake\bin\cmake.exe -E server "--pipe=\.\pipe{2e664e46-cacb-46ae-b680-ed9c235dc502}" --experimental" in C:\Users\Stephen\AppData\Local\Temp\QtCreator-WLEKuI\qtc-cmake-IDzcFnnJ.
Starting to parse CMake project, using: "-DCMAKE_CXX_COMPILER:STRING=C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-g++.exe", "-DCMAKE_C_COMPILER:STRING=C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe", "-DCMAKE_PREFIX_PATH:STRING=", "-DQT_QMAKE_EXECUTABLE:STRING=".
The C compiler identification is GNU 6.3.0
The CXX compiler identification is GNU 6.3.0
Check for working C compiler: C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe
Check for working C compiler: C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe -- broken
CMake Error at C:/Program Files (x86)/CMake/share/cmake-3.10/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"C:/SysGCC/beaglebone-6.3.0/bin/arm-linux-gnueabihf-gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Stephen/AppData/Local/Temp/QtCreator-WLEKuI/qtc-cmake-IDzcFnnJ/CMakeFiles/CMakeTmp
Run Build Command:"C:/PROGRA~2/Ninja/ninja.exe" "cmTC_c3136"
[1/2] Building C object CMakeFiles/cmTC_c3136.dir/testCCompiler.c.obj
[2/2] Linking C executable cmTC_c3136.exe
FAILED: cmTC_c3136.exe
cmd.exe /C "cd . && C:\SysGCC\beaglebone-6.3.0\bin\arm-linux-gnueabihf-gcc.exe CMakeFiles/cmTC_c3136.dir/testCCompiler.c.obj -o cmTC_c3136.exe -Wl,--out-implib,libcmTC_c3136.dll.a -Wl,--major-image-version,0,--minor-image-version,0 && cd ."
c:/sysgcc/beaglebone-6.3.0/bin/../lib/gcc/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld.exe: unrecognized option '--major-image-version'
c:/sysgcc/beaglebone-6.3.0/bin/../lib/gcc/arm-linux-gnueabihf/6/../../../../arm-linux-gnueabihf/bin/ld.exe: use the --help option for usage information
collect2.exe: error: ld returned 1 exit status
ninja: build stopped: subcommand failed.
The build seems to issues a command to the GCC compiler suite to an executable called ld.exe. I verified the path to ld.exe and it is indeed in the directory and handles my "ld --version" command.The error messages show ld.exe '--major-image-version' and fails. ld.exe does not support --major-image-version. Not sure why it is issuing this command to ld.exe.
I know these compilers work as I have manually compiled this program using g++ 6.3.0 compiler. Any suggestions?
A make argument is wrong. Specifically:
unrecognized option '--major-image-version'
You should remove the argument "--major-image-version" from your project's Makefile LFLAGS.
On windows there are 3 makefiles, Makefile, Makefile.debug and Makefile.release
Remove the argument from the one matching your current build config.
So I have an AWS instance (the free tier one) running with Ubuntu 16.04. There I have installed nacl_sdk (which is working and has allowed me to access their sample sites with success) and naclports which I used to port opencv with which I had trouble with at first due to errors with zlib but got it working after I added i386 architecture and did sudo apt-get update on the system and installed necessary i386 programs.
Note I have depot_tools installed as well.
Now I am trying to install the eigen3 library for pnacl as well but I am getting an error and I am not sure how to understand it nor how exactly it gets built to fix it.
The command that I ported opencv with was
$ NACL_ARCH=pnacl make opencv
And I tried these two commands for building eigen3 with the same results (shown below)
$ NACL_ARCH=pnacl make eigen3
$ bin/webports install eigen3
This is the very end of terminal output (the entire message is very long):
######################################################################
Building eigen3
######################################################################
chdir /home/ubuntu/Work/ExternCode/naclports/src/out/build/eigen3/build_pnacl
make -j1 basicstuff cholesky determinant geo_transformations inverse
Scanning dependencies of target basicstuff
Building CXX object test/CMakeFiles/basicstuff.dir/basicstuff.cpp.o
Linking CXX executable basicstuff
Built target basicstuff
Scanning dependencies of target cholesky
[100%] Building CXX object test/CMakeFiles/cholesky.dir/cholesky.cpp.o
clang: error: unable to execute command: Killed
clang: error: clang frontend command failed due to signal (use -v to see invocation)
clang version 3.7.0 (https://chromium.googlesource.com/a/native_client/pnacl-clang.git cf0dc7f6e6123dfa9b8834b56743315300b34e6c) (https://chromium.googlesource.com/a/native_client/pnacl-llvm.git baa63524b6b493ec2a6aa2c5193d9f25c0c33191)
Target: le32-unknown-nacl
Thread model: posix
clang: note: diagnostic msg: PLEASE submit a bug report to http://llvm.org/bugs/ and include the crash backtrace, preprocessed source, and associated run script.
clang: note: diagnostic msg:
test/CMakeFiles/cholesky.dir/build.make:62: recipe for target 'test/CMakeFiles/cholesky.dir/cholesky.cpp.o' failed
make[3]: *** [test/CMakeFiles/cholesky.dir/cholesky.cpp.o] Error 254
CMakeFiles/Makefile2:14386: recipe for target 'test/CMakeFiles/cholesky.dir/all' failed
make[2]: *** [test/CMakeFiles/cholesky.dir/all] Error 2
CMakeFiles/Makefile2:14393: recipe for target 'test/CMakeFiles/cholesky.dir/rule' failed
make[1]: *** [test/CMakeFiles/cholesky.dir/rule] Error 2
Makefile:5128: recipe for target 'cholesky' failed
make: *** [cholesky] Error 2
webports: Build failed: 'eigen3' [pnacl/release]
clang: error: unable to execute command: Killed
It looks like your AWS instance killed clang, so perhaps it ran out of memory. The free tier gives 1 MiB of RAM and that might not be enough for what you're trying to do.
I'm trying to build tensorflow on Ubuntu 14.04 LTS with python 2.7, no GPU. when I run the following command on terminal followed from this tutorial:
bazel build tensorflow/examples/image_retraining:retrain
it says failed to build with log:
ERROR: /home/yuan/tensorflow_source/tensorflow/tensorflow/python/BUILD:1826:1: Linking of rule '//tensorflow/python:_pywrap_tensorflow.so' failed: gcc failed: error executing command
(cd /home/yuan/.cache/bazel/_bazel_yuan/e5b8b6538ba16bbae5b1e0f5c26b7a12/execroot/tensorflow && \
exec env - \
/usr/bin/gcc -shared -o bazel-out/local-fastbuild/bin/tensorflow/python/_pywrap_tensorflow.so -Wl,--version-script tensorflow/tf_version_script.lds -pthread -Wl,-no-as-needed -B/usr/bin -B/usr/bin -pass-exit-codes '-Wl,--build-id=md5' '-Wl,--hash-style=gnu' -Wl,-S -Wl,#bazel-out/local-fastbuild/bin/tensorflow/python/_pywrap_tensorflow.so-2.params): com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
bazel-out/local-fastbuild/bin/tensorflow/core/libversion_lib.a(version_info.pic.o): In function `tf_git_version()':
version_info.cc:(.text+0x0): multiple definition of `tf_git_version()'
bazel-out/local-fastbuild/bin/tensorflow/core/libframework_internal.lo(version_info.pic.o):version_info.cc:(.text+0x0): first defined here
bazel-out/local-fastbuild/bin/tensorflow/core/libversion_lib.a(version_info.pic.o): In function `tf_compiler_version()':
version_info.cc:(.text+0xd): multiple definition of `tf_compiler_version()'
bazel-out/local-fastbuild/bin/tensorflow/core/libframework_internal.lo(version_info.pic.o):version_info.cc:(.text+0xd): first defined here
collect2: error: ld returned 1 exit status
Target //tensorflow/examples/image_retraining:retrain failed to build
INFO: Elapsed time: 52.885s, Critical Path: 34.63s
Here's my build environment:
OS: Ubuntu 14.04 LTS 64 bit with RAM 12Gib
gcc version: 4.8.4
python version: 2.7.6
bazel version: 0.3.2
git version of tensorflow souce: v0.11.0rc0-1541-g3737ac3
Does anyone have idea to fix this error? Thanks a lot!
#David thanks for your help, it seems my ./configure result is not as expected.
I finally build successful by the following steps
sync tensorflow source to HEAD
run ./configure again, if have any error, refer to this.
run the build command again
bazel build tensorflow/examples/image_retraining:retrain
And my build result will have no error.