fluiddyn / transonic

:rocket: Make your Python code fly at transonic speeds!
https://transonic.readthedocs.io
BSD 3-Clause "New" or "Revised" License
119 stars 0 forks source link

How do we deploy code with transonic? #5

Open jeanlaroche opened 5 years ago

jeanlaroche commented 5 years ago

I have a question for you: I'm using transonic with pythran, and everything's working great! Now I'd like to bundle my code (specifically use pyinstaller to create a self contained app), including the pre-compiled so files. I'm guessing I'll have to include transonic in the list of modules that must be imported by pyinstaller, but I would like to make sure the precompiled so files are included so there's no compilation when the people use the bundled app. In pythran, all I have to do is include the .so file and things work without a hitch. How can I do the same thing with transonic (i.e., ensure the .so are there, transonic finds them and does not try to recompile)?

paugier commented 5 years ago

Do you use jit or boost?

I don't see how it can be done now with the jit decorator... It would be a new feature.

However, with the boost decorator (ahead-of-time compilation), it's very simple. One just have to compile (with a setup.py, something like this) and to include the extension files in the package to be distributed (as for all tools which create extensions). Nothing special about Transonic.

Once the code works with jit, modifying it to use boost should not be too difficult because you can find the signatures (so the Pythran types) in the files generated by Transonic.

paugier commented 5 years ago

specifically use pyinstaller to create a self contained app

Note that I've never done that so I don't know how it works :slightly_smiling_face:

jeanlaroche commented 5 years ago

Ah great, that's simple enough! Thanks! I'll let you know how that works... (I use jit, so indeed I have to switch to boost, which should be easy)