GithubHelp home page GithubHelp logo

build for ARM about td HOT 9 CLOSED

doctorrokter avatar doctorrokter commented on April 30, 2024 2
build for ARM

from td.

Comments (9)

levlam avatar levlam commented on April 30, 2024 1

Some TDLib sources are generated and that can't be done directly when the library is cross-compiled. You need to run ones a native build to generate these sources before running cross-compilation:
mkdir build_native
cd build_native
cmake ..
cmake --build . --target prepare_cross_compiling

from td.

doctorrokter avatar doctorrokter commented on April 30, 2024

Thanks for response!

Tried, but no luck.. Same error message as above, but in another place:

doctorrokter@MISHA-PC:~/dev/td/build$ cmake --build . --target prepare_cross_compiling
Scanning dependencies of target tdtl
[  0%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_config.cpp.o
[ 12%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_core.cpp.o
[ 12%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_file_outputer.cpp.o
[ 12%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_generate.cpp.o
[ 12%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_outputer.cpp.o
[ 25%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_string_outputer.cpp.o
[ 25%] Building CXX object tdtl/CMakeFiles/tdtl.dir/td/tl/tl_writer.cpp.o
[ 25%] Linking CXX static library libtdtl.a
[ 25%] Built target tdtl
Scanning dependencies of target generate_common
[ 25%] Building CXX object td/generate/CMakeFiles/generate_common.dir/generate_common.cpp.o
[ 37%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_cpp.cpp.o
[ 37%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_h.cpp.o
[ 37%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_hpp.cpp.o
[ 50%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_jni_cpp.cpp.o
[ 50%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_jni_h.cpp.o
[ 50%] Building CXX object td/generate/CMakeFiles/generate_common.dir/tl_writer_td.cpp.o
[ 62%] Linking CXX executable generate_common
[ 62%] Built target generate_common
Scanning dependencies of target tl_generate_common
[ 75%] Generate common tl source files
/home/doctorrokter/dev/td/build/td/generate/generate_common: 1: /home/doctorrokter/dev/td/build/td/generate/generate_common: Syntax error: word unexpected (expecting ")")
td/generate/CMakeFiles/tl_generate_common.dir/build.make:61: recipe for target 'td/generate/CMakeFiles/tl_generate_common' failed
make[3]: *** [td/generate/CMakeFiles/tl_generate_common] Error 2
CMakeFiles/Makefile2:708: recipe for target 'td/generate/CMakeFiles/tl_generate_common.dir/all' failed
make[2]: *** [td/generate/CMakeFiles/tl_generate_common.dir/all] Error 2
CMakeFiles/Makefile2:242: recipe for target 'CMakeFiles/prepare_cross_compiling.dir/rule' failed
make[1]: *** [CMakeFiles/prepare_cross_compiling.dir/rule] Error 2
Makefile:225: recipe for target 'prepare_cross_compiling' failed
make: *** [prepare_cross_compiling] Error 2

from td.

levlam avatar levlam commented on April 30, 2024

Could you show output of
make VERBOSE=1 prepare_cross_compiling
?

from td.

doctorrokter avatar doctorrokter commented on April 30, 2024

Yep, sure:

make VERBOSE=1 prepare_cross_compiling
/usr/bin/cmake -H/root/dev/td -B/root/dev/td/build --check-build-system CMakeFiles/Makefile.cmake 0
make -f CMakeFiles/Makefile2 prepare_cross_compiling
make[1]: Entering directory '/root/dev/td/build'
/usr/bin/cmake -H/root/dev/td -B/root/dev/td/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /root/dev/td/build/CMakeFiles 8
make -f CMakeFiles/Makefile2 CMakeFiles/prepare_cross_compiling.dir/all
make[2]: Entering directory '/root/dev/td/build'
make -f tdtl/CMakeFiles/tdtl.dir/build.make tdtl/CMakeFiles/tdtl.dir/depend
make[3]: Entering directory '/root/dev/td/build'
cd /root/dev/td/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/dev/td /root/dev/td/tdtl /root/dev/td/build /root/dev/td/build/tdtl /root/dev/td/build/tdtl/CMakeFiles/tdtl.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/root/dev/td/build'
make -f tdtl/CMakeFiles/tdtl.dir/build.make tdtl/CMakeFiles/tdtl.dir/build
make[3]: Entering directory '/root/dev/td/build'
make[3]: Nothing to be done for 'tdtl/CMakeFiles/tdtl.dir/build'.
make[3]: Leaving directory '/root/dev/td/build'
[ 25%] Built target tdtl
make -f td/generate/CMakeFiles/generate_common.dir/build.make td/generate/CMakeFiles/generate_common.dir/depend
make[3]: Entering directory '/root/dev/td/build'
cd /root/dev/td/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/dev/td /root/dev/td/td/generate /root/dev/td/build /root/dev/td/build/td/generate /root/dev/td/build/td/generate/CMakeFiles/generate_common.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/root/dev/td/build'
make -f td/generate/CMakeFiles/generate_common.dir/build.make td/generate/CMakeFiles/generate_common.dir/build
make[3]: Entering directory '/root/dev/td/build'
make[3]: Nothing to be done for 'td/generate/CMakeFiles/generate_common.dir/build'.
make[3]: Leaving directory '/root/dev/td/build'
[ 62%] Built target generate_common
make -f td/generate/CMakeFiles/tl_generate_common.dir/build.make td/generate/CMakeFiles/tl_generate_common.dir/depend
make[3]: Entering directory '/root/dev/td/build'
cd /root/dev/td/build && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /root/dev/td /root/dev/td/td/generate /root/dev/td/build /root/dev/td/build/td/generate /root/dev/td/build/td/generate/CMakeFiles/tl_generate_common.dir/DependInfo.cmake --color=
make[3]: Leaving directory '/root/dev/td/build'
make -f td/generate/CMakeFiles/tl_generate_common.dir/build.make td/generate/CMakeFiles/tl_generate_common.dir/build
make[3]: Entering directory '/root/dev/td/build'
[ 75%] Generate common tl source files
cd /root/dev/td/td/generate && /root/dev/td/build/td/generate/generate_common
/root/dev/td/build/td/generate/generate_common: 1: /root/dev/td/build/td/generate/generate_common: Syntax error: word unexpected (expecting ")")
td/generate/CMakeFiles/tl_generate_common.dir/build.make:61: recipe for target 'td/generate/CMakeFiles/tl_generate_common' failed
make[3]: *** [td/generate/CMakeFiles/tl_generate_common] Error 2
make[3]: Leaving directory '/root/dev/td/build'
CMakeFiles/Makefile2:707: recipe for target 'td/generate/CMakeFiles/tl_generate_common.dir/all' failed
make[2]: *** [td/generate/CMakeFiles/tl_generate_common.dir/all] Error 2
make[2]: Leaving directory '/root/dev/td/build'
CMakeFiles/Makefile2:242: recipe for target 'CMakeFiles/prepare_cross_compiling.dir/rule' failed
make[1]: *** [CMakeFiles/prepare_cross_compiling.dir/rule] Error 2
make[1]: Leaving directory '/root/dev/td/build'
Makefile:225: recipe for target 'prepare_cross_compiling' failed
make: *** [prepare_cross_compiling] Error 2

Also, found this https://stackoverflow.com/questions/36725864/syntax-error-word-unexpected-expecting
But not sure that it can help.

from td.

arseny30 avatar arseny30 commented on April 30, 2024

I could guess you are trying to call make prepare_cross_compiling with arm complier. It should be run in a separate build directory with a native compiler.

The original problem is probably because CMAKE_CROSSCOMPILING is not set.

from td.

doctorrokter avatar doctorrokter commented on April 30, 2024

Oh, I'm confused much more :)

Let's start from scratch.
The goal: build native telegram app for BlackBerry 10 with branded UI. For this I need 2 versions of TDlib - x86 (for running on bb10 simulator on x86 machine) and arm (for running on device). The built libs need to be included in Momentics IDE and then use it in my code (Qt4.8 app).
As described above, there are no problems with x86 build, I made all by instructions provided in Readme.md, and installed compiled libs into my custom dir.

Then I removed the build directory, configured cross compiler:

export CROSS=/home/doctorrokter/dev/arm/gcc-linaro-7.2.1/bin/arm-linux-gnueabihf
export CC=${CROSS}-gcc
export CXX=${CROSS}-g++

mkdir build // create from scratch
cd build
cmake -DCMAKE_INSTALL_PREFIX=/my_dir -DCMAKE_BUILD_TYPE=Release -DCMAKE_CROSSCOMPILING=True ..

This should configure with cross compiler. And when I run

cmake --build . // command from build instructions
OR
cmake --build. --target prepare_cross_compiling

it uses provided cross compiler and fails with error above. How to run prepare_cross_compiling with native compiler if build dir already configured for cross compiler?

from td.

arseny30 avatar arseny30 commented on April 30, 2024

You should run prepare_cross_compiling from a separate build directory.

from td.

doctorrokter avatar doctorrokter commented on April 30, 2024

Yes, finally! This did the trick.
It also required some manual work from me (for example, I got error during generate_common target and solved it by copying generate_common file from build_native to build dir and so on) , but all is ok.
Thank you guys for helping!

from td.

davtur19 avatar davtur19 commented on April 30, 2024

I'm having trouble compiling for armv7 (for the raspberry), I did not understand how you solved it; I tried all but once done prepare_cross_compiling, then when I start compiling it does for x86 instead of arm although I have set the libraries for arm

Could you write me all the steps to fill out correctly for arm?

from td.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.