I want to install both Lua 5.2 and 5.1 on my Linux computer. Is this just a matter of installing each version with the usual make linux install
or is there something else? In particular, I am worried about the header and library files, since those seem to go on directories that are not namespaced with the version number, such as /usr/local/include.
In addition to that, is it possible to set up Luarocks so that it can install both 5.1 and 5.2 libraries? I know that Luarocks namespaces things in a 5.2 or 5.1 directory, and setting LUA_PATH_5_X and LUA_CPATH_5_X variables should work for configuring Lua after that but I don't understand how Luarocks decides what version of Lua to compile the C libraries against.
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.
If you want to use make linux install
but create a namespace, edit Makefile
and change INSTALL_TOP
and other variables accordingly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With