lua-users home
lua-l archive

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


Hello,

I posted this question beneath there: http://askubuntu.com/questions/486263/how-to-install-an-ansi-c-compiler-how-can-i-extend-gcc-g-with-ansi-c

regards
Mr. M. Bärlocher

Quote: "Hello,

To explain the problem (try two):
I can't install the lua compiler (lua do org) with the newest version of Ubuntu, quote out of the manual of lua to install lua:

"Installing Lua

Lua is distributed in source form. You need to build it before using it. Building Lua should be straightforward because Lua is implemented in pure ANSI C and compiles unmodified in all known platforms that have an ANSI C compiler.
***[Right this Ubuntu does not have, as it seems... Mr. M. Bärlocher]***
Lua also compiles unmodified as C++.
***[As it seem nope, the error msg is further below...]***
The instructions given below for building Lua are for Unix-like platforms. See also instructions for other systems and customization options.

If you don't have the time or the inclination to compile Lua yourself, get a binary from LuaBinaries. Try also Lua for Windows, an easy-to-use distribution of Lua that includes many useful libraries.
Building Lua

In most Unix-like platforms, simply do "make" with a suitable target. Here are the details.

    Open a terminal window and move to the top-level directory, which is named lua-5.2.3. The Makefile there controls both the build process and the installation process.

    Do "make" and see if your platform is listed. The platforms currently supported are:

    aix ansi bsd freebsd generic linux macosx mingw posix solaris

    If your platform is listed, just do "make xxx", where xxx is your platform name.
***[The make command does not have an ansi c option.]***
    If your platform is not listed, try the closest one or posix, generic, ansi, in this order.

    The compilation takes only a few moments and produces three files in the src directory: lua (the interpreter), luac (the compiler), and liblua.a (the library).

    To check that Lua has been built correctly, do "make test" after building Lua. This will run the interpreter and print its version string.

If you're running Linux and get compilation errors, make sure you have installed the readline development package. If you get link errors after that, then try "make linux MYLIBS=-ltermcap".
Installing Lua

Once you have built Lua, you may want to install it in an official place in your system. In this case, do "make install". The official place and the way to install files are defined in the Makefile. You'll probably need the right permissions to install files.

To build and install Lua in one step, do "make xxx install", where xxx is your platform name.

To install Lua locally, do "make local". This will create a directory install with subdirectories bin, include, lib, man, and install Lua as listed below. To install Lua locally, but in some other directory, do "make install INSTALL_TOP=xxx", where xxx is your chosen directory.

bin:
    lua luac
include:
    lua.h luaconf.h lualib.h lauxlib.h lua.hpp
lib:
    liblua.a
man/man1:
    lua.1 luac.1

These are the only directories you need for development. If you only want to run Lua programs, you only need the files in bin and man. The files in include and lib are needed for embedding Lua in C or C++ programs."

The Error Msg, quote:

"awytok@awytok-Athlon-II:~/Desktop/lua-5.2.3$ make linux
cd src && make linux
make[1]: Entering directory `/home/awytok/Desktop/lua-5.2.3/src'
make all SYSCFLAGS="-DLUA_USE_LINUX" SYSLIBS="-Wl,-E -ldl -lreadline"
make[2]: Entering directory `/home/awytok/Desktop/lua-5.2.3/src'
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lapi.o lapi.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lcode.o lcode.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lctype.o lctype.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o ldebug.o ldebug.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o ldo.o ldo.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o ldump.o ldump.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lfunc.o lfunc.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lgc.o lgc.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o llex.o llex.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lmem.o lmem.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lobject.o lobject.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lopcodes.o lopcodes.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lparser.o lparser.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lstate.o lstate.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lstring.o lstring.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o ltable.o ltable.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o ltm.o ltm.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lundump.o lundump.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lvm.o lvm.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lzio.o lzio.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lauxlib.o lauxlib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lbaselib.o lbaselib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lbitlib.o lbitlib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lcorolib.o lcorolib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o ldblib.o ldblib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o liolib.o liolib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lmathlib.o lmathlib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o loslib.o loslib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lstrlib.o lstrlib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o ltablib.o ltablib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o loadlib.o loadlib.c
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o linit.o linit.c
ar rcu liblua.a lapi.o lcode.o lctype.o ldebug.o ldo.o ldump.o lfunc.o lgc.o llex.o lmem.o lobject.o lopcodes.o lparser.o lstate.o lstring.o ltable.o ltm.o lundump.o lvm.o lzio.o lauxlib.o lbaselib.o lbitlib.o lcorolib.o ldblib.o liolib.o lmathlib.o loslib.o lstrlib.o ltablib.o loadlib.o linit.o
ranlib liblua.a
gcc -O2 -Wall -DLUA_COMPAT_ALL -DLUA_USE_LINUX    -c -o lua.o lua.c
lua.c:67:31: fatal error: readline/readline.h: No such file or directory
#include <readline/readline.h>
                               ^
compilation terminated.
make[2]: *** [lua.o] Error 1
make[2]: Leaving directory `/home/awytok/Desktop/lua-5.2.3/src'
make[1]: *** [linux] Error 2
make[1]: Leaving directory `/home/awytok/Desktop/lua-5.2.3/src'
make: *** [linux] Error 2
awytok@awytok-Athlon-II:~/Desktop/lua-5.2.3$ "

I don't want to, can not, and will not modify the file behind the 'make linux' command with to extend it with parameters for -ansi -pedantic...

So I have two theories, it's something wrong with the file behind make linux of lua, or with the additionally installed compiler gcc, hm!
I send a copy of this question also to the lua team!

regards

Mr. M. Bärlocher

PS: The @ Seth; It was an internal post scriptum after the question, tztz... I packed this additional text into the about box of my profile here. I wish you a nice weekend!"