ENIGMA Forums

General fluff => General ENIGMA => Topic started by: Goombert on May 19, 2013, 09:17:20 pm

Title: Cross Compiling
Post by: Goombert on May 19, 2013, 09:17:20 pm
In the past it was necessary that you build your project from the platform you intend to target, each platform. This may be a bit a pain in the but for indie devs who don't have 3 different computers or dual boot. So fundies has decided to start our cross compiler abilities and has created a nice patch for everyone.

Here is me testing it on Ubuntu...
(http://oi44.tinypic.com/dwca4l.jpg)

**** Prerequisite Packages *****
Code: [Select]
sudo apt-get install mingw-w64-i686-dev g++-mingw-w64-i686

***** Instructions *****
1) Install ENIGMA
2) [snip]cd your_enigma_install_directory[/snip]
3) [snip]wget http://awesome-toons.org/WinPatch.zip[/snip]
4) [snip]unzip WinPatch.zip[/snip]
5) You may optionally install WINE Emulator to ensure your game built correctly before testing it on Windows if you are on Linux
6) Go to ENIGMA->ENIGMA Settings and set audio system to SFML or None as OpenAL does not work with MinGW32
7) Set compiler to MinGW32
8) Test compile an empty game
9) You should be good to go!  (Y)

***** Running Games *****
32-bit Debian or Ubuntu : [snip]apt-get install fglrx-glx or libgl1-mesa-glx or nvidia-glx or nvidia-glx-legacy-96xx[/snip]
64-bit Debian or Ubuntu : [snip]apt-get install fglrx-glx-ia32 or ia32-libs or nvidia-glx-ia32 or nvidia-glx-legacy-96xx-ia32[/snip]

Please give feedback and suggestions and discuss the future development of this in this topic.
Title: Re: Cross Compiling
Post by: gra on May 20, 2013, 01:13:32 am
great!!  (Y)
i try now to follow guide
EDIT
o my... it compile  ;D
but this have sense, i'm idiot
Quote
6) Go to ENIGMA->ENIGMA Settings and set audio system to SFML or None as OpenAL does not work with MinGW32
openal not go in windows, i have the problem with this,  ;D
Thanks for this, the system switch for compile is bad
i'm happy  (Y) (Y) (Y)
EDIT2
in fedora wine with open video driver, not view game, i have tessted three month ago, in ubuntu wine run fine with ati open driver
Title: Re: Cross Compiling
Post by: zesterer on May 22, 2013, 02:44:28 pm
Er...
I tried compiling with and empty game, and installed all dependencies. I got this error:

http://pastebin.com/ERiUMSk4

:S

-Zesterer (Xen)
Title: Re: Cross Compiling
Post by: IsmAvatar on May 22, 2013, 04:05:22 pm
make[1]: i486-mingw32-g++: Command not found

Seems to suggest you don't have g++ installed? Or maybe it's expecting a specific version of g++ which isn't yours.
Title: Re: Cross Compiling
Post by: gra on May 27, 2013, 04:08:53 pm
Quote
make[1]: i486-mingw32-g++: Command not found
i have this error in first time, but i have follow guide and enigma compile  ;)
Title: Re: Cross Compiling
Post by: gra on May 29, 2013, 12:53:40 am
hey Robert, but can i compile 32bit ubuntu bin in 64 bit sistem?
i have, for example install libopenal 32bit, but enigma don't recognize it
Title: Re: Cross Compiling
Post by: Goombert on May 30, 2013, 04:45:27 am
It should be able to gra, do you by chance have both the 32 and 64bit libraries?, they could be getting mixed. I am generally not so good with this kind of stuff and cheeseboy is the one who made this. But yes theoretical what you are trying to do gra should be possible and if not it should be fixed.
Title: Re: Cross Compiling
Post by: gra on May 31, 2013, 03:16:56 pm
Quote
make[1]: i486-mingw32-g++: Command not found
i have find the error, if i select mingw64, but mingw32 go well
Title: Re: Cross Compiling
Post by: Goombert on May 31, 2013, 04:27:58 pm
Oh gra, are you installing from source code using github or are you using the new windows installer? Because we had the wrong MinGW version linked on the download page for sometime.
Title: Re: Cross Compiling
Post by: gra on June 01, 2013, 01:17:28 am
this error is on ubuntu
Title: Re: Cross Compiling
Post by: Goombert on June 01, 2013, 03:28:27 am
Yah you might have installed MinGW32 when you need MinGW64 :P
Title: Re: Cross Compiling
Post by: intygamer on July 03, 2013, 11:52:06 am
Hi

