Just in case your question is how to keep elixirc from running the code, this is the answer:
defmodule Solution do
defp sum(a, b), do: a + b
def main() do
a = IO.gets("") |> String.strip |> String.to_integer
b = IO.gets("") |> String.strip |> String.to_integer
sum(a, b) |> IO.puts
end
end
#Solution.main()
As @whatyouhide said the code will get run regardless. But without the Solution.main() at the end of your code, it will simply compile the code and have nothing to execute so it will exit. So either comment out Solution.main() or remove it.
EDIT: Further comments by the original poster make me think that what he or she is looking for is the ability to take the compiled binary to a different machine and run it. If that's the case then what you probably want is exrm.
Elixir (and indeed Erlang) don't simply build a single binary image. Both of them depend on runtime binaries to execute as well. Exrm will figure out all the runtime files you need and bundle them into a single compressed file that you can move to the machine where you want to execute.
But there's not a single binary file that you can simply deploy on a different machine. At the least you'll also need the Erlang and Elixir runtimes.