I like to make some of my own classes available system-wide in Torch7. In python it is enough to give the class files paths to PYTHONPATH environment variable. Is there any equal way to do this for Lua?
The environmental variable you are looking for is LUA_PATH
At start-up, Lua initializes this [
package.path
] variable with the value of the environment variableLUA_PATH_5_3
or the environment variableLUA_PATH
or with a default path defined inluaconf.h
, if those environment variables are not defined. Any ";;" in the value of the environment variable is replaced by the default path.
For example, to have Lua look for files in /home/bob/lualibs
, you would set LUA_PATH
to /home/bob/lualibs;;