I copied the above command to download windows compiler on ubuntu 12.04 and got the following message.

------------------------------------------------------------------------------------------------------------------------------------------------
joey@joey-Dimension-8250:~$ sudo apt-get install mingw-w64-i686-dev g++-mingw-w64-i686
[sudo] password for joey:
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package mingw-w64-i686-dev is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'mingw-w64-i686-dev' has no installation candidate
joey@joey-Dimension-8250:~$
------------------------------------------------------------------------------------------------------------------------------------------------

Please help.
Thanks
Joe
Title: Re: Cross Compiling
Post by: intygamer on July 03, 2013, 12:01:02 pm
I tried to download the programs to run the windows compiled games in ubuntu, below is the result

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
joey@joey-Dimension-8250:~$ sudo apt-get install fglrx-glx or libgl1-mesa-glx or nvidia-glx or nvidia-glx-legacy-96xx
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package fglrx-glx is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

Package nvidia-glx is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'fglrx-glx' has no installation candidate
E: Unable to locate package or
E: Unable to locate package or
E: Package 'nvidia-glx' has no installation candidate
E: Unable to locate package or
E: Unable to locate package nvidia-glx-legacy-96xx
joey@joey-Dimension-8250:~$
------------------------------------------------------------------------------

Maybe I need to add repository to download these?

Thanks
Joe
Title: Re: Cross Compiling
Post by: Goombert on July 08, 2013, 02:52:59 am
intygamer, I can't say much about this as I did not create it, cheeseboy did and forced me to post it >:
Title: Re: Cross Compiling
Post by: intygamer on July 08, 2013, 05:37:13 pm
Thanks Robert for responding.

I will wait for Josh to respond.  I probally need to add the repo to ubuntu for the terminal command to work.  Ubuntu repo has a mingw64 compiler, but not the one in command line
Code: [Select]
sudo apt-get install mingw-w64-i686-dev g++-mingw-w64-i686
I looked under downloading windows version of enigma by source and seen the link for http://tdm-gcc.tdragon.net/download (http://tdm-gcc.tdragon.net/download) I'm not sure if I can use these for ubuntu and did not see the exact files listed.

Thanks
Joe
Title: Re: Cross Compiling
Post by: Josh @ Dreamland on July 08, 2013, 06:05:51 pm
Sorry; for some reason, I missed your question.

That package installs fine here, though I am on 13.04. Make sure you're on a 64-bit system, and have Universe enabled as a package source.

If you find a different cross-compiler package, that's fine, as long as the binary names are the same or you update them in the configuration file (Compilers/Linux/MinGW*.ey).
Title: Re: Cross Compiling
Post by: intygamer on July 11, 2013, 07:25:38 pm
Thanks Josh

I take it regardless of the Mingw64 package that any of these wont run on 32bit machine even in 32bit mode? 

Thanks
Joe



Title: Re: Cross Compiling
Post by: Josh @ Dreamland on July 11, 2013, 08:15:42 pm
MinGW64 should offer an -m32 flag like the rest of the GNU compilers. But you'll need the 32-bit libraries, and I'm not sure if they're included. Obtaining 32-bit native libraries is a chore; obtaining cross-compiler libraries is a huge chore; I can't imagine obtaining the 32-bit cross-compiler libraries. Good luck. ;)
Title: Re: Cross Compiling
Post by: Goombert on July 11, 2013, 10:16:14 pm
JoshDreamland, we will eventually work this out the correct way wont we? I mean is that not kind of the point of ENIGMA, build games and they run anywhere? :P
Title: Re: Cross Compiling
Post by: intygamer on July 11, 2013, 10:22:18 pm
Thanks Josh

