Julia on iOS and Android

Why can’t it read missing x lib, instead of error #2? :stuck_out_tongue: It’s about to finish now!

I’ll try to run the tests individually, you mention you have added some tests, is there any other command to run those or will they run with make tests?

I built yosterday succesfully and was able to use julia, then I melled up my PATH and I am starting again, because I had to reset Termux.

Installing with:

apt install julia-devprev

And then running Julia I get:

CANNOT LINK EKECUTABLE "julia": library "libopenblas.so" not found Aborted

If I do next:

apt install openblas

Then I get:

Illegal instruction

@its-pointless should I open an issue at your repo to track this?

Yes its probably best handled there since its likely purely a non-julia issue since you could build it yourself and its very likely an arch specific issue with how i compiled julia. Also its probably worth pointing out that there is a failsafe method to start termux that just loads busybox so you don’t have to reinstall termux if something like that happens to a bad path etc.

Thanks! Could you please enable github issues in the repo of your julia fork?

Now I am getting this error, I don’t know what am I missing, this didn’t happen yesterday, I’ll continue to try and build it deterministically.

could be corrupted image?
make clean will fix?
could be if you have julia installed from my repo it messes with it since at some point its loading the wrong libraries?
what ever is occuring i will be updating the branch so it installs and adding documentation explaining how the android linker, LD_LIBRARY_PATH etc can mangle things because android linker does not behave like a normal linker does. Which requires workarounds particularly if you doing something weird like compiling julia on it…

But first i have to finish testing gcc-8 so it doesn’t break anything if you install it.

okay time fill in some infomation with regards to complinig on device. Arm is the hard one so lets go through the issues.
First the ram requirements for compiling is higher than it is for running it. Android also has a habit of killing processes that use lots of cpu and slowly require more and more ram… the device i was using to compile it died and tried 3 other devices and they fail. It needs ram.

secondly last time i checked arm still required libunwind so if you are getting bus errors during compile it could be its not installed or maybe libuv needs it can’t recall.

the android linker is deliberately designed to be stupid so you have to tell it the order to search libraries via LD_LIBRARY_PATH. To use a compiled in place version you have to add the julia libs LD_LIBRARY_PATH before system LD_LIBRARY_PATH. this means you can’t use dynamically linked lib version of libuv that julia uses at the same time as the termux libuv.so since you need to have the LD_LIBRARY_PATH first pick up julia libs then termux system libs. Solution was to simply use statically linked julia libuv.

1 Like

juliabox.com runs on iOS, i reccomend iPhone but have used it on iPhone aswell. You can run code, install packages and it is cloud based, so all your code can be downloaded on another device.

JuliaBox does not run on iOS; JuliaBox is hosted on, I’d imagine, Linux servers (or maybe a *BSD?). However, JuliaBox is accessible from iOS, since JuliaBox’s interface is through a web browser. That is a key distinction; you can’t write code that works in a cross-platform manner that works the same on iOS as it would work on a desktop system. That is to say, things like filesystem operations, device access (cameras via VideoIO, Vulkan-accelerated graphics if any exist, etc.) would not work on JuliaBox accessed from iOS, while these things would work on a regular desktop running native Julia.

2 Likes

Just saw this:

https://developer.apple.com/documentation/bundleresources/entitlements/com_apple_security_cs_allow-jit

From what I understand, you can request permission now for your app to use writable executable memory (if Apple grants this specific entitlement to your app). Would that mean that Julia on iOS would be possible, at least potentially?

I don’t think many people would try using Julia on iOS for serious tasks - still, having Julia in your pocket is kinda cool. Recently, during a presentation where I was advocating for Julia and was pointing out that it can pretty much run anywhere (demonstrating live on a Jetson Nano), someone asked “well, does it run on your phone?”. The fact that I could pull my phone out and show a Julia console on it (thanks, @its-pointless!), silly as it seems, definitely made an impact. So it’s actually not so pointless at all (pardon the pun). :wink:

Disclaimer: I’m not a frequent iOS user, and certainly not an iOS developer, so I may be reading this completely wrong.

3 Likes

Unfortunately it looks like these permissions are for building mac apps that run on the MacOS App Store (such as Building -- and releasing -- a fully self-contained Application written in julia - #10 by NHDaly).

Unfortunately I’ve since let my Developer account lapse, so Paddle Battle is no longer on the app store… I’ve tried putting it back, but had problems getting everything to work. :cry:

Would that mean that Julia on iOS would be possible, at least potentially?

But so no, I don’t think this means anything for iOS compatibility. :cry:

1 Like

Ah, darn! :frowning:

In case anyone finds the following helpful/inspiring, here’s a short description of how Swift playgrounds work on iOS w/out a JIT:

https://twitter.com/jckarter/status/1169378736648572928

Julia might be able to do something similar, at least for functions/call-trees marked as “expensive” in some fashion (doing this for every function would probably be prohibitive). I suspect they have linker customizations and other special sauce to make it work well.

2 Likes

It seems that running Julia on Android may now just be as simple as installing Termux and running apt-get install julia?

I did try and start down the path of building from source and followed the directions here, but I think that may not have been necessary…

2 Likes

Looks like maybe I spoke too soon. The result of trying to add Distributions:

2 Likes

It says unable to locate package julia for me

https://github.com/termux/termux-packages/issues/58#issuecomment-529036798

1 Like

Figure it out!

1 Like

Haha thanks! That’s awesome! I got it installed via those same instructions as well. :slight_smile: Neat fun!

$ pkg install wget
$ wget https://its-pointless.github.io/setup-pointless-repo.sh
$ bash setup-pointless-repo.sh
$ pkg install julia  # julia 1.2.0 fork

6 Likes

I’m just compiling Julia inside iSH for iOS which provides a virtualized x86 Linux environment. Will let you know how it goes (binary download of Julia was not working, see Julia won't start · Issue #259 · ish-app/ish · GitHub ).

By the way, if it is possible to create something like full x86 emulation iSH (it uses a kind of JIT written in assembly) there must be some similar way to get Julia JIT to run natively with iOS restrictions. Anyone mad enough to dive into this ? :wink:

6 Likes

How do we do that! Can you please elaborate on how to run Julia on termux!

1 Like