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

Problem building lib on arbian for Java. #152

Closed
Systemoutprintln7 opened this issue Mar 20, 2018 · 6 comments
Closed

Problem building lib on arbian for Java. #152

Systemoutprintln7 opened this issue Mar 20, 2018 · 6 comments

Comments

@Systemoutprintln7
Copy link

Systemoutprintln7 commented Mar 20, 2018

I'm using raspberry pi with ARMBIAN 5.33 Debian GNU/Linux 8 (jessie) 4.9.80-v7+.
Following the guide for building java, i'm having this issue when running "cmake --build . --target install
" command.

[ 0%] Generate git_commit.h
/bin/sh: 1: ./gen_git_commit_h.sh: Permission denied
CMakeFiles/git_commit.dir/build.make:49: recipe for target 'CMakeFiles/git_commit' failed
make[2]: *** [CMakeFiles/git_commit] Error 126
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/git_commit.dir/all' failed
make[1]: *** [CMakeFiles/git_commit.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2

Any help?

@levlam
Copy link
Contributor

levlam commented Mar 20, 2018

It looks like some user access rights are completely messed. You need to try to remove everything, clone TDLib source again and try to compile it from scratch without switching between different users.

@Systemoutprintln7
Copy link
Author

Systemoutprintln7 commented Mar 20, 2018

Ok, im trying to. Is taking so much time. Isnt there any kind of "lightweight" version for this? Or cant i compile it from an other machine to make it work on raspberry pi?

Update:
After cloning again the repository, i tried to build it but it get stuck at 38% when trying to build AnimationManager.cpp.o. System does freeze and cant finish building it. I'm trying to wait a bit more.

Update 2:
After 2 hours stucked, it gave me this error:

c++: internal compiler error: Killed (program cc1plus)
Please Submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-4.9/README.Bugs for instructions.
CMakeFiles/tdcore.dir/build.make:307: recipe for target 'CMakeFiles/tdcore.dir/td/telegram/AnimationsManager.cpp.o' failed
make[2]: *** [CMakeFiles/tdcore.dir/td/telegram/AnimationsManager.cpp.o] Error 4
CMakeFiles/Makefile2:251: recipe for target 'CMakeFiles/tdcore.dir/all' failed
make[1] *** [CMakeFiles/tdcore.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

Probabily is something releated to rpi low memory?

@isopen
Copy link
Contributor

isopen commented Mar 21, 2018

If you have 1GB of RAM better to assemble under another machine.
Try to build Linux from sources on such characteristics :)
Try the ninja. Joke.
Try make -j 1
If it does not help make -j 0.5 make -j 0 make -j -0.5. Joke.
The most trash will start after 50%...
Set the limits for RAM consumption at the level of the axis. Wait a few days.
For example, the lift at assembly is not more than 512mb.

P.S.

With @arseny30 we already tried to blow up my computer #6

@Systemoutprintln7
Copy link
Author

Systemoutprintln7 commented Mar 22, 2018

I tryied to compile it again with 2gb of swap and clang.

I'm having this error.

[ 92%] Building CXX object benchmark/CMakeFiles/bench_misc.dir/bench_misc.cpp.o
fatal error: error in backend: Cannot select: 0x5d77fa0: i32 = truncate 0x5b226a8
0x5b226a8: f64,ch = CopyFromReg 0x1b2eaa8, Register:f64 %vreg0
0x5b22608: f64 = Register %vreg0
In function: _ZN2td9TimeBench3runEi
clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
clang version 3.8.1-24+rpi1 (tags/RELEASE_381/final)
Target: armv6--linux-gnueabihf
Thread model: posix
InstalledDir: /usr/bin
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:


PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang: note: diagnostic msg: /tmp/bench_misc-ab2a3f.cpp
clang: note: diagnostic msg: /tmp/bench_misc-ab2a3f.sh
clang: note: diagnostic msg:


benchmark/CMakeFiles/bench_misc.dir/build.make:62: recipe for target 'benchmark/CMakeFiles/bench_misc.dir/bench_misc.cpp.o' failed
make[2]: *** [benchmark/CMakeFiles/bench_misc.dir/bench_misc.cpp.o] Error 70
CMakeFiles/Makefile2:1535: recipe for target 'benchmark/CMakeFiles/bench_misc.dir/all' failed
make[1]: *** [benchmark/CMakeFiles/bench_misc.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2

Can anyone help me?
Is there a way to crosscompile for arm?

@levlam
Copy link
Contributor

levlam commented Mar 22, 2018

It is a bug in clang. Just delete that code in benchmark/bench_misc.cpp:

// Too hard for android clang (?)
BENCH(Time, "Clocks::monotonic") {
  double res = 0;
  for (int i = 0; i < n; i++) {
    res += Clocks::monotonic();
  }
  do_not_optimize_away(res);
}

@Systemoutprintln7
Copy link
Author

It worked.
I've been also able to fix the first issue caused from the partition where i was trying to build the lib. Just had to remove the "no exec" flag. Hope it helps.
Thank you for support.

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

3 participants