Improve build speed ?

VLC for Android and Chrome OS specific usage questions
Fradow
Blank Cone
Blank Cone
Posts: 22
Joined: 10 Jan 2014 17:44

Improve build speed ?

Postby Fradow » 23 Jan 2014 16:49

ndk-build allow to speed the build speed by using several threads, using the -jX option (where X is the number of core you want to use).

In VLC, it is set to -j1. After trying to change it to -j8, it seems there is a good reason for it : by doing so, weird compilation errors happens (mainly File Truncated, missing file etc ...), which all seem to be related to multi-threading not properly synchronized.

From what I remember, it seems to be caused by the fact that there are several modules in the same Android.mk, something ndk-build doesn't like.

Is modifying that something planned or is fixing that too hard ?

On ndk-r9, there are also warnings due to how external libraries are referenced in Android.mk (WARNING:jni/Android.mk:vlcjni: non-system libraries in linker flags: [...] This is likely to result in incorrect builds. Try using LOCAL_STATIC_LIBRARIES or LOCAL_SHARED_LIBRARIES instead to list the library dependencies of the current module)

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Improve build speed ?

Postby edwardw » 25 Jan 2014 20:23

Well, the bulk of compilation take is taken up in building the native libVLC, and not so much in building the Java/JNI portion.

Fradow
Blank Cone
Blank Cone
Posts: 22
Joined: 10 Jan 2014 17:44

Re: Improve build speed ?

Postby Fradow » 27 Jan 2014 17:40

Thanks for the reply. I'll see if I can do something on my side, since I have multiple other C/C++ files to compile.

An another note, how do you compile for armeabi, armeabi-v7a and x86 all at the same time ? Even a ./compile.sh release only build the ANDROID_ABI architecture, and all the script rely on ANDROID_ABI containing only one architecture.

Do I have to run the script 3 times and change ANDROID_ABI each time and remove the part of the script cleaning the libs folder ?

edwardw
Big Cone-huna
Big Cone-huna
Posts: 2346
Joined: 24 Jun 2012 23:36
VLC version: 3.0.0-git

Re: Improve build speed ?

Postby edwardw » 27 Jan 2014 17:44

Yes, you could run them in parallel in three folders.

Fradow
Blank Cone
Blank Cone
Posts: 22
Joined: 10 Jan 2014 17:44

Re: Improve build speed ?

Postby Fradow » 27 Jan 2014 17:46

Ok, thanks.


Return to “VLC for Android and Chrome OS”

Who is online

Users browsing this forum: No registered users and 8 guests