ExMujoco.Loader (ExMujoco v0.1.1)

Copy Markdown View Source

Loading the NIF, and refusing to go on if it does not match the headers it was generated from.

Called from ExMujoco.Native's @on_load after the NIF is in, so a mismatch is a module that will not load — which is loud — rather than a physics run that is quietly a different version.

The loading itself has to happen in ExMujoco.Native: :erlang.load_nif only loads a library whose ERL_NIF_INIT name is the calling module's.

Summary

Functions

Whether the library and the headers agree.

Functions

check()

@spec check() :: :ok | {:error, String.t()}

Whether the library and the headers agree.

Both numbers are mjVERSION_HEADER-shaped: 4000001 is 4.0.1.