Jordan Scales
Jordan Scales

Reputation: 2717

Can I generate LLVM bytecode with Rubinius and run it with lli?

I've tried running rbx compile but I am not quite sure what to do with the output. I would like to run it with lli, but I get the following error.

$ lli hello.rbc
lli: hello.rbc:2:1: error: expected '=' here
18185007515559028006
^

Upvotes: 1

Views: 715

Answers (1)

Todd A. Jacobs
Todd A. Jacobs

Reputation: 84413

You don't run Rubinius byte-compiled code with lli because the .rbc file isn't an LLVM executable. Instead, you run it with a special Rubinius method call that handles pre-compiled bytecode for the Rubinius virtual machine. For example:

rbx -I. -e "Rubinius::CodeLoader.require_compiled 'hello'"

See Running Ruby With No Ruby for more details.

Upvotes: 1

Related Questions