Compiling darktable with lua support

Can anybody give me help on how to compile dartkable with lua support?

(asked this already in a separate thread but it was a tangential question so perhaps it’s worth repeating my question)

I have installed and compiled lua 5.3 directly from source (followed directions here, “installing from source”: https://www.lua.org/start.html#installing), so now I have the bin, libraries and include files all under /usr/local (that’s in the path).

However when compiling darktable directly from git master I get this message like it’s not finding lua:

-- Checking for one of the modules 'lua53;lua5.3;lua-5.3;lua'
-- Lua support: System library for lua 5.3 not found (to use darktable's version use - -DDONT_USE_INTERNAL_LUA=Off)

I’m also unable to use the flag --DDONT_USE_INTERNAL_LUA as suggested – tried as an argument to ./build.sh but didn’t work.

Thanks in advance!

When you finished compiling lua, did you do a

make install INSTALL_TOP=/usr/local

to install the lua executable in /usr/local/bin.

More information about what OS and version you’re running would be helpful.

just curious for which OS/Distro are you building?

Sorry guys for not having given more info. I’m on Linux, Ubuntu 18.10.

@wpferguson : yes I did install the lua binary and everything else that got compiled with make linux and then `sudo make install. The binaries are in /usr/local/bin now.

If darktable still isn’t finding it, you could try installing the lua5.3 package using apt. I’m using 18.04 and that works fine.

is the ubuntu package and therefor the OBS package lacking lua support?

if not you could just check what we install for building with it. or just use the package:)

The ubuntu package relies on an external lua interpreter, i.e. the lua5.3 package. The only binary built with the internal lua interpreter enabled is windows, AFAIK.

When compiling darktable, on linux, the build process searches for a lua installation and uses that, if found. You can change the CMakeLists.txt file and enable the internal lua interpreter, which will cause it to get built into the binary.

I’m running ubuntu 18.04. I installed the lua5.3 package using apt-get. I installed darktable from Pascal’s PPA. The lua scripts work fine.

I’ve also downloaded the latest git and compiled it. It builds with lua support enabled automatically and, again, lua scripts work fine.

I thought it would the linked in liblua for running the scripts and not relying on the external binary.

something to test I guess.

So I have tried installing lua with apt: sudo apt install lua5.3, the binary gets installed in /usr/bin (while the installation building from source had it insgtalled in /usr/local/bin): no news, darktable still won’t find the damned binary.

And to reply to @darix no I don’t think dartable looks for liblua, it actually searches for one of the following binaries: LUA53 lua53 lua5.3 lua-5.3 lua (as I can see in darktable/cmake/modules/FindLua53.cmake).

Anyway I’ve solved the issue following @wpferguson suggestion, i.e. I edited CMakeLists.txt file and enabled the internal lua interpreter by changing to ON this option:

option(USE_LUA "Build lua scripting support" ON)

(I know you guys know it already but I thought to leave a trace for somebody else that may have similar problems in the future).

Now I’m back with LUA support, thanks!

1 Like

uhm … I am pretty sure, you are wrong and it is using the shared library. and at most it is using the library to find the lua library.

Alright @darix I’m sure you know this better than me! It was just a guess by looking at a few files in the git folder.

Anything you were missing in our master builds for ubuntu?

The lighttable speedup updates that @Pascal_Obry did after my post here: https://discuss.pixls.us/t/darktable-performance-in-lighttable-mode-tagging-etc/10827

yes you can get all those master improvements here

https://software.opensuse.org/download.html?project=graphics:darktable:master&package=darktable

Well doh! I did not realize the packages here are updated so frequently! So yes I could’ve spared all the hassle of going through git pull then compiling etc, thanks for reminding me this!

normally they will be triggered on each git push. we have some lags right now but I hope to fix those tomorrow evening. right now they are up2date with HEAD.

As a new linux user, not totally understanding the ways of Linux I had trouble building darktable with Lua support.

Having followed the thead here with no joy, I ended up googling a solution and found that I need to install the dev version on the library.

sudo apt-get install lua5.3-dev

1 Like

you want to get darktable master for which distribution?

Sorry I didn’t make it clear I was having trouble compiling the darktable master for Linux Mint with Lua support until I realised that I need to install the dev version of Lua.

I was just adding the information for other who might stumble as I had done.

1 Like

I posted this as an issue on GitHub, so hopefully the developers will add lua5.3-dev to the list of optional dependencies on the wiki.

1 Like