Using a Ubuntu 12.04 host, I carefully followed this SO answer here (Recipe for Compiling Binutils and GCC Together) to build GCC and binutils in one tree with all of their dependencies.
Here is the configure line I am doing inside my build directory:
../gcc-4.9.0/configure --target=arm-linux-gnueabi --prefix=/home/mint/cross-arm --disable-werror
The Makefile configures correctly and afterwards I run:
sudo make -j8
I get into the compilation process for some time then eventually it errors out here:
In file included from ../../../gcc-4.9.0/libgcc/gthr.h:148:0,
from ../../../gcc-4.9.0/libgcc/libgcov-interface.c:27:
./gthr-default.h:35:21: fatal error: pthread.h: No such file or directory
#include <pthread.h>
^
compilation terminated.
make[2]: *** [_gcov_flush.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from ../../../gcc-4.9.0/libgcc/gthr.h:148:0,
from ../../../gcc-4.9.0/libgcc/libgcov-interface.c:27:
./gthr-default.h:35:21: fatal error: pthread.h: No such file or directory
#include <pthread.h>
^
compilation terminated.
make[2]: *** [_gcov_execlp.o] Error 1
In file included from ../../../gcc-4.9.0/libgcc/gthr.h:148:0,
from ../../../gcc-4.9.0/libgcc/libgcov-interface.c:27:
./gthr-default.h:35:21: fatal error: pthread.h: No such file or directory
#include <pthread.h>
^
In file included from ../../../gcc-4.9.0/libgcc/gthr.h:148:0,
from ../../../gcc-4.9.0/libgcc/libgcov-interface.c:27:
./gthr-default.h:35:21: fatal error: pthread.h: No such file or directory
#include <pthread.h>
^
compilation terminated.
make[2]: compilation terminated.
*** [_gcov_fork.o] Error 1
make[2]: *** [_gcov_execl.o] Error 1
In file included from ../../../gcc-4.9.0/libgcc/gthr.h:148:0,
from ../../../gcc-4.9.0/libgcc/libgcov-interface.c:27:
./gthr-default.h:35:21: fatal error: pthread.h: No such file or directory
#include <pthread.h>
^
compilation terminated.
make[2]: *** [_gcov_execle.o] Error 1
make[2]: Leaving directory `/home/mint/Workspaces/src/build/arm-linux-gnueabi/libgcc'
make[1]: *** [all-target-libgcc] Error 2
make[1]: Leaving directory `/home/mint/Workspaces/src/build'
make: *** [all] Error 2
Am I missing a certain dependency that is preventing this build?
P.S. I installed 'build-essential' via apt-get before the build.
The error suggests some issue with the C library.
For building the GCC compiler, you need prebuilt binutils + prebuilt C library.
In case of cross compiler, one possible route is :
Ensure that you have prebuilt binutils (cross compile build)
Cross compile GCC :
Add Configure option --without-headers. Now compile (see make targets in the link below)
Compile your C library and point to it when compiling your program for the target
See some instructions for cross-compiling gcc here GCC Cross Compiling. Then "install" the appropriate C library (glibc / newlib).
Also, (if you are not already doing it) it may be worthwhile to ensure that the --prefix for bintutils and the gcc cross compile build are the same location.
Related
am trying to compile erlang code using command 'make' on erlang.mk and getting the below error. i dont know where to go from here. am new to erlang.mk and erlang. am on ubuntu
Getting Xabber Web client .... done.
Copying Xabber Web files to 'priv' directory ........ done.
make[1]: Entering directory '/home/isachi2004/xabber-websocket
/deps/fast_xml'
cc -o priv/lib/fxml.so c_src/fxml.o -lexpat -L -lei -shared
/usr/bin/ld: cannot find -lexpat
collect2: error: ld returned 1 exit status
c_src/Makefile.erlang.mk:24: recipe for target 'priv/lib/fxml.so'
failed
make[2]: *** [priv/lib/fxml.so] Error 1
Makefile:25: recipe for target 'pre-app' failed
make[1]: *** [pre-app] Error 2
make[1]: Leaving directory '/home/isachi2004/xabber-websocket
/deps/fast_xml'
erlang.mk:4512: recipe for target 'deps' failed
make: *** [deps] Error 2
This error means that it cannot find the development files for the Expat library (an XML parser):
/usr/bin/ld: cannot find -lexpat
On Ubuntu, you could try installing it with:
sudo apt install libexpat1-dev
I've installed zlib library but when I am compiling this project - https://github.com/mgbellemare/Arcade-Learning-Environment -
it gives me an error not found zlib.
When I run
gcc -o a a.c ; ./a
where a.c file uses "#include "
I've tried these flags
-DZLIB_LIBRARY:FILEPATH
-DZLIB_INCLUDE_DIR:PATH
-ZLIB_CFLAGS=" " ZLIB_LIBS="-lz"
-lz
and recompile the cmake package from source
/home/mostafa/Documents/temp/Arcade-Learning-Environment/src/common/ScreenExporter.cpp:18:10: fatal error: zlib.h: No such file or directory
#include <zlib.h>
^~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/ale-bin.dir/build.make:183: CMakeFiles/ale-bin.dir/src/common/ScreenExporter.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:100: CMakeFiles/ale-bin.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
I just figured it out, I had to create a new user and things worked
I am having an issue installing OpenCaffe. Make producing the following CMakeError file. I have installed all the dependencies as instructed. Python is anaconda 4.2.0
Should I use a different version of python or is there something I've missed?
Determining if the pthread_create exist failed with the following output:
Change Dir: /home/mlogin/temporal-segment-networks/lib/caffe-action/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_1d0f6/fast"
/usr/bin/make -f CMakeFiles/cmTC_1d0f6.dir/build.make CMakeFiles/cmTC_1d0f6.dir/build
make[1]: Entering directory '/home/mlogin/temporal-segment-networks/lib/caffe-action/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_1d0f6.dir/CheckSymbolExists.c.o
/usr/bin/cc -o CMakeFiles/cmTC_1d0f6.dir/CheckSymbolExists.c.o -c /home/mlogin/temporal-segment-networks/lib/caffe-action/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_1d0f6
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_1d0f6.dir/link.txt --verbose=1
/usr/bin/cc CMakeFiles/cmTC_1d0f6.dir/CheckSymbolExists.c.o -o cmTC_1d0f6 -rdynamic
CMakeFiles/cmTC_1d0f6.dir/CheckSymbolExists.c.o: In function `main':
CheckSymbolExists.c:(.text+0x16): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_1d0f6.dir/build.make:97: recipe for target 'cmTC_1d0f6' failed
make[1]: *** [cmTC_1d0f6] Error 1
make[1]: Leaving directory '/home/mlogin/temporal-segment-networks/lib/caffe-action/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_1d0f6/fast' failed
make: *** [cmTC_1d0f6/fast] Error 2
File /home/mlogin/temporal-segment-networks/lib/caffe-action/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:
/* */
#include <pthread.h>
int main(int argc, char** argv)
{
(void)argv;
#ifndef pthread_create
return ((int*)(&pthread_create))[argc];
#else
(void)argc;
return 0;
#endif
}
Determining if the function pthread_create exists in the pthreads failed with the following output:
Change Dir: /home/mlogin/temporal-segment-networks/lib/caffe-action/build/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/make" "cmTC_9f6ec/fast"
/usr/bin/make -f CMakeFiles/cmTC_9f6ec.dir/build.make CMakeFiles/cmTC_9f6ec.dir/build
make[1]: Entering directory '/home/mlogin/temporal-segment-networks/lib/caffe-action/build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_9f6ec.dir/CheckFunctionExists.c.o
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create -o CMakeFiles/cmTC_9f6ec.dir/CheckFunctionExists.c.o -c /usr/share/cmake-3.5/Modules/CheckFunctionExists.c
Linking C executable cmTC_9f6ec
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_9f6ec.dir/link.txt --verbose=1
/usr/bin/cc -DCHECK_FUNCTION_EXISTS=pthread_create CMakeFiles/cmTC_9f6ec.dir/CheckFunctionExists.c.o -o cmTC_9f6ec -rdynamic -lpthreads
/usr/bin/ld: cannot find -lpthreads
collect2: error: ld returned 1 exit status
CMakeFiles/cmTC_9f6ec.dir/build.make:97: recipe for target 'cmTC_9f6ec' failed
make[1]: *** [cmTC_9f6ec] Error 1
make[1]: Leaving directory '/home/mlogin/temporal-segment-networks/lib/caffe-action/build/CMakeFiles/CMakeTmp'
Makefile:126: recipe for target 'cmTC_9f6ec/fast' failed
make: *** [cmTC_9f6ec/fast] Error 2
This is the output of the console (repeated a number of times for different targets)
CMake Error at cuda_compile_generated_threshold_layer.cu.o.cmake:207 (message):
Error generating
/home/mlogin/temporal-segment-networks/lib/caffe-action/build/src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_threshold_layer.cu.o
src/caffe/CMakeFiles/caffe.dir/build.make:56765: recipe for target 'src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_threshold_layer.cu.o' failed
make[2]: *** [src/caffe/CMakeFiles/cuda_compile.dir/layers/cuda_compile_generated_threshold_layer.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs....
cc: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-5/README.Bugs> for instructions.
CMake Error at cuda_compile_generated_roi_pooling_layer.cu.o.cmake:207 (message):
Error generating
/home/mlogin/temporal-segment-networks/lib/caffe-action/build/src/caffe/CMakeFiles/cuda_compile.dir/layers/./cuda_compile_generated_roi_pooling_layer.cu.o
I try to build graphviz from git http://github.com/ellson/graphviz/
It stop building with this message
make[2]: Leaving directory `/home/peter/work/sdk/graphviz/graphviz-src/graphviz/cmd/gvedit'
CXX gvedit-moc_csettings.o
CXX gvedit-moc_imageviewer.o
CXX gvedit-moc_mainwindow.o
CXX gvedit-moc_mdichild.o
CXX gvedit-qrc_mdi.o
CXXLD gvedit
/usr/bin/ld: gvedit-mainwindow.o: undefined reference to symbol 'agseterrf'
/home/peter/work/sdk/graphviz/graphviz-src/graphviz/lib/cgraph/.libs/libcgraph.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make[1]: *** [gvedit] Error 1
make[1]: Leaving directory `/home/peter/work/sdk/graphviz/graphviz-src/graphviz/cmd/gvedit'
make: *** [all-recursive] Error 1
Can you point me to the problem?
I found this issue on the github repo: https://github.com/ellson/graphviz/issues/1
It appears there is some issue with the perl plugin, for me building with
./configure --enable-perl=no
was enough to fix the issue (and I didn't lose any functionality I need).
I'm trying to cross compile a package applicaiton with gcc-eabi. I have modified the configuration file to point to all the target directories. But the linker still gives an error when linking some shared libraries. The exact error is below:
Linking CXX shared library /home/aeodrs/JAUS++-2.110519-src/libraries/jaus++/2.0/lib /libcxutils.so
/home/aeodrs/JAUS++-2.110519-src/libraries/jaus++/2.0/lib/libcxjpeg-6b.a: could not read symbols: File format not recognized collect2: ld returned 1 exit status
make[2]: *** [/home/aeodrs/JAUS++-2.110519-src/libraries/jaus++/2.0/lib/libcxutils.so] Error 1
make[1]: *** [libcxutils/CxUtils/libcxutils/CMakeFiles/cxutils.dir/all] Error 2
make: *** [all] Error 2
aeodrs#ubuntu:~/JAUS++-2.110519-src/libraries/jaus++/2.0/build/cmake$
I'm not sure why the linker can't read or is corrupting the library file.