Problems with lua

General discussion about Celestia that doesn't fit into other forums.
hank
Developer
Posts: 645
Joined: 03.02.2002
With us: 22 years 9 months
Location: Seattle, WA USA

Post #21by hank » 10.10.2006, 17:19

cartrite wrote:I think I understand about 5.1 issues. Christophe is trying to have configure chose 5.0 if both are installed on a system. I installed both to see if this is working. The way configure.in worked last night was it was only accepting 5.0.0. I can install that. But I have 5.0.2 currently installed. My question now is if 5.0.2 is a problem. Adirondack's script HuygensMissionTour.celx V1.0 works good. So far that's the only one I tested. I want to see if this is alright with using 5.0.2 and what the final version of configure.in will be so I can stop playing with this.

cartrite

Lua 5.0.2 should be fine. That's the current version in Celestia on Mac OS X.

- Hank

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #22by cartrite » 10.10.2006, 17:23

That's what my changes to last night's configure.in allows. See above.

http://www.celestiaproject.net/forum/viewtopic ... 9097#79097
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #23by Christophe » 10.10.2006, 18:44

The problem with your change is that lua 5.1 could be detected as 5.0 (LUA_VER=0x050000).

So we need to check for (lualib lua >= 5.0.0) with a major version = 5.0, I need to check what the correct syntax for this test is.
Christophe

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #24by cartrite » 10.10.2006, 19:10

I think your saying that if only 5.1 was installed with a file called lua.pc then it would get assigned the wrong flag and get an error while building. OK.

That syntax does look tricky. I couldn't write that from scratch if my life depended on it. After you change it I'll see if it works. I'll keep them both installed for now.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #25by cartrite » 10.10.2006, 21:57

This seems to work. With only lua.pc in /usr/loal/lib/pkgconfig pointing to version 5.1.1, it was given the 0x050100 flag and with all 3 files, lua.pc => 5.0.2, lualib.pc => 5.0.2 , lua5.1.pc =>5.1.1, the flag was 0x050000.

Code: Select all

if (test "$enable_lua" != "no"); then
   LUA_VER=0
   PKG_CHECK_MODULES(LUA, lualib50 lua50 < 5.1.0, [ PKG_CHECK_MODULES(LUA, lualib50 lua50 >= 5.0.0, LUA_VER=0x050000) ],
      [ PKG_CHECK_MODULES(LUA, lua lualib < 5.1.0, [ PKG_CHECK_MODULES(LUA, lua lualib >= 5.0.0, LUA_VER=0x050000) ],
        [ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.0, LUA_VER=0x050100,
          [ PKG_CHECK_MODULES(LUA, lua >= 5.1.0, LUA_VER=0x050100) ]
          ) ]
      ) ]
   )

Mabey each module should be tested seperatly? When 2 are tested at once, the test fails unless both are present. That would get pretty complicated though.

EDIT I was at CVS souceforge 14 seconds after the file was committed. I'll see how it works.

Edit Sorry I had the old failed file still on my desktop and posted the wrong code. :oops: Right code is there now.

EDIT 3 Looks like I left a file out too. I guess I had the backspace key down too long. I added lualib into the code section.

cartrite
Last edited by cartrite on 10.10.2006, 23:51, edited 4 times in total.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #26by Christophe » 10.10.2006, 22:18

I've just commited a new version of configure.in:

Code: Select all

   PKG_CHECK_MODULES(LUA, lua50 >= 5.0.0 lua50 < 5.1.0, LUA_VER=0x050000,
      [ PKG_CHECK_MODULES(LUA, lua >= 5.0.0 lua < 5.1.0, LUA_VER=0x050000,
        [ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.0, LUA_VER=0x050100,
          [ PKG_CHECK_MODULES(LUA, lua >= 5.1.0, LUA_VER=0x050100) ]
          ) ]
      ) ]
   )
   if (test "$LUA_VER" = "0x050000"); then
      PKG_CHECK_MODULES(LUALIB, lualib50 >= 5.0.0 lualib50 < 5.1.0, ,
         [ PKG_CHECK_MODULES(LUALIB, lualib >= 5.0.0 lualib < 5.1.0, , AC_MSG_RESULT([no])) ]
         )
   fi


