How to make OCaml work on termux for Android

Hi all.

I tried to install OCaml on Termux for Android but I failed.

Does anyone succeeded ?

Thanks in advance.

OCaml currently doesn’t support Android, at least not recent versions and not without extra patches. There are some upstreaming efforts in ocaml/ocaml#13405 for example

1 Like

That’s not entirely true; my unfinished PR Provide a system(3) replacement on Android (+ build OCaml on Android) #13405 fixes system(3) is disabled on Android, which prevent(ed?) building OCaml in Termux, but you can definitely build an OCaml cross-compiler targeting Android, and use it to cross-build programs for Android; as a matter of fact we do it sometimes in the CI: