Hi Justin, I’ve seen your question about compilation of LLVM on Android on the LLVM mailing list, with basically… 0 answer right !? ))-;
The LLVM compilation chain is used in the LLVM backend (see the code here https://github.com/grame-cncm/faust/tree/master-dev/compiler/generator/llvm). Basically the Faust internal FIR (Faust Imperative Representation) is traduced in LLVM IR, then the LLVM JIT component is used to compile LLVM IR to the actual machine code for the target processor. So only a « subpart » of the complete LLVM compilation chain is actually needed. The front-end (which is used to go from source language like C/C++/Swift to LLVM IR) is not needed in our case since the LLVM IR is directly generated. Basically what you need is : - cross-compile the LLVM compilation chain for Android (the same way other C/C++ libraries are compiled with the NDK chain to target Android devices) - compile libfaust with the LLVM backend (using the « make developer » target at the upper level in the Faust directory). This should end u linking wth the LLVM libraries that would have been compiled in the first step. - look at the libfaust API defined in the public llvm-dsp.h header (see https://github.com/grame-cncm/faust/blob/master-dev/architecture/faust/dsp/llvm-dsp.h) - test some of the simple examples that use libfaust API (see https://github.com/grame-cncm/faust/tree/master-dev/tests/llvm-tests) Stéphane > Le 12 juin 2019 à 22:10, Justin Giannone <[email protected]> a écrit : > > Hey Guys, > > I'm trying to compile libfaust in order to use the JIT Compiler in a Java & > C++ Android App. Specifically having a Frontend App written in Java which > the User leverages in order to tune a Backend AudioFlinger Module written in > C++. The Backend Module is where the audio processing will take place, > although some processing may take place in the Frontend to provide feedback > to the User as well. > > I'm trying to understand how I will need to include LLVM for libfaust to > function. Here are the questions I've come up with : > - Does libfaust expect a full compiled installation of LLVM to be present > (meaning shared libs, headers, executables, etc)? Or just a subset of those > files? I expect that it just needs necessary libs since the JIT Compiler is > all in-memory. > - Should I use Android NDK Toolchains to compile LLVM for Android > Architectures? Since Android NDK uses LLVM to compile Android Apps I'm not > sure that it makes sense to use it to try to compile LLVM to run in Android. > > Currently the issue that I run into when trying to use the Android NDK to > build LLVM is that cmake tries to compile and execute a sample app, but since > my Dev Machine is Windows the sample app can't run. > _______________________________________________ > Faudiostream-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/faudiostream-devel _______________________________________________ Faudiostream-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/faudiostream-devel
