Hey, we have forums!

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - King_DuckZ

Pages: [1]
1
General / Re: Aquaria Source Code Released
« on: February 11, 2012, 02:45:49 pm »
Quote
Which OS are you using that you get that joystick error? Compiles fine for me on win/linux/osx.
I'm running Sabayon Linux. Btw with gcc the code built fine, only ekopath needed that inclusion to be added. It's a standard header, so it won't do any bad in gcc but if you think it's better to limit it to specific compilers, the correct ifdef for ekopath would be __PATHCC__ (and __INTEL_COMPILER in case icpc complains about the same thing, I only tried the fixed version with it).
Quote
(And btw, instead of __LINUX__, BBGE_BUILD_LINUX and related are used throughout the code.)
I don't know, I just saw other ifdefs like that in the same file and copied & pasted.
Quote
I have crash problems with gcc and -O3, better use -O2, to be on the safe side.
I played with the ekopath bin and had no problems. I added the necessary to CMakeFiles.txt to keep -O2 for gcc only.

I'm attaching a patch (based on revision 37d19fdd3fc4+), it contains the fixes we've been discussing plus warning fixes for the intel compiler plus some minor crap.
All of the fixes can be put on the main repo, as well as the CMakeLists.txt. The only thing that should be noted is that I added the -march=native option in there: this means that you can use it to build on your machine but the generated binary is suboptimal or broken for other machines. That option must be taken away when builing a distributable binary.

I'm not really planning to bash onto the code, I had some time to kill and played with it, but thanks for telling me about the mailing list!
Edit: the attachment function is not working, the patch is here.

2
General / Re: Aquaria Source Code Released
« on: February 10, 2012, 10:25:07 pm »
Hi guys, just in case this will be helpful for someone, I successfully built aquaria with both gcc and ekopath.

gcc (Gentoo 4.6.2 p1.0, pie-0.4.5) 4.6.2
PathScale EKOPath(tm) Compiler Suite: Version 4.0.12

With gcc it just worked, just cd into an empty directory and run
cmake <path to aquaria> -DCMAKE_BUILD_TYPE=Release
make -j<your number of cores>

(if you don't know how many cores you have just run make alone, or "make -j$(cat /proc/cpuinfo | grep -m 1 'cpu cores' | grep -Po \\d)" note that the higher the number you put, the more memory you will need)
Once finished you can copy the binary to wherever your data files are and delete this temporary dir. The code will still be kept.

With ekopath some fixes were needed, but I still think the coders did a great job in writing high quality code. Bravi! Enough said, down to the fixes:
in the CMakeLists.txt I added those two lines:
SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -O3 -OPT:Olimit=0")
SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -OPT:Olimit=0")

Those are optional. You can drop -O3, you would still get a good result. The second option, -OPT:Olimit=0, shuts down a warning about the optimizer running out of memory and giving up in some cases, but the build would still be successful. Make sure you have enough ram if you use this option (I needed around 1 GiB and I ran make -j2). To save up memory you can run make without the -j option.

Second fix is in aquaria/BBGE/Joystick.cpp, as the compiler would complain about close() and write() not being defined. The prototype for those functions are in unistd.h, so open Joystick.cpp, go down where you see #include "Core.h" and add the following right after that:
#ifdef __LINUX__
#include <unistd.h>
#endif

That's it, run cmake with the following command:
CC=pathcc CXX=pathCC cmake ../aquaria/ -DCMAKE_BUILD_TYPE=Release

run make or make -j and wait for your steaming hot binary :)
In my case, gcc made a 3 MiB binary, ekopath a 8.7 MiB one. Building with intel compiler should be easy enough, you can try if you want, just replace pathcc with icc and pathCC with icpc in the previous command. Me, I'm happy enough with my ekopath binary. Have fun!

Edit: I see some people are having issues getting the code. Just install mercurial from your package manager or get it from here, cd into a new dir where you want the code to be downloaded and run
hg clone http://hg.icculus.org/icculus/aquaria/

A new directory called aquaria will be created and you will find the code inside. You can then remove mercurial if you want.

Pages: [1]