www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - Building Android Apps on Windows is working fine:)

reply Andre Pany <andre s-e-a-p.de> writes:
Hi,

using the documentation from here 
https://wiki.dlang.org/Build_LDC_for_Android
I build the OpenGL Android APP on Windows using WSL (Bash on 
Ubuntu on Windows).

On a fresh WSL you have to execute these commands:

---------- Install some tools -------------------------
sudo apt-get install build-essential
sudo apt-get install git
sudo apt-get install cmake
sudo apt-get install unzip
sudo apt-get install libconfig-dev

---------- Install dmd -------------------------
cd ~
curl -O -L 
http://downloads.dlang.org/releases/2.x/2.072.1/dmd_2.072.1-0_amd64.deb
sudo dpkg -i dmd_2.072.1-0_amd64.deb

---------- Install Android ndk -------------------------
sudo mkdir -p /opt/android-sdk/ndk-bundle
curl -O -L 
https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
sudo unzip android-ndk-r13b-linux-x86_64.zip 'android-ndk-r13b/*' 
-d /opt/android-sdk/ndk-bundle
export NDK=/opt/android-sdk/ndk-bundle/android-ndk-r13b


And then follow the instructions from the WIKI.
As the windows sub system doesn't allow USB, the 2 last commands 
were executed in windows directly. I installed on Windows the 
Android Studio and execute these 2 commands in DOS console:

android update project -p . -s --target 1
ant debug

The OpenGL App is running fine on my LG mobile.

Kind regards
André
Dec 22 2016
next sibling parent reply Johan Engelen <j j.nl> writes:
On Thursday, 22 December 2016 at 17:00:35 UTC, Andre Pany wrote:
 Hi,

 using the documentation from here 
 https://wiki.dlang.org/Build_LDC_for_Android
 I build the OpenGL Android APP on Windows using WSL (Bash on 
 Ubuntu on Windows).

 ...

 The OpenGL App is running fine on my LG mobile.
Nice! Can you add your steps to the wiki page? Thanks! Johan
Dec 22 2016
parent Andre Pany <andre s-e-a-p.de> writes:
On Thursday, 22 December 2016 at 17:14:54 UTC, Johan Engelen 
wrote:
 Nice!
 Can you add your steps to the wiki page?

 Thanks!
   Johan
Yes I will add the steps. Kind regards André
Dec 22 2016
prev sibling next sibling parent reply Suliman <evermind live.ru> writes:
On Thursday, 22 December 2016 at 17:00:35 UTC, Andre Pany wrote:
 Hi,

 using the documentation from here 
 https://wiki.dlang.org/Build_LDC_for_Android
 I build the OpenGL Android APP on Windows using WSL (Bash on 
 Ubuntu on Windows).

 On a fresh WSL you have to execute these commands:

 ---------- Install some tools -------------------------
 sudo apt-get install build-essential
 sudo apt-get install git
 sudo apt-get install cmake
 sudo apt-get install unzip
 sudo apt-get install libconfig-dev

 ---------- Install dmd -------------------------
 cd ~
 curl -O -L 
 http://downloads.dlang.org/releases/2.x/2.072.1/dmd_2.072.1-0_amd64.deb
 sudo dpkg -i dmd_2.072.1-0_amd64.deb

 ---------- Install Android ndk -------------------------
 sudo mkdir -p /opt/android-sdk/ndk-bundle
 curl -O -L 
 https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
 sudo unzip android-ndk-r13b-linux-x86_64.zip 
 'android-ndk-r13b/*' -d /opt/android-sdk/ndk-bundle
 export NDK=/opt/android-sdk/ndk-bundle/android-ndk-r13b


 And then follow the instructions from the WIKI.
 As the windows sub system doesn't allow USB, the 2 last 
 commands were executed in windows directly. I installed on 
 Windows the Android Studio and execute these 2 commands in DOS 
 console:

 android update project -p . -s --target 1
 ant debug

 The OpenGL App is running fine on my LG mobile.

 Kind regards
 André
Screenshots and sources plz
Dec 22 2016
parent Andre Pany <andre s-e-a-p.de> writes:
On Thursday, 22 December 2016 at 18:55:52 UTC, Suliman wrote:
 On Thursday, 22 December 2016 at 17:00:35 UTC, Andre Pany wrote:
 [...]
