[Cs-dev] Building Csound6 on Debian: can't link in Lua
Date | 2013-08-28 18:45 |
From | Forrest Cahoon |
Subject | [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Attachments | None None |
I'm building Csound 6.00.1 on Debian sid and the CMake scripts are telling me they can't find LUA_LIBRARIES,which disables the lua opcodes and interfaces. I'm invoking CMake like this, in the root dir of the extracted tarball:cmake -D EIGEN3_INCLUDE_DIR=/usr/include . -- Could NOT find Lua51 (missing: LUA_LIBRARIES) (found version "5.1.5") |
Date | 2013-08-28 18:50 |
From | Felipe Sateler |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Attachments | None None |
See the debian package, I have included a patch for this (don't know which, though). The lua opcodes require LuaJIT and cannot use lua, but the test does try to set LUA_LIBRARIES. Because LUA_LIBRARIES is NOTFOUND when it cannot find LuaJIT, then FindLua51 will fail.
On Wed, Aug 28, 2013 at 1:45 PM, Forrest Cahoon <forrest.cahoon@gmail.com> wrote:
Saludos, Felipe Sateler |
Date | 2013-08-28 21:57 |
From | Steven Yi |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Hi Felipe, This should probably be fixed upstream. I've already modified the eigen3 stuff to search standard paths. For Lua, I think this is the reason why it's not compiling here on OSX. Is this the patch you are referring to: http://patch-tracker.debian.org/patch/series/view/csound/1:6.00.1~dfsg-1/0001-lua-luajit.diff I didn't see a patch for the SWIG Lua interface though, am I correct in thinking it does not compile on Linux? Thanks, steven On Wed, Aug 28, 2013 at 1:50 PM, Felipe Sateler |
Date | 2013-08-28 22:28 |
From | Felipe Sateler |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Attachments | None None |
I'm not on my debian workstation, so I can't check, but this problem only affects the lua opcodes. The others can use standard lua just fine. (I wonder why is luajit needed in the lua opcodes, though). It compiles just fine. I was sure I had pushed that patch to git, is it not there? (patches starting with 0 are supposed to be picked from the upstream repository).
On Wed, Aug 28, 2013 at 4:57 PM, Steven Yi <stevenyi@gmail.com> wrote: Hi Felipe, Saludos, Felipe Sateler |
Date | 2013-08-28 23:01 |
From | Felipe Sateler |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
I've confirmed that I did push the changes. In my debian pc, I can build the lua interface, and run the lua_example just fine. Building the lua opcodes requires making cmake find luajit-5.1 instead of luajit On Wed, Aug 28, 2013 at 5:28 PM, Felipe Sateler |
Date | 2013-08-29 16:03 |
From | Steven Yi |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Okay, I need to get this situation sorted out here. It looks like neither the Lua Opcodes or interface are building here. Michael: is it preferable to have the Lua interface compiled with regular Lua and the Opcodes compiled with Luajit? Is it alright (and possible) to just use luajit for both? Would that affect users trying to use the lua interface if the lib is not linked in? (similarly to how the python interfaces don't link but have the symbols resolved by the interpreter loading the libs) It seems to me the expectation is: 1. for lua opcodes, lua should be statically linked in so that users who do not have lua installed to system libs can still use it 2. for lua interfaces, it is expected user will have lua installed as they will be using the interface from the lua interpreter, so no linking required. On Wed, Aug 28, 2013 at 6:01 PM, Felipe Sateler |
Date | 2013-08-29 16:13 |
From | Felipe Sateler |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
On Thu, Aug 29, 2013 at 11:03 AM, Steven Yi |
Date | 2013-08-29 16:29 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Attachments | None None |
Everything should be compiled with LuaJIT. LuaJIT is a drop-in replacement for Lua 5.1 (mostly). I think the source of confusion here is people not getting that Lua now mostly means LuaJIT. People are writing some computer games for sale that mostly use LuaJIT. I have noticed that DropBox is linked with LuaJIT. I don't think statically linking LuaJIT is a good idea. On Windows this would make it impossible to load other native Lua code. On other platforms it should work better. In other words, if the Lua opcodes statically link LuaJIT, then on Windows they cannot "require" (load) other Lua libraries that use native code. That code will not find the LuaJIT entry points in the static library, and if they do find the LuaJIT entry points in some external shared library, the two LuaJITs will fight and the application will crash.
My approach and assumption so far has been: (1) Both the Lua interface and the Lua opcodes use LuaJIT. Period. (2) Both the LuaJIT shared library and the LuaJIT interpreter are locally installed, that is, as parts of Csound. The interpreter will run Lua scripts that use the Lua interface.
(3) Repeat, LuaJIT includes its own Lua interpreter that uses LuaJIT, both are part of Csound on Windows. I suspect this will continue to be the best configuration. Hope this helps,
Mike =========================== Michael GoginsIrreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Thu, Aug 29, 2013 at 11:03 AM, Steven Yi <stevenyi@gmail.com> wrote: Okay, I need to get this situation sorted out here. It looks like |
Date | 2013-08-29 16:48 |
From | Felipe Sateler |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Do note that luajit has limited architecture availability (because it needs native codegen). http://luajit.org/install.html On Thu, Aug 29, 2013 at 11:29 AM, Michael Gogins |
Date | 2013-08-29 16:52 |
From | Steven Yi |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Hi Michael, Thanks for clarifying. It seems then that the Lua finders in CMake are not quite what we need then, as they look for Lua but not Luajit specifically. I will modify these then to use find_library to specifically look for libluajit. Also, since it's clear now that this is all meant to link to shared libs, I will look into compiling luajit as a shared lib and packaging that along with the OSX installer. Thanks! steven On Thu, Aug 29, 2013 at 11:29 AM, Michael Gogins |
Date | 2013-08-29 17:41 |
From | Michael Gogins |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Attachments | None None |
Thanks a lot, Mike =========================== Michael GoginsIrreducible Productions http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com On Thu, Aug 29, 2013 at 11:52 AM, Steven Yi <stevenyi@gmail.com> wrote: Hi Michael, |
Date | 2013-08-29 20:18 |
From | Steven Yi |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Hi All, I've updated the CMake scripts. What I did was change it to look only for luajit or luajit-5.1 (the latter is required for OSX, I assume the former worked on Debian but didn't here). I also have it looking for luajit-2.0/lua.h and using that directory as an include directory. This means if you have things installed in /usr/include or /usr/local/include, the finder should find it if you have /usr/include/luajit-2.0/lua.h or /usr/local/include/luajit-2.0/lua.h. If you have it located elsewhere, you can add it to your include search path in Custom.cmake. I made it search for luajit-2.0/lua.h as that is where the Makefile installs things for LuaJit. If you all could test, that'd be great. With these changes I get Lua Opcodes, Lua interface, and CsoundAC Lua interface all compiling with Luajit. Thanks! steven On Thu, Aug 29, 2013 at 12:41 PM, Michael Gogins |
Date | 2013-08-31 21:57 |
From | Forrest Cahoon |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Attachments | None None |
Steven, the CMake changes you made are still not working for me on Debian sid. With the latest git pull, I'm still getting the error Here's info about my Lua include files and shared libs, in case that helps:-- Could NOT find Lua51 (missing: LUA_LIBRARIES) (found version "5.1.5") forrest@makemake:~/src/csound-csound6-git$ find '/usr/include' -name 'lua.h' -print /usr/include/lua5.1/lua.h /usr/include/luajit-2.0/lua.h forrest@makemake:~/src/csound-csound6-git$ /sbin/ldconfig -p | grep lua liblua5.1.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/liblua5.1.so.0 liblua5.1.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/liblua5.1.so liblua5.1-c++.so.0 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so.0 liblua5.1-c++.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/liblua5.1-c++.so libluajit-5.1.so.2 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libluajit-5.1.so.2 libluajit-5.1.so (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libluajit-5.1.so On Thu, Aug 29, 2013 at 2:18 PM, Steven Yi <stevenyi@gmail.com> wrote: Hi All, |
Date | 2013-08-31 22:57 |
From | Steven Yi |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Hi Forrest, Are you on the develop branch? I don't see any references to Lua51 anywhere now with the latest from develop. steven On Sat, Aug 31, 2013 at 4:57 PM, Forrest Cahoon |
Date | 2013-09-01 01:20 |
From | Forrest Cahoon |
Subject | Re: [Cs-dev] Building Csound6 on Debian: can't link in Lua |
Attachments | None None |
Ah, that explains it. In the develop branch, CMake recognizes Lua just fine. Thanks.
On Sat, Aug 31, 2013 at 4:57 PM, Steven Yi <stevenyi@gmail.com> wrote: Hi Forrest, |