lua-users home
lua-l archive

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


Last night I downloaded Lua 5.1 for installation on my linux machine at
home, and I noticed that the /src/Makefile has been modified for AIX
somewhat as I suggested below, but with my suggested:

CFLAGS="-O2 -DLUA_USE_POSIX -DLUA_USE_DLOPEN"

changed to:

CFLAGS="-O2" MYCFLAGS="-DLUA_USE_POSIX -DLUA_USE_DLOPEN"

Perhaps it makes better sense that way, but in fact, it does not work here
on my AIX 5.2 machine.  When I compile Lua 5.1 with the second set of parms
and then attempt to invoke lua with "lua -lsomething", I receive the
message:

lua: error loading module 'something' from file
'/mydirectory/lib/lua/5.1/something.so':
      dynamic libraries not enabled; check your Lua installation

On the other hand, everything works fine when I compile with the parms that
I originally suggested.  I believe the explanation is that with the
modified parms, the indicated -D flags are not set when the lua
interpreter, "lua" is compiled.

It could be that I have been mistaken in implementing, here at work, what I
recall having seen in the makefile, but I suggest that this be checked.

Mark F. Morss
Principal Analyst, Market Risk
American Electric Power


                                                                           
             mfmorss@aep.com                                               
             Sent by:                                                      
             lua-bounces@bazar                                          To 
             2.conectiva.com.b         Lua list                            
             r                         <lua@bazar2.conectiva.com.br>       
                                                                        cc 
                                       Lua list                            
             02/15/2006 01:39          <lua@bazar2.conectiva.com.br>,      
             PM                        lua-bounces@bazar2.conectiva.com.br 
                                                                   Subject 
                                       Actual success installing Lua 5.1   
             Please respond to         on AIX 5.2                          
                 Lua list                                                  
             <lua@bazar2.conec                                             
               tiva.com.br>                                                
                                                                           
                                                                           
                                                                           




Well, it appears that with help form Alex Queiroz and some others, I
finally have been able to install, properly, Lua 5.1 on AIX 5.2 with
dynamic loading enabled.  I re-installed Lua, issuing "make aix" with
.../Lua-5.1/src/Makefile modified as follows:

23c23
< PLATS= ansi bsd generic linux macosx mingw posix solaris
---
> PLATS= ansi bsd generic linux macosx mingw posix solaris aix
108a109,112
>
> aix:
>            $(MAKE) all CC="xlc" CFLAGS="-O2 -DLUA_USE_POSIX
-DLUA_USE_DLOPEN" MYLIBS="-ldl" MYLDFLAGS="-brtl -bexpall"
>

I then compiled the suggested "dummy" library (see previous correspondence)
in ../Lua-5.1/src, using:

xlc -G -bexpall -o dummy.so dummy.c

Then "lua -v -ldummy" produced the desired result with no error messages.

To compile a dynamic library to be used with Lua on AIX, it is necessary to
use -G -bexpall.  It does not appear to be necessary to use -bnoentry or
-qmkshrobj.

Mark F. Morss
Principal Analyst, Market Risk
American Electric Power