lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 17 July 2014 12:00, luciano de souza <luchyanus@gmail.com> wrote:
> Hello all,
>
> >From Github, I downloaded the last version of Luarocks. However I was
> not able to install it.
>
> Unpacking the zip file, I found a "configure" script. I tried:

You should download the latest LuaRocks release from the link at the
LuaRocks website: http://luarocks.org/releases/
The automatically generated zip file from Github is not guaranteed to
work. (Unfortunately there's no way to disable auto-generation of zip
files theres, AFAIK.)

> $ sudo chmod +x configure
> $ ./configure
>
> I got the following message:
>
> Lua interpreter found: /usr/bin/lua5.1...
> Lua version detected: 5.1
> lua5.1 found in $PATH: /usr/bin
> Checking Lua includes... lua.h not found (looked in /usr/include,
> /usr/include/lua/5.1, /usr/include/lua5.1)
> You may want to use the flag --with-lua or --with-lua-include. See --help.
>
> configure failed.
>
> I don't know exactly what to do. It's seems that C headers of Lua is
> required. But is not Luarocks a pure Lua application?

It is a pure Lua application. C headers are required because LuaRocks
_compiles_ C code when building Lua modules. (For example, when you
run `luarocks build luafilesystem`).

> $ ./configure --with-lua
> $ ./configure --with-lua-include
>
> Is a directory expected? Is it a C compilation? The messages are
> confused for me.

Did you "See --help" like the configure script recommended? It says:

```
]./configure --help
Configure LuaRocks.

--help                      This help.
--prefix=DIR                Prefix where LuaRocks should be installed.
                            Default is /usr/local
--sysconfdir=DIR            Location where the config file should be installed.
                            Default is $PREFIX/etc/luarocks

Where to install files installed by rocks, to make the accessible to Lua and
your $PATH. Beware of clashes between files installed by LuaRocks and by your
system's package manager.

--rocks-tree=DIR            Root of the local tree of installed rocks.
                            Default is $PREFIX

--lua-version=VERSION       Use specific Lua version: 5.1, 5.2, or 5.3
                            Default is "5.1"
--lua-suffix=SUFFIX         Versioning suffix to use in Lua filenames.
                            Default is "" (lua...)
--with-lua=PREFIX           Use Lua from given prefix.
                            Default is /usr
--with-lua-include=DIR      You can also specify Lua's includes dir.
                            Default is $LUA_DIR/include
--with-lua-lib=DIR          You can also specify Lua's libraries dir.
                            Default is $LUA_DIR/lib
--with-downloader=TOOL      Which tool to use as a downloader.
                            Valid options are: curl, wget.
                            Default is to auto-detect.
--with-md5-checker=TOOL     Which tool to use as a downloader.
                            Valid options are: md5sum, openssl
                            Default is to auto-detect.
--versioned-rocks-dir       Use a versioned rocks dir, such as
                            $PREFIX/lib/luarocks/rocks-5.1/.
                            Default is to auto-detect the necessity.
--force-config              Use a single config location. Do not use the
                            $LUAROCKS_CONFIG variable or the user's home
                            directory. Useful to avoid conflicts when LuaRocks
                            is embedded within an application.
```

> As I always have installed it by means of a deb package, this
> procedure seemed to be misleading.
>
> Unfortunately, the deb package of Luarocks was not updated.

Installing the Lua headers deb file will probably fix things for you
and configure wil be able to find the files it needs.

I don't use Debian, but if you have further problems I'm sure there
will be other LuaRocks users on Debian/Ubuntu here on the list that
will able to help you with the specifics.

-- Hisham