Screenshots and sources plz
The sources are all taken from the ldc android wiki page mentioned in the first post. I verified that the approach is also working with windows subsystem for linux. I already enhanced the Wiki page. If something specific is missing, I can add it. Kind regards André
Dec 22 2016
prev sibling parent reply Joakim <dlang joakim.fea.st> writes:
On Thursday, 22 December 2016 at 17:00:35 UTC, Andre Pany wrote:
 Hi,

 using the documentation from here 
 https://wiki.dlang.org/Build_LDC_for_Android
 I build the OpenGL Android APP on Windows using WSL (Bash on 
 Ubuntu on Windows).

 [...]
Great! Good to hear it just works, once you installed the prerequisites. You may want to amend the first sentence of the wiki page to mention Win10 too. I will be pushing out a new 1.1.0 beta soon and updating the patches and instructions to build that. You may want to try building that next, bonus points if you get it done purely in Windows, ie no linux shell. ;)
Dec 22 2016
parent reply A random D user <random none.org> writes:
On Friday, 23 December 2016 at 04:10:48 UTC, Joakim wrote:
 On Thursday, 22 December 2016 at 17:00:35 UTC, Andre Pany wrote:
 Hi,

 using the documentation from here 
 https://wiki.dlang.org/Build_LDC_for_Android
 I build the OpenGL Android APP on Windows using WSL (Bash on 
 Ubuntu on Windows).

 [...]
Great! Good to hear it just works, once you installed the prerequisites. You may want to amend the first sentence of the wiki page to mention Win10 too. I will be pushing out a new 1.1.0 beta soon and updating the patches and instructions to build that. You may want to try building that next, bonus points if you get it done purely in Windows, ie no linux shell. ;)
Out of interest: why don't you include your patches directly in "mainline" LDC (or at least a branch there)? The patchset looks moderately small and I guess with version(Android) no one would care much? I just assume that cloning the LDC repo directly is easier for new users and/or potential contributors.
Dec 22 2016
parent Joakim <dlang joakim.fea.st> writes:
On Friday, 23 December 2016 at 04:55:54 UTC, A random D user 
wrote:
 On Friday, 23 December 2016 at 04:10:48 UTC, Joakim wrote:
 On Thursday, 22 December 2016 at 17:00:35 UTC, Andre Pany 
 wrote:
 Hi,

 using the documentation from here 
 https://wiki.dlang.org/Build_LDC_for_Android
 I build the OpenGL Android APP on Windows using WSL (Bash on 
 Ubuntu on Windows).

 [...]
Great! Good to hear it just works, once you installed the prerequisites. You may want to amend the first sentence of the wiki page to mention Win10 too. I will be pushing out a new 1.1.0 beta soon and updating the patches and instructions to build that. You may want to try building that next, bonus points if you get it done purely in Windows, ie no linux shell. ;)
Out of interest: why don't you include your patches directly in "mainline" LDC (or at least a branch there)? The patchset looks moderately small and I guess with version(Android) no one would care much?
They _are_ in: the only remaining patches applied to the compiler are an updated version of kinke's ldc PR for cross-compiling reals (https://github.com/ldc-developers/ldc/pull/1317) and some small tweaks to the CMake build script to make it easier to build and run the tests on Android. The remaining stdlib changes are almost all workarounds for older versions of Android, no need to merge those. The only exceptions are an in-limbo, unmerged PR by Ilya for druntime (https://github.com/dlang/druntime/pull/1565) and some issue with how module info is passed from the compiler, which will have to be dealt with eventually. The bigger issue is that my current approach modifies llvm to create a kind of emulated TLS that is easily passed to the garbage-collector. llvm has its own form of emulated TLS now, modeled on how gcc does it, but I'm not particularly motivated to figure out how to register that with the GC. It will have to be done eventually though, so that we can just use stock llvm. In sum, there are some issues that others need to finish up, a couple that I need to look into, before we can just use stock ldc for Android, but most of it is in.
 I just assume that cloning the LDC repo directly is easier for 
 new users and/or potential contributors.
You are cloning the LDC repo in the instructions above, I don't maintain a fork. I provide a few patches that you have to apply, accompanied by full instructions. If you're just a user, my compiler builds are available, no need to clone anything.
Dec 23 2016