From: Atri <bad...@ai...> - 2012-02-11 14:24:12
|
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. Thanks a lot! -- Atri [1] https://build.opensuse.org/package/show?package=plplot&project=science [2] http://www.lua.org/versions.html#5.2 |
From: Alan W. I. <ir...@be...> - 2012-02-11 22:57:51
|
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. At that point, you will be in the interesting position of being able test whether PLplot will work without further changes with lua-5.2. As far as I know, PLplot makes no distinctions between 5.0 and 5.1 so I think 5.2 has a reasonable chance to work, but we won't know that until you try it. 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. Good luck, and let us know how it goes. Also, thank you for supporting PLplot by packaging it for openSUSE. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Alan W. I. <ir...@be...> - 2012-02-12 22:01:20
|
On 2012-02-11 14:57-0800 Alan W. Irwin wrote: > 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. The first sentence is right which still implies it will be a while before very many PLplot users can help with 5.2 testing, but I would like to correct the Debian misinformation in the rest of that paragraph. Basically, I was confused by a change in lua package naming schemes so I missed the more modern lua packages for Debian in that comment. To correct that comment, the lua50 and lua5.1 (note the changed naming convention) Debian packages are in Debian stable, testing, and unstable. The lua5.2 Debian package is only in Debian experimental now, and I expect it will be after the next release of Debian before it becomes part of Debian unstable and eventually gets propagated from there (if it passes all tests) to Debian testing. I do plan to upgrade from Debian stable to testing in late March, but even then I don't expect to have access to a packaged version of lua 5.2 from the above results on the packaging of lua for Debian. Therefore, I hope the three lines of changes I have suggested to Atri for our build system so that it can find lua 5.2 will allow him to test whether PLplot actually builds and runs OK with the 5.2 version of lua. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Andrew R. <and...@us...> - 2012-02-12 22:28:34
|
On Sat, Feb 11, 2012 at 02:57:44PM -0800, Alan 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. Hi Atri, That is not entirely true. Lua5.1 has been in debian for some time (it is present in lenny (oldstable) which was released several years ago now. Lua5.2 (or at least a RC of the final release) is available in Debian experimental, so there is some work going on there. Anyway, the point still stands that the core developers don't currently have easy access to lua 5.2, so you help in testing will be invaluable. Anyway, in the case of plplot there are two external issues. One is the cmake support (which you have already encountered and which Alan has offered some advice on). The other is that the lua bindings are generated by swig. A quick google search suggests there are issues with swig and lua 5.2 http://lua-users.org/lists/lua-l/2011-12/msg00803.html but it would be good to confirm / refute this with plplot. There is a patch for swig on sourceforge which you could test http://sourceforge.net/tracker/index.php?func=detail&aid=3480366&group_id=1645&atid=301645 Do let us know how you get on. Regards Andrew |
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 |
From: Alan W. I. <ir...@be...> - 2012-02-12 18:28:28
|
On 2012-02-12 18:26+0530 Atri wrote: > On Sat, 2012-02-11 at 14:57 -0800, Alan W. Irwin wrote: >> 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 [...] > 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 [...] > 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 > =============================== > Sorry, I completely missed one additional change in my directions. Make the following change as well: INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) ==> INCLUDE(FindPackageHandleStandardArgs) Note, the second form must have ".cmake" dropped as indicated. The first form looks only in cmake/modules for FindPackageHandleStandardArgs.cmake, and since it is not there you got the above error message. The second form looks in cmake/modules first, but if not there looks in the system location for FindPackageHandleStandardArgs.cmake (which is what we want in this case). Hope that additional change allows our build system to find lua5.2, but if not, I would be happy to help some more. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
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 |
From: Alan W. I. <ir...@be...> - 2012-02-16 19:46:29
|
On 2012-02-16 22:36+0530 Atri wrote: > 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. Good. > > >> 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? The fact that you got the lua-5.2 build to work and example 1 (which actually is pretty complicated) to run shows, I think, that you are down to really specific issues as opposed to "nothing works". So the prospects for PLplot to completely support lua-5.2 look extremely promising. The above "make test_lua_psc" command sets up being able to run individual lua examples by hand. Here is how you do that: In the build directory.... cd examples/lua lua x01.lua -dev psc -o test.ps Does test.ps generated this way give a good-looking result using the gv viewer of PostScript files? If so, then I would try example 2 which should generate the above error message The offending line in question for example 2 is the innocuous looking h = (360/10) * math.mod(i, 10) I checked, and example 1 uses the math library as well so access to that lua library appears not to be an issue. So it appears that math.mod simply does not exist for 5.2. In fact, the 5.2 documentation doesn't refer to it and the 5.1 documentation http://www.lua.org/manual/5.1/manual.html says "Function math.mod was renamed math.fmod". Apparently my own 5.1 version of Lua only works because of compatibility mode. If you look up the math functions in lua in the above documentation thy simply appear to be front ends for the C library version, e.g., math.fmod corresponds to the C library floating-point fmod function, and I presume lua takes care of all the casting from integers for the above case. So one possibility to deal with this is simply to replace all math.mod in the several examples where that occurs with math.fmod. However, another alternative is to use the lua % operator (which takes the remainder relative to minus infinity rather than zero as in the math.fmod case). If we are always dealing with positive values using the % operator might be a better alternative than math.fmod. Anyhow, let me test the math.fmod and % possibilities for all our lua examples in the next little while, and I will get back to you. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Alan W. I. <ir...@be...> - 2012-02-16 20:31:34
|
On 2012-02-16 11:46-0800 Alan W. Irwin wrote: > [....]So one possibility to deal with this is simply to replace all math.mod > in the several examples where that occurs with math.fmod. However, > another alternative is to use the lua % operator (which takes the > remainder relative to minus infinity rather than zero as in the > math.fmod case). If we are always dealing with positive values using > the % operator might be a better alternative than math.fmod. > > Anyhow, let me test the math.fmod and % possibilities for all our lua > examples in the next little while, and I will get back to you. In the end (revision 12167) I decided to change to the % operator and the results passed the test_diff_psc test (i.e., were the same as the corresponding C examples) for my Lua-5.1 platform. So Atri, please try the test_lua_psc target again with this revision from svn trunk. I hope you will be able to get a lot further into the examples or maybe even complete them! Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Atri <bad...@ai...> - 2012-02-17 18:23:18
|
On Thu, 2012-02-16 at 12:31 -0800, Alan W. Irwin wrote: > On 2012-02-16 11:46-0800 Alan W. Irwin wrote: > > > [....]So one possibility to deal with this is simply to replace all math.mod > > in the several examples where that occurs with math.fmod. However, > > another alternative is to use the lua % operator (which takes the > > remainder relative to minus infinity rather than zero as in the > > math.fmod case). If we are always dealing with positive values using > > the % operator might be a better alternative than math.fmod. > > > > Anyhow, let me test the math.fmod and % possibilities for all our lua > > examples in the next little while, and I will get back to you. > > In the end (revision 12167) I decided to change to the % operator and > the results passed the test_diff_psc test (i.e., were the same as > the corresponding C examples) for my Lua-5.1 platform. > > So Atri, please try the test_lua_psc target again with this revision > from svn trunk. I hope you will be able to get a lot further into the > examples or maybe even complete them! > > Alan > __________________________ Hi! For the build to be successful one needs to make another small change to the file cmake/modules/lua.cmake, which is as follows:- Index: plplot-5.9.9/cmake/modules/lua.cmake =================================================================== --- plplot-5.9.9.orig/cmake/modules/lua.cmake +++ plplot-5.9.9/cmake/modules/lua.cmake @@ -115,7 +115,7 @@ if(ENABLE_lua) # Unless some better convention comes along, follow what Debian does for # install location of Lua wrapper shared object. if(LUA51_FOUND) - set(LUA_DIR ${LIB_DIR}/lua/5.1/plplot) + set(LUA_DIR ${LIB_DIR}/lua/${LUA_VERSION}/plplot) else(LUA51_FOUND) set(LUA_DIR ${LIB_DIR}/lua/50/plplot) endif(LUA51_FOUND) =================================================================== This patch ensures that if, for instance, lua = 5.2 (and indeed anything greater than 5.0) is detected the corresponding plplot bindings are installed in the directory $LIB_DIR/lua/5.2/plplot and so on. Without this patch plplot bindings are installed in $LIB_DIR/lua/5.1/plplot even if lua = 5.2 is detected in the system. Finally, with these modifications, and the examples corrected as in the latest revision, the 'make test_lua_psc' passes wonderfully, i.e. not only does it pass, but it creates ps files of plots that look fine. I found that the ps files created using the c++ examples and using lua 5.2 looked identical. I interpret that to mean plplot works just great with lua 5.2 as well \o/ Do you want me to submit the ps files or something so you could verify? Thanks a lot for all the really nice help. Please let me know if there is something more I need to do about this. Bye -- Atri |
From: Alan W. I. <ir...@be...> - 2012-02-17 20:18:29
|
On 2012-02-17 23:52+0530 Atri wrote: > Finally, with these modifications, and the examples corrected as in the > latest revision, the 'make test_lua_psc' passes wonderfully, i.e. not > only does it pass, but it creates ps files of plots that look fine. I > found that the ps files created using the c++ examples and using lua 5.2 > looked identical. I interpret that to mean plplot works just great with > lua 5.2 as well \o/ > > Do you want me to submit the ps files or something so you could verify? Hi Atri: Please run the "test_diff_psc" target to verify in detail what you have visually observed above. What this test does is automatically compare PostScript results from C standard examples with those same examples implemented in all our supported languages (including lua). Here are the lua-5.1 results of that test on my system: lua Missing examples : 00 Differing postscript output : Missing stdout : Differing stdout : which shows standard example 00 missing for lua, but for all other 30+ standard examples, lua and C results are the same. In fact, I would recommend running the test_diff_psc target or better yet the test_noninteractive target (which depends on test_diff_psc and also a few other smaller non-interactive test targets) for anyone interested in comprehensively checking their PLplot build. > > Thanks a lot for all the really nice help. Please let me know if there > is something more I need to do about this. You are welcome, and my thanks to you as well for pioneering lua 5.2 for us. To complete this work I plan to update our build system to incorporate all the changes you have shown are required to get lua 5.2 to work, (with the added feature that I will use the lua -v command to determine which version of lua is installed so we don't have to keep maintaining version number lists). Once that works for me here with lua-5.1, I will ask you to do one further test of that unpatched updated build system there to make sure it continues to work for lua-5.2. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Alan W. I. <ir...@be...> - 2012-02-17 22:53:52
|
Hi Atri: On 2012-02-17 12:18-0800 Alan W. Irwin wrote: > To complete this work I plan to update our build system to incorporate > all the changes you have shown are required to get lua 5.2 to work, > (with the added feature that I will use the lua -v command to > determine which version of lua is installed so we don't have to keep > maintaining version number lists). DONE as of revision 12168. With this change I get good results for the test_diff_psc target both for the build tree and CMake-based installed examples tree for lua-5.1. > Once that works for me here with > lua-5.1, I will ask you to do one further test of that unpatched updated build > system there to make sure it continues to work for lua-5.2. Consider yourself so asked... :-) Note, I have done the build system changes independently of the details you presented simply by debugging for 5.1 what didn't work for my new generalized support for lua-5.x. So there might be some issues left for 5.2 (and also 5.0 if anybody still has access to that), but I hope not. Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Atri <bad...@ai...> - 2012-02-17 23:12:48
|
On Fri, 2012-02-17 at 12:18 -0800, Alan W. Irwin wrote: > On 2012-02-17 23:52+0530 Atri wrote: > > > Finally, with these modifications, and the examples corrected as in the > > latest revision, the 'make test_lua_psc' passes wonderfully, i.e. not > > only does it pass, but it creates ps files of plots that look fine. I > > found that the ps files created using the c++ examples and using lua 5.2 > > looked identical. I interpret that to mean plplot works just great with > > lua 5.2 as well \o/ > > > > Do you want me to submit the ps files or something so you could verify? > > Hi Atri: > > Please run the "test_diff_psc" target to verify in detail what you > have visually observed above. What this test does is automatically > compare PostScript results from C standard examples with those same > examples implemented in all our supported languages (including lua). > > Here are the lua-5.1 results of that test on my system: > > lua > Missing examples : 00 > Differing postscript output : > Missing stdout : > Differing stdout : > > which shows standard example 00 missing for lua, but for all other > 30+ standard examples, lua and C results are the same. > > In fact, I would recommend running the test_diff_psc target or better > yet the test_noninteractive target (which depends on test_diff_psc and > also a few other smaller non-interactive test targets) for anyone > interested in comprehensively checking their PLplot build. Ok, seems I jumped the gun there. Example 21 from latest svn seems to be creating some problems. Here is the result of test_diff.sh =============================================================== lua Missing examples : Differing postscript output : 21 Missing stdout : Differing stdout : WARNING: Some PostScript or stdout results were different =============================================================== If instead I use math.fmod instead of % to replace all occurrences of math.mod in the lua examples shipped with the 5.9.9 tarball, then I get the expected results from test_diff.sh:- =============================================================== lua Missing examples : Differing postscript output : Missing stdout : Differing stdout : =============================================================== Hope that helps. > To complete this work I plan to update our build system to incorporate > all the changes you have shown are required to get lua 5.2 to work, > (with the added feature that I will use the lua -v command to > determine which version of lua is installed so we don't have to keep > maintaining version number lists). Once that works for me here with > lua-5.1, I will ask you to do one further test of that unpatched updated build > system there to make sure it continues to work for lua-5.2. > > Alan > __________________________ > Alan W. Irwin > > Astronomical research affiliation with Department of Physics and Astronomy, > University of Victoria (astrowww.phys.uvic.ca). > > Programming affiliations with the FreeEOS equation-of-state > implementation for stellar interiors (freeeos.sf.net); the Time > Ephemerides project (timeephem.sf.net); PLplot scientific plotting > software package (plplot.sf.net); the libLASi project > (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); > and the Linux Brochure Project (lbproject.sf.net). > __________________________ > > Linux-powered Science > __________________________ Bye -- Atri |
From: Alan W. I. <ir...@be...> - 2012-02-18 19:37:27
|
On 2012-02-18 04:42+0530 Atri wrote: > On Fri, 2012-02-17 at 12:18 -0800, Alan W. Irwin wrote: >> On 2012-02-17 23:52+0530 Atri wrote: >> >>> Finally, with these modifications, and the examples corrected as in the >>> latest revision, the 'make test_lua_psc' passes wonderfully, i.e. not >>> only does it pass, but it creates ps files of plots that look fine. I >>> found that the ps files created using the c++ examples and using lua 5.2 >>> looked identical. I interpret that to mean plplot works just great with >>> lua 5.2 as well \o/ >>> >>> Do you want me to submit the ps files or something so you could verify? >> >> Hi Atri: >> >> Please run the "test_diff_psc" target to verify in detail what you >> have visually observed above. What this test does is automatically >> compare PostScript results from C standard examples with those same >> examples implemented in all our supported languages (including lua). >> >> Here are the lua-5.1 results of that test on my system: >> >> lua >> Missing examples : 00 >> Differing postscript output : >> Missing stdout : >> Differing stdout : >> >> which shows standard example 00 missing for lua, but for all other >> 30+ standard examples, lua and C results are the same. >> >> In fact, I would recommend running the test_diff_psc target or better >> yet the test_noninteractive target (which depends on test_diff_psc and >> also a few other smaller non-interactive test targets) for anyone >> interested in comprehensively checking their PLplot build. > > Ok, seems I jumped the gun there. Example 21 from latest svn seems to be > creating some problems. Here is the result of test_diff.sh > > =============================================================== > lua > Missing examples : > Differing postscript output : 21 > Missing stdout : > Differing stdout : > WARNING: Some PostScript or stdout results were different > =============================================================== Hi Atri: The first thing I noticed about the above result is there is no complaint about missing example 00. So something appears to be wrong with the conditions you used for this test. My best guess is you probably had a dirty build tree with some stale 5.9.9 results mixed in with the trunk version results. So could you please repeat this test starting from a fresh svn checkout to an initially empty source tree, and then build starting from an empty build tree? That fresh checkout should capture my recent build system changes so (with luck) there should be no need for you to patch anything to get the build to work. Once the unpatched build from trunk works for you, then please test for run-time issues as above with the test_diff_psc target. If you still get example 21 run-time issues as above, please try replacing the % (just for that particular trunk example) with math.fmod. The example 21 issue (if it still exists for a fresh start) may not be with % (since that works perfectly for 5.1). Instead, some other trunk issue could be the cause of the problem, but replacing % with math.fmod in the trunk example 21 should should help to answer that question. By the way, I ignored your 5.9.9 results since trunk has a number of changes since 5.9.9, and any of those changes (or your stale build or whatever it was that made the missing examples/lua/x00.lua go unnoticed) could be the cause of the example 21 issue. Also, getting trunk working correctly is very important to the PLplot developers since that version will become our next released version (whenever that release occurs). Alan __________________________ Alan W. Irwin Astronomical research affiliation with Department of Physics and Astronomy, University of Victoria (astrowww.phys.uvic.ca). Programming affiliations with the FreeEOS equation-of-state implementation for stellar interiors (freeeos.sf.net); the Time Ephemerides project (timeephem.sf.net); PLplot scientific plotting software package (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project (lbproject.sf.net). __________________________ Linux-powered Science __________________________ |
From: Atri <bad...@ai...> - 2012-04-10 21:25:36
|
On Sat, 2012-02-18 at 11:37 -0800, Alan W. Irwin wrote: > On 2012-02-18 04:42+0530 Atri wrote: > > > Ok, seems I jumped the gun there. Example 21 from latest svn seems to be > > creating some problems. Here is the result of test_diff.sh > > > > =============================================================== > > lua > > Missing examples : > > Differing postscript output : 21 > > Missing stdout : > > Differing stdout : > > WARNING: Some PostScript or stdout results were different > > =============================================================== > > Hi Atri: > > The first thing I noticed about the above result is there is no > complaint about missing example 00. So something appears to be wrong > with the conditions you used for this test. My best guess > is you probably had a dirty build tree with some stale 5.9.9 results > mixed in with the trunk version results. > > So could you please repeat this test starting from a fresh svn > checkout to an initially empty source tree, and then build starting > from an empty build tree? That fresh checkout should capture my > recent build system changes so (with luck) there should be no need for > you to patch anything to get the build to work. > Hi! Sorry for the long delay in between my last test and the present one. I got the svn version to build on openSUSE:Factory (with Lua 5.2) finally. I used for my build the svn trunk directory (at revision 12185) without applying any patch except this following one, which is necessary to avoid warnings with rpmlint during the build [1]. ==================================================== diff -ur plplot-5.9.8.orig//drivers/wxwidgets.cpp plplot-5.9.8//drivers/wxwidgets.cpp --- plplot-5.9.8.orig//drivers/wxwidgets.cpp 2011-08-01 23:29:39.000000000 +0530 +++ plplot-5.9.8//drivers/wxwidgets.cpp 2011-08-02 01:06:57.323000001 +0530 @@ -231,7 +231,7 @@ if ( ucs4[i] != (PLUNICODE) plplotEsc ) // a character to display { ucs4_to_utf8( ucs4[i], utf8 ); - strncat( utf8_string, utf8, max_string_length ); + strncat( utf8_string, utf8, sizeof(utf8_string)-strlen(utf8_string)-1 ); i++; continue; } @@ -239,7 +239,7 @@ if ( ucs4[i] == (PLUNICODE) plplotEsc ) // a escape character to display { ucs4_to_utf8( ucs4[i], utf8 ); - strncat( utf8_string, utf8, max_string_length ); + strncat( utf8_string, utf8, sizeof(utf8_string)-strlen(utf8_string)-1); i++; continue; } ==================================================== After the building is done, I tested the package by running the plplot_test.sh script followed by test_diff.sh test for lua and python. The result is perfect, because the test reports no difference between the psc plots obtained with c/cpp and those obtained with lua 5.2. This is what the result says (I understand that the x00 example which was missing from lua/python previously is now also available for these two bindings): ============================================ python Missing examples : Differing postscript output : Missing stdout : Differing stdout : lua Missing examples : Differing postscript output : Missing stdout : Differing stdout : ============================================ I can confirm the same result by manual inspection of the psc output files, especially example 21 which was giving us problems earlier but now looks exactly the same whether generated by a c/cpp code or by lua. I believe we can now treat plplot at the current svn revision to be perfectly compatible with lua 5.2 as well. Thanks a bunch for all of your help with the tests, building etc. and for fixing everything too. There is an unrelated problem about the GNAT library not being detected by the build system, but I will report that in a separate mail. Please let me know if you think any more tests could help with the lua 5.2 issue. Thanks a lot and bye. -- Atri [1] The warnings without this patch says:- I: Statement might be overflowing a buffer in strncat. Common mistake: BAD: strncat(buffer,charptr,sizeof(buffer)) is wrong, it takes the left over size as 3rd argument GOOD: strncat(buffer,charptr,sizeof(buffer)-strlen(buffer)-1) E: plplot bufferoverflowstrncat /home/abuild/rpmbuild/BUILD/plplot/drivers/wxwidgets.cpp:253:64 E: plplot bufferoverflowstrncat /home/abuild/rpmbuild/BUILD/plplot/drivers/wxwidgets.cpp:261:64 |
From: Andrew R. <and...@us...> - 2012-04-11 08:46:56
|
On Wed, Apr 11, 2012 at 02:54:59AM +0530, Atri wrote: > > Hi! > Sorry for the long delay in between my last test and the present one. I > got the svn version to build on openSUSE:Factory (with Lua 5.2) finally. > I used for my build the svn trunk directory (at revision 12185) without > applying any patch except this following one, which is necessary to > avoid warnings with rpmlint during the build [1]. > > ==================================================== > diff -ur plplot-5.9.8.orig//drivers/wxwidgets.cpp > plplot-5.9.8//drivers/wxwidgets.cpp > --- plplot-5.9.8.orig//drivers/wxwidgets.cpp 2011-08-01 > 23:29:39.000000000 +0530 > +++ plplot-5.9.8//drivers/wxwidgets.cpp 2011-08-02 01:06:57.323000001 > +0530 > @@ -231,7 +231,7 @@ > if ( ucs4[i] != (PLUNICODE) plplotEsc ) // a character to > display > { > ucs4_to_utf8( ucs4[i], utf8 ); > - strncat( utf8_string, utf8, max_string_length ); > + strncat( utf8_string, utf8, > sizeof(utf8_string)-strlen(utf8_string)-1 ); > i++; > continue; > } > @@ -239,7 +239,7 @@ > if ( ucs4[i] == (PLUNICODE) plplotEsc ) // a escape > character to display > { > ucs4_to_utf8( ucs4[i], utf8 ); > - strncat( utf8_string, utf8, max_string_length ); > + strncat( utf8_string, utf8, > sizeof(utf8_string)-strlen(utf8_string)-1); > i++; > continue; > } > ==================================================== > > After the building is done, I tested the package by running the > plplot_test.sh script followed by test_diff.sh test for lua and python. > The result is perfect, because the test reports no difference between > the psc plots obtained with c/cpp and those obtained with lua 5.2. This > is what the result says (I understand that the x00 example which was > missing from lua/python previously is now also available for these two > bindings): > ============================================ > python > Missing examples : > Differing postscript output : > Missing stdout : > Differing stdout : > lua > Missing examples : > Differing postscript output : > Missing stdout : > Differing stdout : > ============================================ > > I can confirm the same result by manual inspection of the psc output > files, especially example 21 which was giving us problems earlier but > now looks exactly the same whether generated by a c/cpp code or by lua. > I believe we can now treat plplot at the current svn revision to be > perfectly compatible with lua 5.2 as well. Thanks a bunch for all of > your help with the tests, building etc. and for fixing everything too. > > There is an unrelated problem about the GNAT library not being detected > by the build system, but I will report that in a separate mail. Please > let me know if you think any more tests could help with the lua 5.2 > issue. Dear Atri, Many thanks for your report. It is good to know that you have succeeded. Also, thanks for the patch to fix the strncat arguments. I have committed this to the svn repository now. This is a common mistake that has slipped through the net. I'll take a quick look to see if there are any other occurences in the source. Regards Andrew |