Building on Linux

Discussion about using Moai SDK - post questions, bugs and issues here.

Moderators: seebs, franciscotufro

Building on Linux

Postby b.lindeijer » Thu Jun 09, 2011 5:48 pm



pengo: "Curiously under 32-bit Xubuntu 11.04 (as opposed to 64-bit Ubuntu 10.10), the TTF vs ttf case sensitivity segfault did not occur.  The demos that required the TTF files worked fine."




That's very strange, since this system should be just as case sensitive. I've extended that commit with fixes to the rest of the samples you mentioned, and also pushed a change that makes Moai print an error when loading a font rather than crashing.


pengo: "util-xml still causes a similar stack trace (invalid pointer) under 32-bit as it did for 64-bit."


That turned out to be a binary incompatibilty due to using TinyXml in STL mode, but I didn't set that define when compiling it. It seems to have caused it to call the destructor rather than the constructor. Fixed in this commit.

Btw, where's your Moai clone? :-)




patrick: "We're slammed at the moment, but I'll try to get this reviewed and merged in before open beta."


Oh well, it's probably a good thing that you're so busy. I hope the open beta isn't too far off. :-)

b.lindeijer
 
Posts: 12
Joined: Thu May 26, 2011 12:58 pm

Building on Linux

Postby berteh » Wed Jun 29, 2011 12:18 am

Hi all,

thanks Bjørn for this contribution. I run into a linking problem when compiling moai executable that I can't solve. Can anyone please help?



what i did (from scratch) on Ubuntu 11.04 (32 bit)

Installing the dependencies on Ubuntu:

  $ sudo apt-get install cmake libcurl4-openssl-dev libfreetype6-dev liblua5.1-0-dev libpng12-dev freeglut3-dev libxi-dev libxmu-dev



chekout your GIT repository & build:

  $ cd moai-beta/ && mkdir build && cd build
  $ cmake ..

  $ make


The make first builds a few static library just fine (libBox2D.a, libchipmunk.a, libutf8.a, libexpat.a, libglew.a, libsqlite3.a, libtinyxml.a, libuslsext.a, libmoaicore.a, libuslscore.a, libaku.a)

The make then crashes when trying to link moai executable, with the message: /usr/bin/ld: cannot find -lchipmunk…and indeed if I make clean && make maoi, then the lib chipmunk is not built at all.

I guess it's just a matter of adding some dependency in some CMakeLists.txt but I don't know which… nor how Embarassed. got any clue?



thanks!

Berteh.



various illustrative logs:



$ make moai
– Configuring done
– Generating done
– Build files have been written to: /mnt/share/devel/Moai/linux/moai-beta/build
[ 13%] Built target uslscore
[ 14%] Built target utf8
[ 43%] Built target uslsext
[ 56%] Built target Box2D
[ 57%] Built target glew
[ 59%] Built target sqlite3
[ 60%] Built target tinyxml
[ 98%] Built target moaicore
[100%] Built target aku
Linking CXX executable moai
/usr/bin/ld: cannot find -lchipmunk
collect2: ld returned 1 exit status
make[3]: *** [src/moai/moai] Error 1
make[2]: *** [src/moai/CMakeFiles/moai.dir/all] Error 2



$ VERBOSE=1 make

(…)

