Dolphin, the GameCube and Wii emulator - Forums

Full Version: Building from Source
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
So I'm trying to build from source so that I can test reverting a couple of commits that broke the JIT Recompiler on Android devices. Unfortunately there's very little instruction on building from source for Android and I'm running into issues.

I'm building on Ubuntu 14.04 LTS. 

I've been able to get stuff building to a certain point, the steps being as follows (error in output):

1. Install Android SDK and Android NDK (home directory) and set paths.
2. git clone git@github.com:dolphin-emu/dolphin.git
3. cd dolphin
4. mkdir build
5. cd build
6. cmake -DANDROID=True -DCMAKE_TOOLCHAIN_FILE=../Source/Android/android.toolchain.cmake -DANDROID_NDK=/home/heinermann/android-ndk-r10d -DCMAKE_BUILD_TYPE=Release -DANDROID_ABI="armeabi-v7a" -DANDROID_NATIVE_API_LEVEL=17 -DENABLE_PCH=False ..
7. make

Output (end):
Code:
Linking CXX static library libcore.a
[100%] Built target core
Scanning dependencies of target uicommon
[100%] Building CXX object Source/Core/UICommon/CMakeFiles/uicommon.dir/UICommon.cpp.o
Linking CXX static library libuicommon.a
[100%] Built target uicommon
Scanning dependencies of target main
[100%] Building CXX object Source/Core/DolphinWX/CMakeFiles/main.dir/Android/ButtonManager.cpp.o
[100%] Building CXX object Source/Core/DolphinWX/CMakeFiles/main.dir/MainAndroid.cpp.o
Linking CXX shared library libmain.so

cp: cannot stat ‘/libs/armeabi-v7a/libmain.so’: No such file or directory
make[2]: *** [Source/Core/DolphinWX/libmain.so] Error 1
make[1]: *** [Source/Core/DolphinWX/CMakeFiles/main.dir/all] Error 2
make: *** [all] Error 2

Running make again after this error indicates that main was 100% built.

So what I want to know is...
1. Did the build succeed or fail? (is that copy crucial? or is the second make falsely reporting a successful build?)
2. Where do I go from here to compile an APK file? Do I need to find and copy libmain.so to a subdirectory of Source/Android/ and run gradle there? Is there a script that buildbot uses to methodically build the Android APK file (and where would I find it)? 


Note: -DENABLE_PCH=False is used because of this error:
Code:
Scanning dependencies of target pch
[ 24%] Building CXX object Source/CMakeFiles/pch.dir/PCH/pch.h.o
Linking FAKELANG static library libpch.a
[ 24%] Built target pch
Scanning dependencies of target audiocommon
make[2]: *** No rule to make target `/libpch.a', needed by `Source/Core/AudioCommon/CMakeFiles/audiocommon.dir/AudioCommon.cpp.o'.  Stop.
make[1]: *** [Source/Core/AudioCommon/CMakeFiles/audiocommon.dir/all] Error 2
make: *** [all] Error 2
I probably get further than you (I don't need to disable PCH either), but I still only get libmain.so, I don't get an APK. Undecided Wondering if that's done in another step?
If I get anywhere with it, I'll create a wiki page so that other developers have something to go by.
(03-07-2015, 11:50 AM)Heinermann Wrote: [ -> ]If I get anywhere with it, I'll create a wiki page so that other developers have something to go by.

You need to use Android Studio to build the APK. Undecided

Now to get past the Native Library failures.
I don't think you necessarily need Android Studio, but it seems copying libmain.so from build/Source/Core/DolphinWX to Source/Android/libs/armeabi-v7a did the trick. I can even debug it in Android Studio which will be useful.


EDIT: After setting up Android Studio and using a directory called build over an alternative directory named android-build, make now copies the libmain.so file automatically.
(03-07-2015, 04:32 PM)Heinermann Wrote: [ -> ]I don't think you necessarily need Android Studio, but it seems copying libmain.so from build/Source/Core/DolphinWX to Source/Android/libs/armeabi-v7a did the trick. I can even debug it in Android Studio which will be useful.


EDIT: After setting up Android Studio and using a directory called build over an alternative directory named android-build, make now copies the libmain.so file automatically.

Mine isn't importing the file, but I think that's because I'm building for aarch64, so mine is in a different folder. Undecided I wish they would publish their build scripts, since I'm not a UI kind of person. I prefer my editor and command line builds.
You should be able to build the APK using gradle command line, although only certain versions of Gradle are compatible with the Android Gradle plugin.
(03-08-2015, 10:42 AM)Heinermann Wrote: [ -> ]You should be able to build the APK using gradle command line, although only certain versions of Gradle are compatible with the Android Gradle plugin.

I'm good, I just manually loaded in the lib into the system lib64 area. Getting the same result as the official builds. Either the 64-bit version doesn't work on my platform correctly, or it's a recent change that breaks Android. When I browse to the images, it doesn't enumerate the ROMs in the folder. I'm also seeing the settings not properly sticking at times. So I'll debug from there after I give it an Android TV front-end so it's easier to launch. I'm also going to try the 32-bit build to see if that makes it better.
I just recently pushed a fix that fixes the game list not populating correctly. It was supposed to be pushed a while ago, but I've been traveling.
(03-09-2015, 03:07 AM)Sonicadvance1 Wrote: [ -> ]I just recently pushed a fix that fixes the game list not populating correctly. It was supposed to be pushed a while ago, but I've been traveling.

You're the man. Smile I can now build and run.
Pages: 1 2