title: Error loading module when using lua
body: <p>I'm new to lua and recently learning DL with Torch.
  I have installed torch just following instructions: <a href="http://torch.ch/docs/getting-started.html#_" rel="nofollow noreferrer">http://torch.ch/docs/getting-started.html#_</a> and added some packages using <code>luarocks install</code>. Then I wrote a test file:</p>
  
  <pre><code>require 'torch'
  require 'nn'
  
  --[[do something]]
  </code></pre>
  
  <p>when running with <code>lua test.lua</code> (Ubuntu 14.04), it errs as followed:</p>
  
  <blockquote>
    <p>error loading module 'libpaths' from file
    '/home/user1/torch/install/lib/lua/5.1/libpaths.so':
      /home/user1/torch/install/lib/lua/5.1/libpaths.so: undefined symbol:
    luaL_register</p>
  </blockquote>
  
  <p>It seems something wrong with path settings or so. However, when I run test with command <code>th</code>, it works fine.
  I searched and examined these answers: <a href="https://stackoverflow.com/questions/12700342/error-loading-module-lua">Error loading module (Lua)</a>
  <a href="https://stackoverflow.com/questions/31036340/torch7-lua-error-loading-module-libpaths-linux">Torch7 Lua, error loading module &#39;libpaths&#39; (Linux)</a>
  not fully answered my question though.<br>
  So I wonder where exactly the error comes from, and how to fix it. Even though I can use torch with <code>th</code>.</p>
  
  <p>ADD:
  I find that the reason maybe API <code>luaL_register</code> is not supported in ver 5.2 which is what I am using, while <code>th</code> calls a lua shell in ver 5.1? So does this mean I can only use <code>th</code> to run my files?</p>