Require custom C module in Lua by path
<p>This is a problem that plagued me for quite a while.</p>

<p>After I wrote and compiled my custom functions into a shared library, <code>require('mylib')</code> would only work when the shared library was directly in the same directory as the script I called it from.</p>

<p>Any efforts to try <code>require('/path/to/mylib')</code> or similar absolute paths failed. Furthermore, "backtracking" through a relative path (i.e. using <code>..</code> failed as well.</p>

<p>So how can one specify the <code>bin</code> directory, or wherever the shared library is output to?</p>