Lua 5.3 is installed, but I can't locate the correct lua.h
Asked Answered
M

1

13

I am trying to install some luarocks packages but it seems that although lua5.3 is installed, the relevant headers are not

$ which lua
/usr/bin/lua
$ lua -v
Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio
/usr/include$ ls *lua*
lua5.1:
lauxlib.h  luaconf.h  lua.h  lua.hpp  lualib.h

luajit-2.1:
lauxlib.h  luaconf.h  lua.h  lua.hpp  luajit.h  lualib.h
$ locate lua.h
/usr/include/luajit-2.1/lua.h
/usr/include/luajit-2.1/lua.hpp
/usr/share/doc/texlive-doc/latex/greek-fontenc/lgr2licr.lua.html
/usr/src/linux-headers-5.4.0-31-generic/include/config/scsi/dh/alua.h
/usr/src/linux-headers-5.4.0-40-generic/include/config/scsi/dh/alua.h
/usr/src/linux-headers-5.4.0-66-generic/include/config/scsi/dh/alua.h
/usr/src/linux-headers-5.4.0-70-generic/include/config/scsi/dh/alua.h
$ sudo luarocks install luacheck
Installing https://luarocks.org/luacheck-0.24.0-2.src.rock
Missing dependencies for luacheck 0.24.0-2:
   luafilesystem >= 1.6.3 (not installed)

luacheck 0.24.0-2 depends on luafilesystem >= 1.6.3 (not installed)
Installing https://luarocks.org/luafilesystem-1.8.0-1.src.rock
gcc -O2 -fPIC -I/usr/include/lua5.3 -c src/lfs.c -o src/lfs.o
src/lfs.c:84:10: fatal error: lua.h: No such file or directory
   84 | #include <lua.h>
      |          ^~~~~~~
compilation terminated.

Any help would be really appreciated.

Myocarditis answered 12/4, 2021 at 18:1 Comment(2)
turns out I had to install lua5.3-dev... hopefully this will fix the other stuff too :)Myocarditis
base10 -- did you mean liblua5.3-dev ? At any rate, Luarocks should add that to the Linux installation instructions.Teaching
C
18
sudo apt install liblua5.3-dev
Communist answered 29/1, 2022 at 7:44 Comment(4)
I get: No package liblua5.3-dev available.Tonettetoney
maybe you need a sudo apt update first? Otherwise, check your spelling and read the error carefully, and google that. I just copy pasted this command into my terminal and confirmed it still works.Communist
I have to use yum due to my Linux's version and for some reason it doesn't find that package.Tonettetoney
what about just yum install lua ?Communist

© 2022 - 2024 — McMap. All rights reserved.