Frictional Games Forum (read-only)
Compilation instructions for Ubuntu 12.04 32 bit - 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: Compilation instructions for Ubuntu 12.04 32 bit (/thread-56758.html)



Compilation instructions for Ubuntu 12.04 32 bit - onager - 04-09-2020

Hello,
I have prepared 
Compilation instructions fpr Penumbra: Overture on Ubuntu 12.04 32 bit.
Note that game still has issues with graphics on this OS (or may be it's just on my VirtualBox VM): shader settings above "very low" are not usable, zooming in when interacting with objects is broken, but otherwise game is playable (at least a few first levels, I did not play beyond that).
First and foremost, Kudos to:
  1. JKO for excellent compilation guide for Windows, which was the base of this instructions (link to JKO's guide)
  2. Commit by jorgeas80 which mentions particular commit of OALWrapper compatible with HPL1
First and foremost, let's create a root folder for our work somewhere in home directory (in this example "OvertureSource"). Inside it we will checkout repositories. Ubuntu 12.04 uses newer compiler than used originally, so some fixes are required to fix compilation errors, so I suggest to pull my forks that already have required fixes.
Code:
mkdir OvertureSource
cd OvertureSource
git clone git://github.com/Kristian-Popov/HPL1Engine.git
git clone git://github.com/FrictionalGames/OALWrapper.git
git clone git://github.com/Kristian-Popov/PenumbraOverture.git
Now we have to rewind OALWrapper back:

Code:
cd OALWrapper
git checkout ae59c6d7bd476d4d5c7e4a6cd3323a48ed1a6c9c
cd ..
Precompiled versions of Angelscript and Newton can be found in the attached archive. Unlike original dependencies archive, this has dependencies only for Linux, also only two libraries left, for the rest we will be using system libraries. Note that packaged version of Angelscript is not original one, instead this was compiled by g++ 4.5 (default one on this OS) and with AS_MAX_PORTABILITY option. This option means that code is not so dependent on compiler and good implementation of Angelscript (it was crashing at game start, probably because by default it messes with stack on low level). Instructions on how to compile Angelscript are below.
Download archive and unpack it to "dependencies" folder.
Now copy assets from your Penumbra: Overture folder to "redist" folder. I tried running game using assets from Windows and Linux versions, it worked in both cases, so I don't think it matters. You need to copy not only subfolders, but also files "materials.cfg" and "resources.cfg".
Now it's time to install a lot of packages:
Code:
sudo apt-get install libalut-dev libopenal-dev libvorbis-dev libsdl1.2-dev  libsdl-image1.2-dev libogg-dev libpng-dev nvidia-cg-toolkit glee-dev libtinyxml-dev mesa-common-dev libglu1-mesa-dev libgl-dev libgl1-mesa-dev libgl-dev libgles1-mesa-dev g++ cmake
This list includes most of used third-party libraries, gcc C++ compiler and CMake.

Let's compile!
Code:
mkdir PenumbraOverture-build
cd PenumbraOverture-build
cmake ../PenumbraOverture .
make

Optionally you can compile a few jobs in parallel, although I don't have any particular recommendations for number of jobs run simultaneously. You can try value N = <number of processor cores in system> - 1
Code:
make -j N

If everything went well, let's copy executable go to "redist" folder and run the game.

Code:
cp overture.bin ../redist/
cd ../redist/
./overture.bin

Logs and settings are stored at "~/.frictionalgames/Penumbra/Overture". Settings file is quite readable, so don't be too afraid to edit it manually.
Note that list of problems remains, you can check my other post for details.

Compilation instructions for Angelscript

We will be compiling version 2.7.1b, same as used with original release of Penumbra: Overture.
You can download all releases at Angelscript download page

After downloading unpack archive and go to "angelscript/projects/gnuc" subfolder, here you will find "makefile". Open it with any text editor and find a line "CXXFLAGS = -g -Wall".
Comment it (in case you want to go back to original compilation flags) and add a new line like this:
Code:
# CXXFLAGS = -g -Wall
CXXFLAGS = -g -Wall -DAS_MAX_PORTABILITY

Now start compilation by running "make" in the same folder.
Compiled library ("libangelscript.a") can be found at "<Angelscript root>/angelscript/lib". Copy it to "dependencies" subfolder.

Final file structure of "OvertureSource" folder should look like this:

Code:
OvertureSource
   dependencies
       include
           angelscript.h
           Newton.h
       lib
           linux
               libangelscript.a
               libNewton.a
   HPL1Engine (many files and folders inside)
   OALWrapper (many files and folders inside)
   PenumbraOverture (many files and folders inside)
   redist
       materials.cfg
       resources.cfg
       ...
   PenumbraOverture-build (build folder)

I hope this material was useful.
I may edit this post in future to improve or fix errors.


RE: Compilation instructions for Ubuntu 12.04 32 bit - erolmatei - 05-22-2020

Hi, I was unaware of your guide and managed to get an almost fully working solution on a modern distro (Arch Linux). I also managed to use the most recent OALWrapper and fixed some compilation issues, however I am getting a crash on some specific ogg file loading, as I mentioned in another post.

Thank you for the guide, and shame on me for not reading it earlier.

EDIT: Oh lol I just saw the fixup for AngelScript. It was the culprit for me as well.


RE: Compilation instructions for Ubuntu 12.04 32 bit - ced117 - 05-22-2020

Hello,

Right, this is really useful.
Thank you onager :-)