Page 1 of 1

Improve build speed ?

Posted: 23 Jan 2014 16:49
by Fradow
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)

Re: Improve build speed ?

Posted: 25 Jan 2014 20:23
by edwardw
Well, the bulk of compilation take is taken up in building the native libVLC, and not so much in building the Java/JNI portion.

Re: Improve build speed ?

Posted: 27 Jan 2014 17:40
by Fradow
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 ?

Re: Improve build speed ?

Posted: 27 Jan 2014 17:44
by edwardw
Yes, you could run them in parallel in three folders.

Re: Improve build speed ?

Posted: 27 Jan 2014 17:46
by Fradow
Ok, thanks.