...which hopefuly works for you.
Christophe

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #27by cartrite » 10.10.2006, 22:59

Works Great. But is this what you are trying to do? It looks like you check 2 files to see if they are >= 5.0.0 but only one to see if it is < 5.1.0.
I like your way better though. I couldn't find anything in the manual showing 2 conditions being used in the module setion of PKG_CHECK_MODULES. I didn't think you could do that. My way runs the check again if the first condition is met as the action.

Anyhow I got the same results.
With only lua.pc in /usr/loal/lib/pkgconfig pointing to version 5.1.1, it was given the 0x050100 flag and with all 3 files, lua.pc => 5.0.2, lualib.pc => 5.0.2 , lua5.1.pc =>5.1.1, the flag was 0x050000.


Thank you much Christophe.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #28by cartrite » 11.10.2006, 10:19

Christophe,
I just tested your latest update (1.64) and at first I thought great. It worked with just lua.pc => 5.0.2. But.......
Here are some of my test results for other combinations.
With lualib.pc pointing to 5.0.2 and lua.pc pointing to 5.1.1, Lua 5.1.1 was found and used.
With lualib.pc pointing to 5.0.2 and lua5.1.pc pointing to 5.1.1, Lua 5.1.1 was found and used.
With lua.pc pointing to 5.0.2 and lua5.1.pc pointing to 5.1.1, Lua 5.0.2 was found and used.
With just lualib.pc pointing to 5.0.2 nothing was found and used. Configure failed.

I tested this following code on every possible configuration I could think of and everything passed.

Code: Select all

if (test "$enable_lua" != "no"); then
   LUA_VER=0
   PKG_CHECK_MODULES(LUA, lua50 >= 5.0.0 lua50 < 5.1.0, LUA_VER=0x050000,
        [ PKG_CHECK_MODULES(LUA, lualib50 >= 5.0.0 lualib50 < 5.1.0, LUA_VER=0x050000,
      [ PKG_CHECK_MODULES(LUA, lua >= 5.0.0 lua < 5.1.0, LUA_VER=0x050000,
         [ PKG_CHECK_MODULES(LUA, lualib >= 5.0.0 lualib < 5.1.0, LUA_VER=0x050000,
            [ PKG_CHECK_MODULES(LUA, lua5.1 >= 5.1.0, LUA_VER=0x050100,
              [ PKG_CHECK_MODULES(LUA, lua >= 5.1.0, LUA_VER=0x050100) ]
          ) ]
      ) ]
         ) ]
      ) ]
   )
   
   if (test "$LUA_VER" = "0"); then
      if (test "x$enable_lua" != "xauto"); then
         AC_ERROR([Lua not found (explicitly enabled)!])
      else
         enable_lua="no"
      fi
   else
      enable_lua="yes"
   fi
fi

if (test "$enable_lua" = "yes"); then
   CXXFLAGS="$CXXFLAGS $LUA_CFLAGS $LUALIB_CFLAGS -DLUA_VER=$LUA_VER -DCELX"
   LIBS="$LIBS $LUA_LIBS $LUALIB_LIBS"
fi


Hope this helps.

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #29by Christophe » 11.10.2006, 10:39

cartrite wrote:With lualib.pc pointing to 5.0.2 and lua.pc pointing to 5.1.1, Lua 5.1.1 was found and used.
With lualib.pc pointing to 5.0.2 and lua5.1.pc pointing to 5.1.1, Lua 5.1.1 was found and used.
With lua.pc pointing to 5.0.2 and lua5.1.pc pointing to 5.1.1, Lua 5.0.2 was found and used.
With just lualib.pc pointing to 5.0.2 nothing was found and used. Configure failed.


Isn't that just what we want?

lualib is needed only for 5.0, 5.1 doesn't need it, and lualib is always used with lua, never alone. Supposidely, if your system is not broken, the lualib.pc and lua.pc files will follow the same naming convention:
(lualib.pc with lua.pc) or (lualib50.pc with lua50.pc)

