From: Atri <bad...@ai...> - 2012-02-16 17:06:58
|
Hi! Thanks for all the helpful suggestions. My first attempt at building with lua 5.2 is outlined below. On Sat, 2012-02-11 at 14:57 -0800, Alan W. Irwin wrote: > Copy the system version of > FindLua51.cmake (usually found in > /usr/share/cmake-2.8/Modules) to cmake/modules. > > That copy operation assures that the PLplot system will use the > version of FindLua51.cmake in cmake/modules rather than > the system one. > > Then edit the PLplot version as follows: > > Wherever there is a reference to Lua 5.1 put in additional 5.2 choices > first. > > That is: > > PATH_SUFFIXES include/lua51 include/lua5.1 include/lua include > > ==> > > PATH_SUFFIXES include/lua52 include/lua5.2 include/lua51 include/lua5.1 include/lua include > > > NAMES lua51 lua5.1 lua-5.1 lua > > ==> > > NAMES lua52 lua5.2 lua-5.2 lua51 lua5.1 lua-5.1 lua > > Leave > > FIND_PACKAGE_HANDLE_STANDARD_ARGS(Lua51 ... > > as is since the 51 there refers to the name of the find module itself > which for now should continue to be cmake/modules/FindLua51.cmake. > In addition to these changes, I also had to do the following to the file cmake/modules/lua.cmake --- lua.cmake.orig 2011-10-13 06:13:01.000000000 +0530 +++ lua.cmake 2012-02-13 00:03:36.000000000 +0530 @@ -100,6 +100,8 @@ set(LUA_VERSION_VALID ON) elseif(${LUA_VERSION} STREQUAL "5.1" AND LUA51_FOUND) set(LUA_VERSION_VALID ON) + elseif(${LUA_VERSION} STREQUAL "5.2" AND LUA51_FOUND) + set(LUA_VERSION_VALID ON) endif(${LUA_VERSION} STREQUAL "5.0" AND LUA50_FOUND) if(NOT LUA_VERSION_VALID) --- After these modifications to the source directory, and using a modified version of swig-2.0.4 with the following patch applied http://sourceforge.net/tracker/index.php?func=detail&aid=3480366&group_id=1645&atid=301645 I got plplot along with its lua bindings to build successfully with lua 5.2. > If your PLplot lua-5.2 build goes okay (with -DBUILD_TEST=ON cmake > option) with the above copy and edit of FindLua51.cmake, then please > also try run-time testing of our lua bindings using the following > command: > > make test_lua_psc > > which runs all our lua examples with -dev psc. > > If that works without issues (i.e., the lua results in the examples > subdirectory of the build tree render okay with a PostScript viewer > like gv) I would be happy to copy your modified version of > FindLua51.cmake to PLplot so all PLplot/Lua-5.2 users can benefit. > __________________________ > Alan W. Irwin > Now here is where the problem occurs. When attempting the 'make test_lua_psc' the first example 'x01' seems to work fine. However, for 'x02', --- Testing front-end lua x01 x02 /usr/bin/lua: x02.lua:105: attempt to call field 'mod' (a nil value) stack traceback: x02.lua:105: in function 'demo2' x02.lua:150: in main chunk [C]: in ? make[3]: *** [examples/x01lua.psc] Error 1 make[2]: *** [examples/CMakeFiles/test_lua_psc.dir/all] Error 2 make[1]: *** [examples/CMakeFiles/test_lua_psc.dir/rule] Error 2 make: *** [test_lua_psc] Error 2 error: Bad exit status from /var/tmp/rpm-tmp.RoZaxq (%build) --- ... and there the build halts with an error. Any suggestions about this? As a side-note, I also got plplot's lua bindings building for openSUSE Factory (latest) by explicitly using lua < 5.2 which is also supported for the foreseeable future :). It will be good, nontheless, if we fix issues with 5.2 as well. Bye and thanks again for all the help. -- Atri |