[ How to have different lua versions on the same linux system ]
I'm trying compile VLC on fedora 23. I have Lua 5.3.3. ./configure is telling me I need Lua 5.1 or Lua 5.2. Can I have 5.1 and 5.3.3 on the same system without breaking stuff? If so, how?
Answer 1
Yes, You can. According to fedoraproject.org Lua is packaged to be installed separately for different versions.
Generic sollution
In general, during Lua environment run-time You can manage usage of different Lua versions by setting LUA_PATH
and LUA_CPATH
environment variables.
Specifically, for VLC You could set Lua installation related environment variables [1]:
LUA_CFLAGS C compiler flags for LUA, overriding pkg-config
LUA_LIBS linker flags for LUA, overriding pkg-config
LUAC LUA byte compiler
[1] https://wiki.videolan.org/VLC_configure_help/
Automatic version management
For independent from distribution Lua version and Lua modules management we have couple of initiaves:
- LuaRocks --- one of the older and bigger Lua modules management system.
- LuaDist --- another quite old management system, looks like... create with PiP in mind.
- Other projects, for example luaver (mentioned by Brandon Anzaldi) which is quite new and still gaining momentum (no proper releases as of 2016-06-14).
Answer 2
You can use luaver for installing, managing and switching between different versions of lua. It is a very easy to use program.
To install luaver
run:
curl https://raw.githubusercontent.com/dhavalkapil/luaver/master/install.sh -o install.sh && . ./install.sh
Then you can install and use multiple versions of lua as follows:
luaver install 5.3.1 # Installs lua version 5.3.1
luaver install 5.3.0 # Installs lua version 5.3.0
luaver use 5.3.1 # Switches to lua version 5.3.1
See https://dhavalkapil.com/luaver/ for more details.