Cross compiling using cmake

14 views
Skip to first unread message

Dibet Garcia

unread,
Jun 5, 2019, 9:34:53 AM6/5/19
to Protocol Buffers
Hi, iam using the following command

 cmake -D BUILD_SHARED_LIBS=ON -D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabihf-g++ -DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabihf-gcc -DCMAKE_AR=/usr/bin/arm-linux-gnueabihf-ar  ..

How i can especify the protoc binary file ?

My host is an intel with linux and the target is and odroid with linux too.

Thanks in advance
Dibet

Dibet Garcia

unread,
Jun 5, 2019, 9:52:09 AM6/5/19
to Protocol Buffers

I change my cmake command line to

cmake -D BUILD_SHARED_LIBS=ON -D CMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER=/usr/bin/arm-linux-gnueabihf-g++ -DCMAKE_C_COMPILER=/usr/bin/arm-linux-gnueabihf-gcc -DCMAKE_AR=/usr/bin/arm-linux-gnueabihf-ar CMAKE_INSTALL_PREFIX=/opt/arm-local/protobuf ..

When i run "make", see the following error:

[ 48%] Generating /opt/tensorflow/tensorflow/contrib/makefile/downloads/protobuf/src/google/protobuf/unittest_no_arena_lite.pb.cc
./protoc: 1: ./protoc: Syntax error: word unexpected (expecting ")")
CMakeFiles/lite-test.dir/build.make:82: recipe for target '/opt/tensorflow/tensorflow/contrib/makefile/downloads/protobuf/src/google/protobuf/unittest_no_arena_lite.pb.cc' failed
make[2]: *** [/opt/tensorflow/tensorflow/contrib/makefile/downloads/protobuf/src/google/protobuf/unittest_no_arena_lite.pb.cc] Error 2
CMakeFiles/Makefile2:215: recipe for target 'CMakeFiles/lite-test.dir/all' failed
make[1]: *** [CMakeFiles/lite-test.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Reply all
Reply to author
Forward
0 new messages