Frictional Games Forum (read-only)
Let's compile Penumbra [Linux, CMake, 64bit] - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Open Source Collaboration (https://www.frictionalgames.com/forum/forum-27.html)
+--- Forum: Overture (https://www.frictionalgames.com/forum/forum-29.html)
+--- Thread: Let's compile Penumbra [Linux, CMake, 64bit] (/thread-3353.html)

Pages: 1 2


Let's compile Penumbra [Linux, CMake, 64bit] - qubodup - 05-14-2010

Forum Announcement: READ FIRST! Welcome to the the Frictional Games Open Source Forums helped. So I could start compiling Penumbra.

What I did so far was
Code:
git clone http://github.com/FrictionalGames/HPL1Engine.git
git clone http://github.com/FrictionalGames/OALWrapper.git
git clone http://github.com/FrictionalGames/PenumbraOverture.git
and then I tried to compile Penumbra, but it asked for HPL1Engine, so I tried to compile HPL1Engine
Code:
cd HPL1Engine
cmake .
make
but I got:
Code:
[  1%] Building CXX object CMakeFiles/HPL.dir/sources/resources/ScriptManager.cpp.o
In file included from /home/qubodup/src/git/HPL1Engine/sources/resources/ScriptManager.cpp:23:0:
/home/qubodup/src/git/HPL1Engine/include/system/Script.h:23:25: fatal error: angelscript.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/HPL.dir/sources/resources/ScriptManager.cpp.o] Error 1
make[1]: *** [CMakeFiles/HPL.dir/all] Error 2
make: *** [all] Error 2
then I saw that you have to get dependencies.zip
so I downloaded it and unzipped it and then
Code:
cp dependencies/include/ HPL1Engine/ -r
cp dependencies/lib/ . -r
now `make` finishes. Time to compile Penumbra.

Code:
cd ../PenumbraOverture
cmake .
make
This nearly works (You have to install newton, a non-free physics library first) but unfortunately I'm getting following error
Code:
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../../lib/libNewton.a when searching for -lNewton
/usr/bin/ld: skipping incompatible /usr/lib/../lib/libNewton.a when searching for -lNewton
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/../../../libNewton.a when searching for -lNewton
/usr/bin/ld: skipping incompatible /usr/lib/libNewton.a when searching for -lNewton
/usr/bin/ld: cannot find -lNewton
collect2: ld returned 1 exit status
make[2]: *** [overture.bin] Error 1
make[1]: *** [CMakeFiles/Overture.dir/all] Error 2
make: *** [all] Error 2
If you know how to solve this, please let me know, meanwhile I'm trying to get help on IRC and will keep you updated if I find a solution.

By the way, newton is installed in
Code:
/usr/lib/libNewton.a
/usr/include/Newton.h
on my machine.

Update:

I think copying lib/ and include/ to PenumbraOverture/ might help a little, but the basic problem seems to be that there is no 64bit Newton library (old version) and the new one won't work. What we need is a port to Bullet Smile

Request:
Please add the following information to the open source announcement, that would be great. Quote this post to see the source.

IRC Channel
Feel free to use this unofficial channel to get real-time help for compiling Penumbra & co!
Server: irc.freenode.net
Channel: #penumbra
Web client link


RE: Let's compile Penumbra [Linux, CMake, 64bit] - Setlec - 05-14-2010

