[SOLVED] Trouble Building Python And Lua Modules

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

kabbotta
Just popping in
Just popping in
Posts: 11
Joined: Tue Mar 10, 2015 01:47

[SOLVED] Trouble Building Python And Lua Modules

Postby kabbotta » Tue Mar 10, 2015 02:15

Code: Select all

---- Version: 0.8.4 (Build: Mar  8 2015 GNU/Linux g++ 4.9.2 20150204 (prerelease) 32 bit) ----
---- Renderer module is: CEGUI::OgreRenderer - Official OGRE based 2nd generation renderer module. ----
---- XML Parser module is: CEGUI::ExpatParser - Official expat based parser module for CEGUI ----
---- Image Codec module is: OgreImageCodec - Integrated ImageCodec using the Ogre engine. ----
---- Scripting module is: None ----


I've just built CEGUI for use with Ogre, and everything seems to be working alright except that I had to disable the building of the python and lua modules. I am using arch and I already had to redirect cmake to use my python2.7 installation instead of python3. That cleared up some of the issues, but I still get an error while building ToggleButton that looks like this:

Code: Select all

virtual memory exhausted: Cannot allocate memory
cegui/src/ScriptModules/Python/bindings/CMakeFiles/PyCEGUI.dir/build.make:77: recipe for target 'cegui/src/ScriptModules/Python/bindings/CMakeFiles/PyCEGUI.dir/output/CEGUI/ToggleButton.pypp.cpp.o' failed


It's like it is getting stuck in a loop or something. I think I run into a similar problem with the Lua module. Arch defaults to a newer version of Lua than 5.1. I've changed the cmake variables to reflect this, but I still get errors during building about undefined references to 'lua_setglobal'. Could the problem be related to using a newer version of tolua++? The arch repository has 1.0.93-1. I noticed the wiki says it was built with 1.0.61, but I couldn't find that version anywhere. This is the error:

Code: Select all

CMakeFiles/toluappcegui-0.8.dir/tolua.c.o: In function `main':
tolua.c:(.text.startup+0x44): undefined reference to `lua_setglobal'
tolua.c:(.text.startup+0x5e): undefined reference to `lua_setglobal'
tolua.c:(.text.startup+0x84): undefined reference to `lua_setglobal'
tolua.c:(.text.startup+0xa8): undefined reference to `lua_setglobal'
tolua.c:(.text.startup+0x1df): undefined reference to `lua_getglobal'
tolua.c:(.text.startup+0x1e9): undefined reference to `lua_rawlen'
collect2: error: ld returned 1 exit status
cegui/src/ScriptModules/Lua/support/tolua++bin/CMakeFiles/toluappcegui-0.8.dir/build.make:113: recipe for target 'bin/toluappcegui-0.8' failed
make[2]: *** [bin/toluappcegui-0.8] Error 1
CMakeFiles/Makefile2:752: recipe for target 'cegui/src/ScriptModules/Lua/support/tolua++bin/CMakeFiles/toluappcegui-0.8.dir/all' failed
Last edited by kabbotta on Wed Mar 11, 2015 23:51, edited 1 time in total.

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: Trouble Building Python And Lua Modules

Postby lucebac » Tue Mar 10, 2015 20:47

virtual memory exhausted: Cannot allocate memory
cegui/src/ScriptModules/Python/bindings/CMakeFiles/PyCEGUI.dir/build.make:77: recipe for target 'cegui/src/ScriptModules/Python/bindings/CMakeFiles/PyCEGUI.dir/output/CEGUI/ToggleButton.pypp.cpp.o' failed

This says that you don't have enough RAM to build the python modules, it has nothing to do with CEGUI itself.
Last edited by lucebac on Wed Mar 11, 2015 06:19, edited 1 time in total.

User avatar
Ident
CEGUI Team
Posts: 1998
Joined: Sat Oct 31, 2009 13:57
Location: Austria

Re: Trouble Building Python And Lua Modules

Postby Ident » Tue Mar 10, 2015 22:02

How much RAM did you approx. have free at that point, kabbotta?
CrazyEddie: "I don't like GUIs"

User avatar
dermont
Quite a regular
Quite a regular
Posts: 75
Joined: Mon Aug 29, 2005 16:15

Re: Trouble Building Python And Lua Modules

Postby dermont » Wed Mar 11, 2015 02:33

As lucebac says you don't have enough memory and/or swapspace. Run the following and let us know the total memory and swap on your system.

Code: Select all

grep MemTotal /proc/meminfo
grep SwapTotal /proc/meminfo
## to get swap partition
swapon -s


If you can't change the size of your swap partion, you should be able to do so by creating a temp swap file. I've done this in the past running Swig on machines encountering the same problems. It will probably be slow but see the following links.

http://www.akadia.com/services/ora_linu ... l_10g.html (Checking Memory and Swap space)
http://www.linux.com/learn/tutorials/44 ... -swap-file

Then removing the swap space after you finish:

Code: Select all

swapoff tmpswp
rm tmpswp

kabbotta
Just popping in
Just popping in
Posts: 11
Joined: Tue Mar 10, 2015 01:47

Re: Trouble Building Python And Lua Modules

Postby kabbotta » Wed Mar 11, 2015 23:51

Thanks, guys! Creating a temporary swap space allowed the python module to be built successfully. I was so caught up in the version issues with python that I didn't even think about taking the error at face value as a legitimate memory problem. I still get the same errors about not being able to find 'lua_setglobal' when trying to build the lua module, but now that I've got the python module built, I pretty much consider this solved. Thanks, again! The ogre and cegui forums have been very helpful.

For reference, I had 2gb of RAM available and no swap setup when I ran into the error. Adding a 1gb swap space allowed the build to finish (albeit a little slowly).

lucebac
Just can't stay away
Just can't stay away
Posts: 193
Joined: Sat May 24, 2014 21:55

Re: [SOLVED] Trouble Building Python And Lua Modules

Postby lucebac » Thu Mar 12, 2015 01:08

Glad to hear that you were finally able to build CEGUI!
Just FYI: swap space is HDD space. Therefore reading from/writing to it is slower than actual RAM space.

kabbotta
Just popping in
Just popping in
Posts: 11
Joined: Tue Mar 10, 2015 01:47

Re: [SOLVED] Trouble Building Python And Lua Modules

Postby kabbotta » Sat Mar 14, 2015 06:24

I've discovered that it was the lua generator that was seeing the undefined reference to 'lua_setglobal'. When I disabled that, I was also able to successfully build the lua module. So everything appears to be cleared up.


Return to “Help”

Who is online

Users browsing this forum: Majestic-12 [Bot] and 6 guests