From: Atri <bad...@ai...> - 2012-02-12 12:56:54
|
On Sat, 2012-02-11 at 14:57 -0800, Alan W. Irwin wrote: > On 2012-02-11 19:53+0530 Atri wrote: > > > Hi! > > > > I package plplot (version 5.9.9) for the Linux distribution openSUSE > > [1]. I have run into a problem with building plplot for openSUSE's > > factory (eventually this will become the next openSUSE release): the > > version of lua in factory is 5.2 [2], but plplot's lua bindings won't > > build with lua > 5.1. For now I have just disabled the lua bindings for > > factory. It seems to me that the cmake module for building the lua > > bindings check explicitly for versions of lua = 5.0 and 5.1. It might be > > useful to adapt this cmake module to accept any lua version >= 5.0. I > > have really little knowledge about cmake, but could help out with build > > testing etc. as the need be. > > Hi Atri: > > Lua-5.2 was released only in December so it will take a while for that > to propagate to most Linux distros. For example, Debian is quite > conservative and only supports Lua-5.0 even in the unstable version > of Debian for some reason. > > So the bad news is you will be somewhat on your own (i.e., the only > potential tester of Lua-5.2 with PLplot that I am aware of) for a > while, but the good news is the CMake build system should be really > easy to modify so that you can find and attempt to build and test > PLplot using Lua 5.2. > > If you are interested further, here is what I suggest you do. > > 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. > > I think the above two changes should be all the changes you need so > that the PLplot CMake-based build system will find the lua-5.2 library > and header files. > I tried to do that following your suggestions. So I now bundled up FindLua51.cmake in the plplot source directory and tried to do a build after the suggested modifications. So the file FindLua51.cmake in the directory cmake/modules has this:- =================================== FIND_PATH(LUA_INCLUDE_DIR lua.h HINTS $ENV{LUA_DIR} PATH_SUFFIXES include/lua52 include/lua5.2 include/lua51 include/lua5.1 include/lua include PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw # Fink /opt/local # DarwinPorts /opt/csw # Blastwave /opt ) FIND_LIBRARY(LUA_LIBRARY NAMES lua52 lua5.2 lua-5.2 lua51 lua5.1 lua-5.1 lua HINTS $ENV{LUA_DIR} PATH_SUFFIXES lib64 lib PATHS ~/Library/Frameworks /Library/Frameworks /usr/local /usr /sw /opt/local /opt/csw /opt ) =============================== However the build still fails with the following messages:- =============================== CMake Error at cmake/modules/FindLua51.cmake:69 (INCLUDE): include could not find load file: /home/abuild/rpmbuild/BUILD/plplot-5.9.9/cmake/modules/FindPackageHandleStandardArgs.cmake Call Stack (most recent call first): cmake/modules/lua.cmake:63 (find_package) cmake/modules/plplot.cmake:475 (include) CMakeLists.txt:91 (include) -- Found Lua51: /usr/lib64/liblua.so;/usr/lib64/libm.so -- LUA_VERSION = 5.2 -- WARNING: Lua executable found but version not consistent with library. Disabling Lua bindings =============================== I am sure I am doing something wrong, but can't quite figure it out. > Also, thank you for supporting PLplot by packaging it > for openSUSE. > > Alan > Thanks for your extensive help. -- Atri |