What we need to be able to handle in addition to these various naming conventions is that lualib.pc is sometimes included in lua.pc, so what we do is first start by checking for :
lua50 >= 5.0.0 and < 5.1.0
if not found check for:
lua >= 5.0.0 and < 5.1.0
if not found check for:
lua5.1 >= 5.1.0
if not found check for:
lua >= 5.1.0
if not found fails if lua explicitly enabled

And only if a 5.0 version is found check for:
lualib50 >= 5.0.0 and < 5.1.0
if not found check for:
lualib >= 5.0.0 and < 5.1.0
if not found do not fail

I hope this clears it up.
Christophe

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #30by cartrite » 11.10.2006, 10:52

Christophe wrote:
Isn't that just what we want?

lualib is needed only for 5.0, 5.1 doesn't need it, and lualib is always used with lua, never alone. Supposidely, if your system is not broken, the lualib.pc and lua.pc files will follow the same naming convention:
I thought you said earlier that it was needed by Ubuntu systems.
See my post dated '09/10/2006 21:38', the problem is that you don't have lualib.pc, and this is required (at least) on Ubuntu systems.
With just lualib.pc present in the folder => 5.0.2 and 5.1.1 also installed 5.1.1 was being used.

Edit
And only if a 5.0 version is found check for:
lualib50 >= 5.0.0 and < 5.1.0
if not found check for:
lualib >= 5.0.0 and < 5.1.0
if not found do not fail
My tests could have been flawed because my 5.0.2 version has a folder name and file names (lua lua.a, lualib.a) and not (lua50 lua50.a, lualib50.a.). I didn't see what happens when lua50 is really encountered.

This is starting to get confusing. 8O 8O

and lualib is always used with lua, never alone


I think what your saying here is that files called lualib.pc, lualib50.pc are never in the pckonfig folder alone. There is always a lua.pc or lua50.pc also?
Thats if the proper naming conventions are followed.

/Edit

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #31by cartrite » 11.10.2006, 12:55

Christophe,
lualib is needed only for 5.0, 5.1 doesn't need it, and lualib is always used with lua, never alone. Supposidely, if your system is not broken, the lualib.pc and lua.pc files will follow the same naming convention:
(lualib.pc with lua.pc) or (lualib50.pc with lua50.pc)

From what you said in your previous post, I think to fill the Ubuntu systems requirements you need a file called lua.pc => lua.a and a file called lualib.pc => lualib.a ?

My lualib.pc => lua.a and lualib.a. Lualib.pc was a copy of lua.pc. That may have tainted my test results.

Then that looks like configure.in ver 1.64 is working as you expected.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #32by Christophe » 11.10.2006, 14:18

Ok then, thanks for your feedback.
Christophe

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #33by cartrite » 11.10.2006, 17:43

No Problem. I learned a lot by this experience. Your very welcome.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #34by cartrite » 11.10.2006, 23:38

I just seen your changes to configure.in ver 1.85. Haven't tried it yet though. I'm on Win XP. Nice touch though. That warning can be a fail safe for those that fall through the cracks.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Avatar
t00fri
Developer
Posts: 8772
Joined: 29.03.2002
Age: 22
With us: 22 years 7 months
Location: Hamburg, Germany

Post #35by t00fri » 12.10.2006, 20:48

Christophe,

I just upgraded to openSuSE 10.1 and found that everything compiles fine, except some of your recent commits:

SuSE's liblua 5.02 comes without .pc file and resides as always in /usr/lib and the headers are in /usr/include. It's NOT found anymore, despite a perfectly standard location. This is just not good.

Configure MUST also work for such standard places without using pkg-config.

The worst is that whatever I do (make distclean, --disable-lua in ./configure etc) I now get the same error:

Code: Select all

configure: error: Package requirements (lua >= 5.1.0) were not met:

No package 'lua' found


Since I have little time, I don't want to spend the whole evening to dig myself through this badly tested new configure.in stuff in CVS...

