I’m trying to use load
in a lua script to handle env values passed in from docker-compose with osimis/orthanc.
However, I’m, getting errors because that depends on Lua 5.2 or later. I can see from this forum and the code that jodogne/orthanc is on 5.3.5.
In osimis/orthanc though I assume the lua in use is /usr/lib/x86_64-linux-gnu/liblua5.1-*
Have I got this right? Is there a reason for this?
Thanks
Ed
Hello,
The “jodogne/orthanc” images, that use the LSB (Linux Standard Base) compilers, are statically linked against Lua 5.3.
On the other hand, the “osimis/orthanc” images are dynamically linked against Lua 5.1, because this is the version that comes with Debian 10 (buster).
But, “Lua x.y.z releases are ABI compatible with x.y.w releases”, which explains the reason why you are getting errors if loading modules compiled for Lua 5.2:
http://lua-users.org/wiki/ApplicationBinaryInterface
As a consequence, if you use “jodogne/orthanc”, you must make sure to use Lua modules that have been compiled against Lua 5.3. If you use “osimis/orthanc”, you should rely on “apt” to install modules: They will automatically be compatible with Orthanc.
HTH,
Sébastien-
Thanks Sébastien
I was worried that the osimis image might be fixed on 5.1 for a reason.
In my docker file, I’ve added
RUN apt -y remove liblua5.1
RUN apt-get update && apt-get -y install liblua5.3
but now when I run docker-compose I get the following error:
Orthanc: error while loading shared libraries: liblua5.1.so.0: cannot open shared object file: No such file or directory
Do I need to be changing something else to get it to use 5.3 instead of 5.1?
Thanks - I appreciate any clues you can give me!
Ed
Lua 5.1 is added fairly early in the Osimis docker build I think:
https://bitbucket.org/osimis/orthanc-builder/src/docker/orthanc-builder-base/Dockerfile#lines-14
Is it possible to change the Lua version after everything else has been built?
My full Docker file at the moment is this:
FROM osimis/orthanc:master
RUN apt -y remove liblua5.1*
RUN apt-get update && apt-get -y install zip unzip liblua5.3-dev
COPY openrem_orthanc_config_docker.lua /etc/share/orthanc/scripts/
Is it going to be possible to make this work without trying to replicate the whole osimis build process?
Kind regards
Ed
This is not possible: Orthanc is linked against “liblua5.1”, which cannot be changed after compilation.
It is mandatory to recompile Orthanc from scratch if you want to use “liblua5.3”.
I don’t know if there is a specific reason why Orthanc is linked against Lua 5.1 instead of 5.3: I let Alain answer, as he’s the one who created those images.
Sébastien-
I just kept the 5.1 because that was what we had in previous images
Ed, if you could try rebuilding the images with 5.3, validate that everything works and send us the patch; that would be great !
Thanks Alain
I’ll have a go. Will it be obvious if everything just works? I’m not really using the more advanced functionality, just the ability to pass config variables - does the osimis functionality make use of Lua at all, or is the Lua component and use exactly as per jodogne/orthanc?
Yes, we do nothing special about Lua. If you’re able to start a Lua script that is already a good check.
If you could also try by using a non standard Lua module you had to install on the system, that would even be better.
I’ve sent a pull request in Alain - I think I found the right Alain Mazy to put as a reviewer.
I hope it was what you were wanting
Hi Ed,
Yes, that was perfect.
New images 20.5.1 are out with your change !
Thanks a lot for that contribution.
Alain.