Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arm cross-compile fail #549

Closed
gangm opened this issue Apr 24, 2017 · 9 comments
Closed

arm cross-compile fail #549

gangm opened this issue Apr 24, 2017 · 9 comments

Comments

@gangm
Copy link

gangm commented Apr 24, 2017

hello,

I tried to port dlib to our armv7 platform, but got a problem when compling, see below:
[ 8%] Building CXX object dlib/CMakeFiles/dlib.dir/linker/linker_kernel_1.cpp.o
In file included from /home/gangm/arm-linux/dlib/dlib/bsp/../sockets/../threads.h:22:0,
from /home/gangm/arm-linux/dlib/dlib/bsp/../sockets/sockets_kernel_2.h:33,
from /home/gangm/arm-linux/dlib/dlib/bsp/../sockets/posix.h:4,
from /home/gangm/arm-linux/dlib/dlib/bsp/../sockets.h:14,
from /home/gangm/arm-linux/dlib/dlib/bsp/bsp.h:7,
from /home/gangm/arm-linux/dlib/dlib/bsp/bsp.cpp:6:
/home/gangm/arm-linux/dlib/dlib/bsp/../sockets/../threads/thread_pool_extension.h:456:21: error: 'exception_ptr' in namespace 'std' does not name a type

seems our arm compiler don't support std::exception_ptr, does anyone got the same problem? which arm compiler support this c++11 fature? thanks~

the version of our arm compiler is:
arm-none-linux-gnueabi-g++ (Sourcery CodeBench Lite 2013.05-24) 4.7.3
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

i also tried 4.8.3, but no work yet...

@gangm gangm closed this as completed Apr 27, 2017
@padmalcom
Copy link

Can you please explain why you closed this issue? I'm stuck here as well, if you have a solution please tell us.

@davisking
Copy link
Owner

You just need a C++11 compiler.

@padmalcom
Copy link

I call "cmake -DCMAKE_C_FLAGS="-O3 -mfpu=neon -fprofile-use -DENABLE_NEON" -DNEON=ON -DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabi-gcc -DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabi-g++ -DCMAKE_CXX_FLAGS="-std=c++11" --build --config Release ..". But I keep getting this error.

@padmalcom
Copy link

I figured out I had to use arm-linux-gnueabihf-gcc and arm-linux-gnueabihf-g++

@heweiSing
Copy link

I try to build for armv7:
"
dlib-19.8/build$ cmake -DCMAKE_C_FLAGS=”-O3 -mfpu=neon -fprofile-use -DENABLE_NEON” -DNEON=ON -DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabihf-g++ -DCMAKE_CXX_FLAGS=”-std=c++11″ –build –config Release ..
Parse error in command line argument: -DENABLE_NEON”
Should be: VAR:type=value
CMake Error: No cmake script provided.
CMake Error: Problem processing arguments. Aborting.
"
But got the above error, any suggestion?

Thanks and best regards

@heweiSing
Copy link

Ok. Now I can build it successfully. and Any script / procedures to install on target ARM platform?

Thanks and best regards
He Wei

@trohit920
Copy link

trohit920 commented Oct 11, 2018

@davisking @padmalcom @heweiSing Hello, I have successfully cross-compiled dlib for arm-architecture. However i am getting an error like:

/usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lX11
collect2: error: ld returned 1 exit status

My command line arguments are:
arm-linux-gnueabihf-g++ -std=c++11 -o3 -I/home/rohit/rohit/dlib /home/rohit/rohit/dlib/dlib/all/source.cpp -lpthread -lX11 webcam_face_pose_ex.cpp -o webcampkg-config --cflags --libs opencv`

I have installed libX11-dev and it is present in /usr/lib folder. I am wondering is it because my libX11 is not for arm. Please help me with this. Waiting of your replies.

@trohit920
Copy link

I have solved the above error by using libX11 for arm-architecture. However i am getting another error while trying to compile the reference example:

/usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/lib/../lib/libX11.so: undefined reference to `fcntl@GLIBC_2.28'
collect2: error: ld returned 1 exit status

Please take a look at this.

@gianlazz
Copy link

I try to build for armv7:
"
dlib-19.8/build$ cmake -DCMAKE_C_FLAGS=”-O3 -mfpu=neon -fprofile-use -DENABLE_NEON” -DNEON=ON -DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabihf-g++ -DCMAKE_CXX_FLAGS=”-std=c++11″ –build –config Release ..
Parse error in command line argument: -DENABLE_NEON”
Should be: VAR:type=value
CMake Error: No cmake script provided.
CMake Error: Problem processing arguments. Aborting.
"
But got the above error, any suggestion?

Thanks and best regards

@heweiSing

I'm having the same > Parse error in command line argument: -DENABLE_NEON” issue. Your comment is one of only a couple online mentioning it. How did you solve it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants