Compile all Jitted functions before hand


I have made a python package that makes use of several jitted functions. I have uploaded this package to PyPI so that anyone can do pip install package. In addition to the user installing the package, I would like them to be able to compile all the jitted functions before using the package – so that the compiled caches are ready for them when they decide to use it.

How can I do this? Currently I’m making the users run a simple program using the package that uses the jitted functions so that they compile and are ready for the user the next time they use the package for their work.

Any help would be greatly appreciated,
Thank you!

That is the only way currently.

Just as a side note, if you do this, keep in mind that you also need to manage the cache path.

As for precompiling, I’m not sure if this is worth the effort. At the end of the day, functions need to be compiled at least once. Whether this is done at package installation or at first use doesn’t seem to make much difference to me. Also, consider that the number of signatures can get very large quickly, making it difficult to keep track of them manually. The array layout or number of dimensions is part of the type. The same goes for the length of a tuple. Therefore, a function that takes three 2-dimensional double arrays as input and has no output can already have 27 different signatures just because each of the array can have F, C or A layout.