AFAIK, Newton is a physics (φx, i'm lazy today... φ means "fi" in ancient Greek) engine a closed one btw! So if the src requires Newton to compile we might need port from newton φx to bullet φx for instance...


RE: Let's compile Penumbra [Linux, CMake, 64bit] - Urkle - 05-14-2010

The dependencies folde should be placed next to HPL1Engine as e cmake scripts reference ../dependencies/include and lib.

As for 64bit. The issue is newton 1.53 does not support 64bit nor does the version of angel script we using. Amnesia is using a newer angel script at do support 64bit and a newer newton. But the Apis are different so code we have to be updated in the hpl1engine code to support 64bit.
Re:newton vs bullet. Yes newton is closed and when talking with the least developer before about using bullet, apparently bullet does not support as much functionality as newton.. However the way the hpl1engine is written all on has to do is write a bullet implementation at conforms to the engines's physics interface and you can switch engines easily.. ( we used to have an fmod sound driver in there at one point too.)

Adding a bullet backend is definitely a project worth looking into if all the functionality can be done, as it would allow more openness of is engine..


RE: Let's compile Penumbra [Linux, CMake, 64bit] - cybersphinx - 05-14-2010

I finally got a binary compiled, forcing a 32 bit build by adding
Code:
add_definitions(-m32 -O2)
to all three CMakeList.txts, and
Code:
set(CMAKE_EXE_LINKER_FLAGS "-m32")
to that in PenumbraOverture. It needs some 32 bit compiler stuff installed to actually work, on Debian the packages are libc6-dev-i386 and g++-4.4-multilib (for stubs-32.h and a 32 bit crtbegin.o). The resulting binary seems to run ok, but sometimes dies on exit with:
Code:
(0) : fatal error C9999: *** exception during compilation ***
Cg compiler terminated due to fatal errorSegmentation fault
When adding -march=native to the compiler flags, it dies when trying to enter the "real" game, maybe with less optimization it wouldn't crash at all.


RE: Let's compile Penumbra [Linux, CMake, 64bit] - Urkle - 05-14-2010

yeah.. you can't do high optimizations or it goes "kaboom".

and the Cg error is probably from not running it in the penumbra game dir.

Do you mind sending a patch for the CmakeLists?


RE: Let's compile Penumbra [Linux, CMake, 64bit] - cybersphinx - 05-14-2010

I'm not sure those should be in the cmake files, since they are specific to 64 bit Linux systems. But
Code:
cmake -DCMAKE_CXX_FLAGS=-m32 -DCMAKE_C_FLAGS=-m32 -DCMAKE_LD_FLAGS=-m32 .
also works, without having to change anything else.


RE: Let's compile Penumbra [Linux, CMake, 64bit] - Urkle - 05-14-2010

true true.. Probably need to add a custom CMake config setting to toggle force 32bit builds or notSmile (for when someone makes a bullet physics port and updated angelscript and a 64bit build CAN be done)


RE: Let's compile Penumbra [Linux, CMake, 64bit] - qubodup - 05-15-2010

I'm getting following output when I try the 32bit compilation on 64bit Linux:
Code:
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /bin/gcc
-- Check for working C compiler: /bin/gcc -- broken
CMake Error at /usr/share/cmake-2.8/Modules/CMakeTestCCompiler.cmake:52 (MESSAGE):
  The C compiler "/bin/gcc" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: /home/qubodup/src/git/PenumbraOverture/CMakeFiles/CMakeTmp

  

  Run Build Command:/usr/bin/make "cmTryCompileExec/fast"

  /usr/bin/make -f CMakeFiles/cmTryCompileExec.dir/build.make
  CMakeFiles/cmTryCompileExec.dir/build

  make[1]: Entering directory
  `/home/qubodup/src/git/PenumbraOverture/CMakeFiles/CMakeTmp'

  /usr/bin/cmake -E cmake_progress_report
  /home/qubodup/src/git/PenumbraOverture/CMakeFiles/CMakeTmp/CMakeFiles 1

  Building C object CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o

  /bin/gcc -m32 -o CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -c
  /home/qubodup/src/git/PenumbraOverture/CMakeFiles/CMakeTmp/testCCompiler.c

  Linking C executable cmTryCompileExec

  /usr/bin/cmake -E cmake_link_script
  CMakeFiles/cmTryCompileExec.dir/link.txt --verbose=1

  /bin/gcc -m32 CMakeFiles/cmTryCompileExec.dir/testCCompiler.c.o -o
  cmTryCompileExec -rdynamic

  /usr/bin/ld: skipping incompatible
  /usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.0/libgcc.a when searching for
  -lgcc

  /usr/bin/ld: cannot find -lgcc

  collect2: ld returned 1 exit status

  make[1]: *** [cmTryCompileExec] Error 1

  make[1]: Leaving directory
  `/home/qubodup/src/git/PenumbraOverture/CMakeFiles/CMakeTmp'

  make: *** [cmTryCompileExec/fast] Error 2

  

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!



RE: Let's compile Penumbra [Linux, CMake, 64bit] - Urkle - 05-15-2010

Do you have the 32bit compiler components installed?

Try a simple test application in 32bit mode ie.

Code:
#include <stdio.h>

int main(int argc, char *argv[]) {
      printf ("test\n");
      return 0;
}

And run it with

Code:
gcc -m32 test.c -o test



RE: Let's compile Penumbra [Linux, CMake, 64bit] - cybersphinx - 05-15-2010

Sounds like you don't have all needed 32 bit packages, find out which has the 32 bit libgcc and install that.
I also had to remove the libstdc++ from dependencies, since my libc was too new for that.