I will wait till I get my 64bit machine, see if Santa will hook me up.  lol

Thanks for your help.
Joe

Title: Re: Cross Compiling
Post by: Josh @ Dreamland on July 13, 2013, 07:03:11 pm
If your current machine is 32-bit, then any version of MinGW64 will come with all the correct settings and libraries to build for 32-bit. You should be all set.

Robert: My plan for ENIGMA is "build anywhere, run wherever you build." The best I intend to offer is a distribution mechanism which builds your game for each platform, for you.
Title: Re: Cross Compiling
Post by: Goombert on July 14, 2013, 02:44:10 am
Ok Josh, but if a dinkhole like Greg can make this cross compiler, I mean, yah :P
Title: Re: Cross Compiling
Post by: gra on May 16, 2014, 03:13:43 pm
cross compiling news
i have found error in cross compilation, i solved in this mode:
install dependencies
Code: [Select]
sudo apt-get install mingw-w64-i686-dev g++-mingw-w64-i686 winedownload windows patch and copy only the folder ENIGMAsystem in enigma dev
now rename folder in
Code: [Select]
/enigma-dev/ENIGMAsystem/Additional/Windowsin
Code: [Select]
/enigma-dev/ENIGMAsystem/Additional/i686-w64-mingw32ald lets go to compile the windows executable
Title: Re: Cross Compiling
Post by: sorlok_reaves on August 22, 2014, 12:25:48 am
With a bit of hacking, I was able to get Mingw-w64 cross-compiling Windows binaries on Linux. Et voila:
(http://i.imgur.com/81o5mte.png)
OpenAL seems to be working just fine; the only issue I ran into is that mp3 support is disabled (and mp3s crash the game). I'll be looking into this; I think I just compiled OpenAL with the wrong feature set. But WAVs work just fine, so I'm pretty optimistic.

Unfortunately, a lot of "mingw-lib" packages are missing from Ubuntu, so I had to locally install them myself. This is kind of a pain for the average developer ---I only did it because mingw-32bit on Windows can't actually compile Iji (it's too big).
Title: Re: Cross Compiling
Post by: time-killer-games on August 22, 2014, 01:59:54 pm
This is great! GameMaker: Studio beat us to it though. While they may say the contrary on the YoYoGames System Requirements page ...
Quote
Computer running Ubuntu required for export
~ https://www.yoyogames.com/studio/system-requirements

You can technically compile just dandy without a single computer running linux. Trying to "compile" may throw an error saying "Can't connect to Ubuntu" but the files are still outputed anyways and they worked just fine after I sent them to my virtual machine. Since they've done a pretty spotless job at maintaining their Ubuntu export there's really no difference between that and a Windows export in terms of how your games should run. Unless you happen to really like Linux, you don't really need one to compile for it without worry concerning bug complaints.
Title: Re: Cross Compiling
Post by: sorlok_reaves on August 22, 2014, 09:38:24 pm
Yeah, it's not really my intention to compete with YYG. :P This is just because I can't actually compile Iji on Windows (it's too big), so cross-compiling's the only option.

Ok, I wrote a wiki page detailing how I did it:
http://enigma-dev.org/docs/Wiki/CrossCompileWithAudio

I'm still trying to figure out why mp3 won't work; WAVs work fine, so that's very confusing to me. If anyone figures it out, please let me know.
Title: Re: Cross Compiling
Post by: TheExDeus on August 24, 2014, 01:59:06 pm
I think trying to compile with mingw64 on windows would also be a solution, but you would probably have to hit the thing with many rocks to make it work. I can't specifically remember the reason why mingw64 didn't work with ENIGMA on windows.
Title: Re: Cross Compiling
Post by: sorlok_reaves on August 24, 2014, 04:47:49 pm
I think trying to compile with mingw64 on windows would also be a solution, but you would probably have to hit the thing with many rocks to make it work. I can't specifically remember the reason why mingw64 didn't work with ENIGMA on windows.

That would probably work, but I'm not too experienced with MinGW on Windows, much less its 64-bit woes. Cross-compiling is easier and faster, anyway, but thanks for the advice.