Thanks,
Fridger
Image

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #36by cartrite » 12.10.2006, 21:09

Fridger,
--disable-lua doesn't work. Use --without-lua instead. That used to work. Hope it still does.
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4

Christophe
Developer
Posts: 944
Joined: 18.07.2002
With us: 22 years 4 months
Location: Lyon (France)

Post #37by Christophe » 12.10.2006, 21:33

t00fri wrote:Since I have little time, I don't want to spend the whole evening to dig myself through this badly tested new configure.in stuff in CVS...


Well, first of all, this is CVS so yes, things may not work perfectly on all systems.

In this particular case, however, after the quite intensive testing I went through with cartrite's help, I'm confident this works even on your system. configure may not work like it did on previous versions, but that doesn't mean it is broken.

To disable lua, the correct flag is '--without-lua', not '--disable-lua'. After removing the lua.pc files from my pkgconfig directory I can confirm that configure doesn't fail on lua detection if that flag is used.

Moreover, when configure fails on lua the configure script outputs the following message:

Code: Select all

Alternatively, you may set the environment variables LUA_CFLAGS
and LUA_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.


Which clearly indicates how to enable lua if pkgconfig is not available.
The following works for me with lua.pc removed:

Code: Select all

LUA_CFLAGS='-I/usr/include/lua50/' LUA_LIBS='-llualib50 -llua50' ./configure --with-kde --with-lua --prefix=/usr/local/kde/ --with-spice-dir=/home/chris/Documents/src/cspice --with-theora --enable-debug=full


I'm confident this can work for you too (LUA_CFLAGS=' ' LUA_LIBS='-llualib50 -llua50') and it is certainly nicer than the manual patching one had to do on the previous version.

[edit]
I just commited a fix, so that configure doesn't fail when --with-lua isn't used. So --without-lua shouldn't be required now.
Christophe

Avatar
Topic author
cartrite
Posts: 1978
Joined: 15.09.2005
With us: 19 years 2 months
Location: Pocono Mountains, Pennsylvania, USA Greate Grandfother from Irshava, Zakarpattia Oblast Ukraine

Post #38by cartrite » 13.10.2006, 15:48

Christophe wrote:
I just commited a fix, so that configure doesn't fail when --with-lua isn't used. So --without-lua shouldn't be required now.
I can confirm this is working. I just ran ./configure and I renamed my lua.pc and lua5.1.p so they would't be found by pkgconfig and configure didn't fail.
celestia> ./configure --prefix=/home/cartrite/bin/celestia/backup/test/build --with-kde --with-qt-dir=/usr/lib64/qt3 --with-qt-libraries=/usr/lib64/qt3/lib64 --enable-libsuffix=64 --with-cspice-dir=/home/cartrite/bin/celestia/source/tspice_c
..............
checking for LUA... checking for LUA... checking for LUA... checking for LUA...
no
...............
***************************************************************
** Celestia configuration complete. Now do a 'make' followed **
** by 'make install' **
***************************************************************

Front-End: KDE
Use Lua: no
Use Theora: yes
It also had no problems building.

Edit

Fridger wrote:
SuSE's liblua 5.02 comes without .pc file and resides as always in /usr/lib and the headers are in /usr/include. It's NOT found anymore, despite a perfectly standard location. This is just not good.


Although I renamed my .pc files both lua's were still installed and not found so ...?.. not my call.
Because I built them from source, mine were installed as follows:
lua5.1.1 was in /usr/local/lua/ and lua 5.0.2 was installed in /usr/local/. Of course both those directories have ~/bin, ~/lib, ~/inlude, ect.
/edit

cartrite
VivoBook_ASUSLaptop X712JA_S712JA Intel(R) UHD Graphics 8gb ram. Intel(R) Core(TM) i5-1035G1 CPU @ 1.00GHz, 1190 Mhz, 4 Core(s), 8 Logical Processor(s) 8 GB ram. Running on Windows 11 and OpenSuse 15.4


Return to “Celestia Users”