Cxx.jl icon indicating copy to clipboard operation
Cxx.jl copied to clipboard

Running Julia code on mobile through C++

Open p-i- opened this issue 5 years ago • 3 comments

I am working on a mathematical/DSP C++ algorithm which will run on mobile devices (iOS, Android).

Currently I'm prototyping in IPython and rewriting in C++.

It would be WONDERFUL if I could simply write it in Julia (prototyping in a Notebook) and build a binary library file, which my C++ code (running on mobile) could link against.

Is this theoretical possible?

Is it practically achievable?

p-i- avatar Dec 01 '18 18:12 p-i-

I can't speak to whether what you want to achieve is possible, but this package is not what you'd need to do that. This package is for calling C++ from Julia, not the other way around. You can do that natively with Julia's C API.

ararslan avatar Dec 01 '18 20:12 ararslan

Your questions are generally better placed at discourse.julialang.org.

carstenbauer avatar Dec 04 '18 15:12 carstenbauer

@p-i-, Julia has been run on Android (there are caveats, i.e. meaning in Ubuntu under Android, now also natively, I read, seems meaning under Termux), but not as far as I know on iOS yet (while you theoretically could, and there's an old Objective-C bridge, but it may be only for macOS; a guy already made a Julia app for the the Mac App Store, not iPhone app store, and if I recall didn't use that bridge, while that app is no longer in that store). Someone is working on getting Julia working in iOS under a x86 Linux VM. Natively should also be possible, just as for Android.

https://www.reddit.com/r/Julia/comments/9hexna/julia_repl_on_android/

https://discourse.julialang.org/t/julia-on-ios-and-android/7346

Currently I'm prototyping in IPython and rewriting in C++. I would prototype in Julia (you can still use Jupyther/IPython), and not rewrite into C++ as not needed. You may need to optimized the code, but could still have it in native Julia.

What Ararslan says is true, if you have other C++ to call the algorithm routine. This package (or CxxWrap.jl) would be the correct one if you're mainly using Julia and want to call C++. I do not know for a fact that either of them support ARM (Julia itself does) yet (what you have on mobile) or iOS: If you're only doing computation iOS may or may not work (if you get it compiled; look into "Julia lite" or Keno's new cut-down build options).

I posted this question ages ago (see the comment; and what I wrote): https://github.com/JuliaLang/julia/issues/12825#issuecomment-358329102

PallHaraldsson avatar Jan 12 '19 14:01 PallHaraldsson