Topic: [request] Compilation Cookbook

As the title indicates, i'd like to request information that is since long not in the Wiki.

To put it simply, it would be nice to have a reference on how to setup the compiling environment, from which tools we need, to which dependencies and procedures one needs to successfully compile both Windows and Linux versions (i remember vaguely someone who did an OSX port, please join the band smile )

I did this once successfully with the help of lunarrush, but unfortunately i had to reinstall my Windows and lost the chat history with the full procedure, so i'm kind of lost here. I believe many other users could benefit from this guide.

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [request] Compilation Cookbook

I agree!

Re: [request] Compilation Cookbook

I can make such a guide, but only around the December holidays.

Alternatively, I can, at this moment, help you compile the game for Linux through this forum, so you can write the guide for the wiki. What do you think?

Re: [request] Compilation Cookbook

sounds good. this week i have time until the weekend, and then only in december. maybe we can work something out

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [request] Compilation Cookbook

I would like to bump up the topic.

I started writing the guide, but i'm having problems with compiling.

Until now everything was successful following the steps in the wiki. but when compiling Open Surge, i get some errors related with audio. This is done on Windows using Cmake/MingW.

D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk>mingw32-make
[  0%] Building C object CMakeFiles/opensurge.dir/src/core/audio.c.obj
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c: I
n function 'music_play':
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:25
4:22: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c: I
n function 'music_stop':
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:30
2:55: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c: I
n function 'music_pause':
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:33
0:41: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c: I
n function 'music_resume':
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:35
4:42: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c: I
n function 'music_set_volume':
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:37
9:30: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:38
0:47: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:38
0:91: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c: I
n function 'music_get_volume':
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:40
3:44: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c: I
n function 'music_duration':
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:44
7:28: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:44
7:28: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c: I
n function 'audio_update':
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:88
7:35: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:88
9:47: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:88
9:47: error: dereferencing pointer to incomplete type
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c: I
n function 'music_duration':
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:44
8:1: warning: control reaches end of non-void function [-Wreturn-type]
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c: I
n function 'music_get_volume':
D:\Users\KZR\Desktop\SD\src\opensnc-code-760-opensurge-trunk\src\core\audio.c:40
6:1: warning: control reaches end of non-void function [-Wreturn-type]
mingw32-make[2]: *** [CMakeFiles/opensurge.dir/src/core/audio.c.obj] Error 1
mingw32-make[1]: *** [CMakeFiles/opensurge.dir/all] Error 2
mingw32-make: *** [all] Error 2

What am i doing wrong?

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [request] Compilation Cookbook

thanks for starting up the cookbook, it's looking good smile

Just one observation - it goes both for the cookbook and for your question: the addons JPGAlleg, loadpng and LOGG are already bundled with Allegro 4.4, so you don't need to install them separately. Now, this is *very* important: you have to compile A4.4 from the source code. Before you compile it, please make sure that (via ccmake) you activate the addons jpgalleg, loadpng and LOGG.

In your case, maybe you haven't enabled LOGG in your A4.4 install ?

Re: [request] Compilation Cookbook

i get the same problem even after compiling Allegro. how do i activate the addons?

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [request] Compilation Cookbook

There's a build option that appears when you compile Allegro 4.4, specifying whether to activate LOGG or not. You need to activate it (set it to ON):

http://www.cmake.org/cmake/help/runningcmake.html

After enabling LOGG, loadpng and jpgalleg, then you proceed to compile A4.4. smile

Re: [request] Compilation Cookbook

I found the reason why i didn't get that. in some cases it's needed to add C:\MinGW\bin;C:\MinGW\lib to a system Path variable before using CMake GUI. I will detail this procedure in the guide smile

I still get the same problems when trying to compile Open Surge, unfortunately :\

Last edited by KZR (2013-12-28 09:55:42)

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [request] Compilation Cookbook

KZR wrote:

I found the reason why i didn't get that. in some cases it's needed to add C:\MinGW\bin;C:\MinGW\lib to a system Path variable before using CMake GUI. I will detail this procedure in the guide smile

nice, thanks! wink

KZR wrote:

I still get the same problems when trying to compile Open Surge, unfortunately :\

Ah, so this error is probably due to some incomplete version of vorbisfile.h. It's easy to fix. Try this:

1) go to http://opensnc.sourceforge.net/logg
2) download libogg & libvorbis for MinGW
3) install them to the correct directories (so that their include/ folder coincides with MinGW's). I think you'll extract them to C:\MinGW, but I'm not sure. Can you check it?
4) try to compile again

11

Re: [request] Compilation Cookbook

still doesn't work. also recompiled Allegro, just in case. any other ideas? :\

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [request] Compilation Cookbook

strange, I really think that's the solution. I remember compiling the game on MinGW some time ago using those packages; and nothing else was required for LOGG to work.

Where have you extracted them? Can you show the MinGW directory tree?

13

Re: [request] Compilation Cookbook

Ok I compiled the engine successfully. I would like to ask our fellow members to follow the guide and try for themselves, then let me know if anything is missing or wrong.

again the guide is here:

http://opensnc.sourceforge.net/wiki/ind … ource_Code

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [request] Compilation Cookbook

Maybe a little more details on cmake and allegro... I browse the source and then the Build destination as in the picture, in CMake... When I press configure what choice do I make in "Specify generator for this project"? I select MinGW which I have installed in my C, but I get errors like :

-------------------------------------------------------
>CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles".  CMAKE_MAKE_PROGRAM is not set.  You probably need to select a different build tool.
>CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
>Missing variable is:
CMAKE_C_COMPILER
......
-------------------------------------------------------

I have added the system variables and don't have another tool for compilation except MinGW!


Also, when I try it the New Way, I unzip the files from dropbox in my MinGW folder, I add the Path variables then I open command prompt I type the commands given, but I get the error : "cmake -GMinGW Makefiles. 'cmake' is not recognized as an internal or external command, operable program or hatch file"...
I don't know... maybe it has something to do with where I installed Cmake...

Last edited by S.Anideos (2014-01-08 09:28:14)

15

Re: [request] Compilation Cookbook

When you installed cmake, did you select this option (or under it)?

https://dl.dropboxusercontent.com/u/20216605/open%20surge%20contents/compilation%20cookbook/cmake%20install.jpg

I also updated the guide with this image

Last edited by KZR (2014-01-08 20:46:02)

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

16

Re: [request] Compilation Cookbook

Quick bump:

I managed to compile on Linux, and it was not exactly easy. R760 was giving me errors in nanocalc.c, so i replaced it with the nanocalc from 763 and it worked fine. Installing and defining library dependencies was a bit tough, especially ALURE and Alfont.

I can not, however, produce Windows executables. My HDD is broken and I am running Linux from an external drive, in which Windows can not be installed (oh uncle Bill, why??). Due to this, I can not work on the Windows cookbook at the moment sad

Is there any way i can produce an exe while compiling on Linux?

Last edited by KZR (2014-04-06 12:29:58)

https://image.ibb.co/kuSYrm/SD_sml.pnghttps://image.ibb.co/kHq8P6/SeD_sml.pnghttps://image.ibb.co/cJf8P6/LTot_W_sml.png

Re: [request] Compilation Cookbook

Cross-compilation, maybe?

-- svgmovement