Beefy
Posts: 5
Joined: Fri Oct 18, 2024 5:58 pm

Can MAME be compiled so the LUA interpreter allows the use of dynamic libraries?

I am seeing this under mac os:
mame 0.268
Copyright (C) Nicola Salmoria and the MAME team

Lua 5.4
Copyright (C) Lua.org, PUC-Rio

[MAME]> dofile("/Users/user_name/proj/ast/luaclient.lua")
error: error loading module 'socket.core' from file '/Users/user_name/.luarocks/lib/lua/5.4/socket/core.so':
dynamic libraries not enabled; check your Lua installation
Is there a recommended method by which mame can be compiled so that the Lua interpreter allows the use of dynamic libraries? I am willing to assume the security risks for my use case.
mhoes
Posts: 239
Joined: Wed Oct 26, 2016 12:26 pm

Re: Can MAME be compiled so the LUA interpreter allows the use of dynamic libraries?

Beefy wrote: Thu Oct 24, 2024 4:25 pm Is there a recommended method by which mame can be compiled so that the Lua interpreter allows the use of dynamic libraries? I am willing to assume the security risks for my use case.
I do not know if this is possible, but am wondering what it is that you are trying to achieve here ?
Beefy
Posts: 5
Joined: Fri Oct 18, 2024 5:58 pm

Re: Can MAME be compiled so the LUA interpreter allows the use of dynamic libraries?

Communicate via socket from MAME Lua interpreter to another process, a Python server. I got a simple model working. It's a Lua client and a Python server communicating under Mac OS. Both Lua and Python are installed locally. Now that it works, I want to execute the Lua code from the MAME interpreter, but the interpreter is forbidding the loading of libraries (dynamic libraries). In this case, it's complaining about a require statement for Luasocket.

What do you think? Is there another way?
Beefy
Posts: 5
Joined: Fri Oct 18, 2024 5:58 pm

Re: Can MAME be compiled so the LUA interpreter allows the use of dynamic libraries?

Compiling using

CFLAGS="-DLUA_USE_MACOSX". (or pick your particular OS)

... will allow the use of dynamic libraries.

Return to “MAME Discussion”