make[3]: Entering directory `/mnt/share/devel/Moai/linux/moai-beta/build'
Linking CXX executable moai
cd /mnt/share/devel/Moai/linux/moai-beta/build/src/moai && /usr/bin/cmake -E cmake_link_script CMakeFiles/moai.dir/link.txt –verbose=1
/usr/bin/c++      CMakeFiles/moai.dir/main.cpp.o  -o moai -rdynamic -L/mnt/share/devel/Moai/linux/moai-beta/3rdparty/box2d-2.1.2/Box2D/Box2D -L/mnt/share/devel/Moai/linux/moai-beta/3rdparty/chipmunk-5.3.4/src -L/mnt/share/devel/Moai/linux/moai-beta/3rdparty/contrib -L/mnt/share/devel/Moai/linux/moai-beta/3rdparty/sqlite-3.6.16 -L/mnt/share/devel/Moai/linux/moai-beta/3rdparty/tinyxml ../aku/libaku.a ../moaicore/libmoaicore.a ../../3rdparty/box2d-2.1.2/Box2D/Box2D/libBox2D.a -lchipmunk ../../3rdparty/glew-1.5.6/libglew.a ../../3rdparty/sqlite-3.6.16/libsqlite3.a ../../3rdparty/tinyxml/libtinyxml.a ../uslsext/libuslsext.a ../../3rdparty/contrib/libutf8.a -lpng -lcurl -lfreetype ../uslscore/libuslscore.a -llua5.1 -lm -lz -lglut -lXmu -lXi -Wl,-rpath,/mnt/share/devel/Moai/linux/moai-beta/3rdparty/box2d-2.1.2/Box2D/Box2D:/mnt/share/devel/Moai/linux/moai-beta/3rdparty/chipmunk-5.3.4/src:/mnt/share/devel/Moai/linux/moai-beta/3rdparty/contrib:/mnt/share/devel/Moai/linux/moai-beta/3rdparty/sqlite-3.6.16:/mnt/share/devel/Moai/linux/moai-beta/3rdparty/tinyxml
/usr/bin/ld: cannot find -lchipmunk
collect2: ld returned 1 exit status
make[3]: *** [src/moai/moai] Error 1
make[2]: *** [src/moai/CMakeFiles/moai.dir/all] Error 2
make[1]: *** [src/moai/CMakeFiles/moai.dir/rule] Error 2
make: *** [moai] Error 2
berteh
 
Posts: 6
Joined: Thu May 26, 2011 9:12 am

Building on Linux

Postby b.lindeijer » Thu Jul 14, 2011 4:04 am

@berteh

I really have no idea how that could happen, unless I'm misunderstanding something about how CMake handles dependencies. If you look at 'src/moaicore/CMakeLists.txt' you should see chipmunk listed among the target link libraries, so it should have been already compiled before moaicore got linked. I haven't seen this issue myself and you're the first to report it.

Now of course my fork is completely outdated by the new 0.4 beta release, and I haven't found the time yet to update it. Hopefully it will get integrated and maintained by the Moai SDK team.
b.lindeijer
 
Posts: 12
Joined: Thu May 26, 2011 12:58 pm

Building on Linux

Postby berteh » Thu Jul 14, 2011 7:47 pm

Hello  Bjorn,

I found the error reported above happened because I was calling cmake (and make) in a subdirectory, and not the root of your repository.

Building works fine from the root directory.

Could you please try t update your repo to 0.4, as it is MOST USEFUL for building under linux! ... and update cmakelists accordingly to allow for building in a subdirectory would be great, as you simply have to exclude this directory from GIT sync to not worry about false updates.



Thanks!

Berteh.
berteh
 
Posts: 6
Joined: Thu May 26, 2011 9:12 am

Building on Linux

Postby josh » Fri Jul 15, 2011 2:18 am

I am planning to integrate these changes into the main moai-beta repository fairly soon. We've already got the 64-bit compatibility stuff integrated, and it will be pushed with the next release later today if everything goes according to plan. The CMake stuff will take a little longer, but should be released soon as well.
josh
 
Posts: 36
Joined: Sat Apr 02, 2011 10:51 pm

Building on Linux

Postby berteh » Sun Jul 17, 2011 5:20 pm

Thanks Josh, can't wait to have these!

B.
berteh
 
Posts: 6
Joined: Thu May 26, 2011 9:12 am

Building on Linux

Postby david.given » Tue Aug 30, 2011 7:58 am

I realise you're inundated with other stuff to do, but any news on the CMake integration? Running under wine works, but is fairly painful (no audio, crashes if I ^C it...).
david.given
 
Posts: 6
Joined: Wed Aug 17, 2011 2:24 pm

Building on Linux

Postby patrick » Tue Aug 30, 2011 9:33 am

Thanks for the bump. We do need to get that done. Timeframe... could still be a few weeks before we can put someone on it.
User avatar
patrick
 
Posts: 589
Joined: Sat Apr 02, 2011 10:50 pm

Building on Linux

Postby stefano.linguerri » Sun Sep 11, 2011 8:57 am

Thanks Bjørn! 



I built your moai repo on a  64b Fedora  box

I had to manually link some lib on



/usr/lib/gcc/x86_64-redhat-linux/4.4.5



like librt libpng libcrypto libssl libXi libGL libpthread



but when I run the samples I get a black screen.

the apps run and print out some debug logs I put



with:

moai $PATH_TO/config.lua $PATH_TO/samples/test/partition/main.lua

I can only see black boxes with white or gray edges.



any idea?

thanks in advance
Twitter: http://twitter.com/eljeko
RapaNui: https://github.com/ymobe/rapanui

"Do, or do not. There is no try."
User avatar
stefano.linguerri
 
Posts: 70
Joined: Wed Apr 13, 2011 3:11 pm
Location: Italy

Building on Linux

Postby sparkart » Sat Sep 24, 2011 8:10 am

Hi, I am new to developing with Linux.



I come from using Windows and VS and I was wondering how I should get developing on Linux. The README in the repository says to install the dependencies (which I did) and use:

cmake .

make



I am familiar with cmake and used cmake-gui on Windows in the past, but does building on Linux not yet work out-of-the box yet? Cmake complains about cmakelists.txt



If not, how soon will this be available?



Also I am not sure how to generate the cmake files because it was already generated for the libraries that I used which used cmake.
sparkart
 
Posts: 12
Joined: Sun Sep 18, 2011 4:01 am

Building on Linux

Postby chris » Mon Oct 10, 2011 8:14 pm

Could you provide an update on any existing efforts of getting moai to compile and run under Linux?

There are quite a few people that would like to use it, and as some of the forum threads and the pull request 1 seem to imply, some people have gotten it working. Sadly there is no linux-compatible repository of moai (the one of Bjorn was deleted), although the Readme on https://github.com/moai/moai-beta mentions "Developing on Linux" with 'cmake' and 'make'.

An update would be highly appreciated!
chris
 
Posts: 2
Joined: Tue Oct 11, 2011 3:08 am

Building on Linux

Postby b.lindeijer » Tue Oct 11, 2011 12:12 am

My repository hasn't been deleted (it's at https://github.com/bjorn/moai-beta), but I haven't had time to update it since I initially wrote the build files (based on beta 0.3) so it's severely outdated (Moai is at 0.7 now).

My repository should still build fine, if you don't mind being 4 versions out of date, or it can provide you with a starting point if you want to try adapting the build files to work with Moai 0.7. Since 0.3 a lot of new 3rd party dependencies were added (even at 0.3 there were already quite a few, but it seems there are about 8 new ones). It's generally not hard to add the CMakeLists.txt files, it's just a little bit time consuming.
b.lindeijer
 
Posts: 12
Joined: Thu May 26, 2011 12:58 pm

Building on Linux

Postby patrick » Tue Oct 11, 2011 4:37 am

Same here – just swamped. Apologies for the delay. The gating factor for us is integrating the linux build with our build server so we can do releases. We have a new dev starting at the end of this month who will be taking ownership of build management (and platform specific host apps), so I'd expect to see official support some time in November.
User avatar
patrick
 
Posts: 589
Joined: Sat Apr 02, 2011 10:50 pm

Building on Linux

Postby chris » Tue Oct 11, 2011 8:57 pm

Thanks for the infos! An official linux build of moai would be highly appreciated, in particular by Android devs working on Linux i suppose :) 

Bjorn: It seems that your repository is private, when I open the link i get a 404 error.
chris
 
Posts: 2
Joined: Tue Oct 11, 2011 3:08 am

Building on Linux

Postby b.lindeijer » Tue Oct 11, 2011 9:02 pm

chris: Ah, I didn't realize that it stayed private even after the moai-beta repository became public (the clone was made when Moai was in private beta). I've set it to public now.
b.lindeijer
 
Posts: 12
Joined: Thu May 26, 2011 12:58 pm

Building on Linux

Postby stefano.linguerri » Mon Oct 17, 2011 6:23 am

@Bjørn at the end it worked for me!



I had to copy the moai executable  under the app dir i want to run, it seems that the "root dir" from where the executable looks for other resources (eg images) is the path where it's started from.

Hope this help
Twitter: http://twitter.com/eljeko
RapaNui: https://github.com/ymobe/rapanui

"Do, or do not. There is no try."
User avatar
stefano.linguerri
 
Posts: 70
Joined: Wed Apr 13, 2011 3:11 pm
Location: Italy

Building on Linux

Postby b.lindeijer » Mon Oct 17, 2011 6:28 am

eljeko said:

I had to copy the moai executable  under the app dir i want to run, it seems that the "root dir" from where the executable looks for other resources (eg images) is the path where it's started from.

Hope this help


It's not the location of the executable that matters, but the working directory. See the .bat files used to run the 'samples' for how it is expected to be launched.
b.lindeijer
 
Posts: 12
Joined: Thu May 26, 2011 12:58 pm

Building on Linux

Postby stefano.linguerri » Mon Oct 17, 2011 6:47 am

Thank you for clarification Bjørn it works :)
Twitter: http://twitter.com/eljeko
RapaNui: https://github.com/ymobe/rapanui

"Do, or do not. There is no try."
User avatar
stefano.linguerri
 
Posts: 70
Joined: Wed Apr 13, 2011 3:11 pm
Location: Italy

Building on Linux

Postby ibisum » Mon Oct 17, 2011 8:18 pm

Any clue whats involved in bringing the Linux CMakefiles up to date with the latest version of the Moai SDK?  I'd really rather not use Windows for development, and installing a full-blown Moai-based tree into a sample project for running on the iPad/Android platforms is starting to be a real drag .. it would be *very useful* if I could just use Linux for development, natively.



Anything we can do to help?
;
--
ibisum@gmail.com
Got a MOAI snippet? Please consider adding it to http://moaisnippets.info
User avatar
ibisum
 
Posts: 1005
Joined: Mon Oct 17, 2011 1:11 am
Location: Vienna, Austria

Building on Linux

Postby b.lindeijer » Mon Oct 17, 2011 8:38 pm

ibisum said:

Anything we can do to help?





Since Moai SDK is open source, all you need is to read a bit about how to use CMake and then you can start fiddling around (at least, that's what I went with). I'm not a Moai SDK developer but I needed only about two evenings to get Moai SDK 0.3 to compile. My problem is I've got lots of things to do, and spending a some evenings updating the build files for Moai SDK is rather low on my personal priority list.

You could look at the patches adding the CMake support in my repository to get an idea of how I set it up, and try to do the same based on a newer version of the SDK.

b.lindeijer
 
Posts: 12
Joined: Thu May 26, 2011 12:58 pm

PreviousNext

Return to Moai SDK

Who is online

Users browsing this forum: No registered users and 1 guest

x