Thanks to BinaryBuilder
, some programs are now much easier to install as Julia *_jll packages compared to other solutions. However, simple no-setup ways to run these programs were not available yet to my knowledge.
This is where RunBinary.jl (registered) comes to help. Its API consists of a single macro @run
that installs the required jll package in a temporary environment and executes the specified binary:
@run SQLCipher.sqlcipher
A common usecase is to run via CLI:
$ julia -e 'using RunBinary; @run ImageMagick.identify `/path/to/file.jpg`'
For more details and options, see README.
The overhead is just about 2 seconds on my laptop:
$ time julia -e 'using RunBinary; @run HelloWorldC'
...
Hello, World!
2.20s user 0.86s system 144% cpu 2.116 total
This includes starting julia, creating a new temporary env, instantiating it, and running the target program. It further improves fourfold to 0.5 seconds with --compile=min
.