Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006266OCamlOCaml generalpublic2013-12-12 11:252014-10-17 09:29
Reporterstrobegen 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusconfirmedResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0006266: Cross compilation for iOs, Android etc
DescriptionI guess that out of box compiling support for mobile platforms like iOs and Android might be a significant stimulus for popularization of language.
Currently mobile market is huge in stlll growing (for instance http://www.asymco.com/2012/01/17/the-rise-and-fall-of-personal-computing/ [^]).

I think that creating lot of bindings for native platforms APIs (like Xamarian did for mono, for instance) is not so important - that is really necessary that:
* cross compilation
* out of box ways to easily build library binary which can be linked to native application code with original platform tools/IDEs.
TagsNo tags attached.
Attached Files

- Relationships
related to 0005887confirmed Name clash with memory.h header file with the Android NDK 
related to 0006613resolved armv5te code generation bug: shift expression expected -- `subs r0,r3,#4294967296' 

-  Notes
(0010704)
gasche (developer)
2013-12-12 14:22

I know nothing at all about cross-compilation, but I think that cross-compilation to android is already possible today, as explained by Jonathan Protzenko in http://gallium.inria.fr/blog/ocaml-on-a-nexus-7/. [^] I've also heard about iOS applications implemented in OCaml, see http://psellos.com/ocaml/ [^] for example.
(0010706)
strobegen (reporter)
2013-12-13 15:48

Yes it all possible now, I also know examples of few games written on Ocaml in iOs App Store (I guess, I was read some time ago article about small team which shipped few game titles to AppStore (not psellos)) but this functionally doesn't included to default compiler, currently only short way to build this kinds of apps for iOs is OCamlXARM (http://psellos.com/ocaml/compile-to-iphone.html [^]), I'm not sure but I guess that OCamlXARM contain few patches to original Ocaml distribution related to ARM assembler (& crosscompiling) parts. Therefore my opinion that it will be very useful for Ocaml community if this functionally will be available in default distribution and officially supported:
on OSX: cross compiling to iOs: ARM, ARM64 & Android: ARM.
on Windows: cross compiling to Android ARM,
on Linux: cross compiling to Android ARM.
(0012386)
whitequark (developer)
2014-10-17 06:11

I have started working on proper cross-compilation to Android, and shortly after that I will probably switch to iOS. My goal is to produce small, self-contained patches that can be merged one by one; I will post a patchset shortly. In fact, the amount of work required is not as large as one would expect.
(0012387)
whitequark (developer)
2014-10-17 07:45

I have uploaded three small patches, which allow Android cross-compilation to proceed (both world and world.opt), given that config/{Makefile,m.h,s.h} are provided.

This can be easily tested using:

    opam repo add android https://github.com/whitequark/opam-android [^]
    opam install ocaml-android
    ocamlfind -toolchain android ocamlopt helloworld.ml

I will follow up these patches with ones that properly detect the target environment features without running target binaries.
(0012388)
whitequark (developer)
2014-10-17 08:01

Actually, maybe not. I have just realized that my approach is fundamentally flawed while writing out some detailed instructions. Please wait for an updated patchset.
(0012389)
strobegen (reporter)
2014-10-17 09:29

I will try to test when it be ready

- Issue History
Date Modified Username Field Change
2013-12-12 11:25 strobegen New Issue
2013-12-12 14:22 gasche Note Added: 0010704
2013-12-13 15:48 strobegen Note Added: 0010706
2014-07-16 14:48 doligez Status new => confirmed
2014-10-16 09:34 xleroy Relationship added related to 0006613
2014-10-17 06:11 whitequark Note Added: 0012386
2014-10-17 06:11 whitequark Relationship added related to 0005887
2014-10-17 07:37 whitequark File Added: 0002-Detect-host-ocamlyacc-alongside-host-ocamlrun-in-con.patch
2014-10-17 07:37 whitequark File Added: 0003-Update-every-invocation-of-ocamlrun-or-ocamlyacc-to-.patch
2014-10-17 07:38 whitequark File Added: 0004-Add-a-CROSS_COMPILING-Makefile.config-flag.patch
2014-10-17 07:45 whitequark Note Added: 0012387
2014-10-17 08:01 whitequark Note Added: 0012388
2014-10-17 08:05 whitequark File Deleted: 0002-Detect-host-ocamlyacc-alongside-host-ocamlrun-in-con.patch
2014-10-17 08:05 whitequark File Deleted: 0003-Update-every-invocation-of-ocamlrun-or-ocamlyacc-to-.patch
2014-10-17 08:05 whitequark File Deleted: 0004-Add-a-CROSS_COMPILING-Makefile.config-flag.patch
2014-10-17 09:29 strobegen Note Added: 0012389


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker