bfready
Posts: 60
Joined: Sun Jun 16, 2019 2:13 pm

Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Sun Mar 01, 2020 5:49 am

Hello,

I was wondering if anyone has been able to compile and run Barony (a 1st person rogue like) successfully:
https://github.com/ptitSeb/Barony
I am using this build that ptitSeb made for open pandora (another arm base linux system)<-- perhaps part of the reason why it doesn't work?

I am doing this on a Raspberry Pi 4 w/ 4gb of ram, running Raspbian Buster.

I was able to cmake and make install after figuring out WHERE to run this command... (I was going into the SRC directory before. It started compiling once I went back to the ~/Barony/ directory. It only compiles to 15%, however:
pi@raspberrypi:~/Barony $ make install ./
[ 15%] Linking CXX executable editor
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libSDL2_ttf.so: undefined reference to `SDL_RWclose'
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libSDL2_ttf.so: undefined reference to `SDL_RWread'
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libSDL2_ttf.so: undefined reference to `SDL_RWseek'
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libSDL2_ttf.so: undefined reference to `SDL_RWsize'
/usr/bin/ld: /usr/local/lib/arm-linux-gnueabihf/libSDL2_ttf.so: undefined reference to `SDL_RWtell'
collect2: error: ld returned 1 exit status
make[2]: *** [CMakeFiles/editor.dir/build.make:367: editor] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/editor.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
Thinking it was something to do with the libSDL2_ttf, I installed:

sudo apt-get install libsdl2-ttf-dev
and
sudo apt-get install libsdl2-ttf-2.0-0

This changed nothing unfortunately. Anyone have any idea?

here's what I have done, step by step:

pi@raspberrypi:~ $ git clone https://github.com/ptitSeb/Barony
pi@raspberrypi:~ $ cd Barony
pi@raspberrypi:~/Barony $ cmake ./
pi@raspberrypi:~/Barony $ make install ./


Should I be changing something the CMakeList file prior to cmake and make install?

Thanks for your help, guys!

bfready
Posts: 60
Joined: Sun Jun 16, 2019 2:13 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Sun Mar 01, 2020 6:26 am

Not sure if I went forward or backwards when changing this in the CMakeLists.txt...
set(PANDORA 1<-- SET THIS TO 1)
option(PANDORA_ENABLED "Build for the OpenPandora" ON<-- SET THIS TO ON)

I now get this when I run ./make install:
~/Barony $ make install ./
[ 1%] Building CXX object CMakeFiles/editor.dir/src/main.cpp.o
In file included from /usr/include/features.h:448,
from /usr/include/arm-linux-gnueabihf/c++/8/bits/os_defines.h:39,
from /usr/include/arm-linux-gnueabihf/c++/8/bits/c++config.h:508,
from /usr/include/c++/8/utility:68,
from /usr/include/c++/8/algorithm:60,
from /home/pi/Barony/src/main.hpp:14,
from /home/pi/Barony/src/main.cpp:12:
/usr/include/arm-linux-gnueabihf/gnu/stubs.h:7:11: fatal error: gnu/stubs-soft.h: No such file or directory
# include <gnu/stubs-soft.h>
^~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/editor.dir/build.make:63: CMakeFiles/editor.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:73: CMakeFiles/editor.dir/all] Error 2
make: *** [Makefile:130: all] Error 2
This is what it shows when I run cmake ./ :
\------------------------
Building without steamworks
------------------------
-- Warning: Unable to find FMOD!
***************************

Debug flags:
-g -Wall -ffast-math -funroll-loops -fstrict-aliasing -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -g -fuse-ld=gold -fuse-linker-plugin -malign-double -rdynamic -Wl,-rpath=$ORIGIN
-g -Wall -std=c++11 -rdynamic -Wl,-rpath=$ORIGIN
Release flags:
-O3 -DNDEBUG -O3 -ffast-math -funroll-loops -fstrict-aliasing -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fuse-ld=gold -fuse-linker-plugin -fsingle-precision-constant -malign-double -Wl,-rpath=$ORIGIN -Wno-write-strings
-O3 -DNDEBUG -O3 -ffast-math -funroll-loops -fstrict-aliasing -mcpu=cortex-a8 -mfpu=neon -mfloat-abi=softfp -fuse-ld=gold -fuse-linker-plugin -fsingle-precision-constant -std=c++11 -Wl,-rpath=$ORIGIN -Wno-write-strings
If anyone has any suggestions, let me know!

ptitSeb
Posts: 213
Joined: Tue May 19, 2015 2:49 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Sun Mar 01, 2020 3:08 pm

Hi there.

I'm not sure why it doesn't find SDL2 TTF once it's installed, strange...
(EDIT: the missing symbols are from SDL2 itself, not SDL2 TTF)

One hint: instead of hacking the CMakeList.txt, use `ccmake` instead to configure the options you want (like OpenAL instead of FMod). (use `sudo apt install cmake-curses-gui`).

Also, no, the OpenPandora binary will not work on Rpi, because Pandora is using Softfloat (`-mfloat-abi=softfp`) where Pi (and most ARM Linux platform) use HardFP (`-mfloat-abi=hard`).

bfready
Posts: 60
Joined: Sun Jun 16, 2019 2:13 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Sun Mar 01, 2020 3:16 pm

Hi, ptitSeb.

Thanks for this! Never knew about ccmake. It looks very useful. So much easier than editing CMakeList.txt.

Yeah, I figured the Pandora binary would not work on the rpi, but do you suggest I still try to compile your source of Barony or try to compile the original source from TurningWheel?

Thanks again for the help!

ptitSeb
Posts: 213
Joined: Tue May 19, 2015 2:49 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Sun Mar 01, 2020 3:24 pm

Both should work.
On mine you have some optionnal "FLOAT" optimizations (not sure there are usefull on a Pi) and some slight openGL optimization (aimed at gl4es, not sure if useful on Pi, again), on the other hand the original will be the latest one... You should try both :p

bfready
Posts: 60
Joined: Sun Jun 16, 2019 2:13 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Sun Mar 01, 2020 4:32 pm

Hi, again, ptitSeb.

It was looking for the SDL2 files in /usr/local/lib/arm-linux-gnueabihf/ and I think the correct files were in /usr/lib/arm-linux-gnueabihf/
I tried changing the path in CCMAKE, which appeared to save, but would still error out looking for them in /usr/local/lib.
So, I copied over the SDL2* files and it made it past 15%! On to the next compilation error...

Thanks again for your help, man!

bfready
Posts: 60
Joined: Sun Jun 16, 2019 2:13 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Sun Mar 01, 2020 5:02 pm

It errored out for something about variable declaration types @ 25 percent. This was the original source I tried compiling, so I git-cloned your fork again and tried compiling. It compiled all the way to 100 percent, but errored for not being able to copy the barony file to /usr/local/bin/. I tried doing it manually, and was unable (permissions denied) until I sudo cp'd it. Should I be using sudo for the make command perhaps?

Anyways, I tried running ./barony. I saw a window open and close quickly, but nothing else happened.
I checked the ~/.barony/log.txt and it was complaining about not being able to locat the en.txt file:
[10-51-11] error: unable to locate language file: 'lang/en.txt'
[10-51-11] Fatal error: failed to load default language file!
I checked in ~/Barony/lang and there is, indeed, an en.txt file. I can read the text inside it and everything.
I tried copying the lang file over to ~/.barony, just in cast it was looking for it in this directory, but it still errored out.

I think I may try compiling again and check if there is anything related to language in the cmake? I think I'm going to try sudo make install this time and see if it errors out at the end of the compilation.

ptitSeb
Posts: 213
Joined: Tue May 19, 2015 2:49 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Sun Mar 01, 2020 5:07 pm

I don't remember there is a copy of the the binary in /usr/local/bin
strange

Anyway, the better way to get it running is to take the GOG (or steam version), extract somewhere, and replace the x86 binary with the one you just built.

EDIT: also yes, that "lang" folder is part of the repo...

bfready
Posts: 60
Joined: Sun Jun 16, 2019 2:13 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Sun Mar 01, 2020 5:30 pm

Ahh.. Once I did sudo make install, it was able to place Barony into /usr/lib/bin... PLUS, it had a couple more things it did before completing, including placing the lang folder into /usr/local/share. So, once that was done, I got past the lang/en.txt error.

I'm now getting this: error: failed to load image './/images/system/fancyWindow.png'

But, I just remembered that I have not put the data files in yet! So, I think I'm close.....

bfready
Posts: 60
Joined: Sun Jun 16, 2019 2:13 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Sun Mar 01, 2020 7:46 pm

I actually saw the application window popup and load 686 models... But, NOW, it's missing a lot of png files in /images/system/. I just noticed, I did not have the blessed addition data files.. I have the cursed edition. Do you think the missing images are because it's not the blessed addition?
pi@raspberrypi:~/.barony $ tail log.txt
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB
[12-18-25] error: failed to load image './/images/system/polymorph.png'

ptitSeb
Posts: 213
Joined: Tue May 19, 2015 2:49 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Mon Mar 02, 2020 8:14 am

Yes, the blessed edition have a lot more picture. You need to get the blessed or build a "cursed edition" version. You need to checkout a "curses" version of the code. Unfortunatly, my fork is not up-to-date on the Tags, so it's tricky to find the correct release there is only "v2.0.4" tag, no idea if it would work)

bfready
Posts: 60
Joined: Sun Jun 16, 2019 2:13 pm

Re: Successfully Compiling Barony: Blessed Addition on an RP4 w/ 4gb

Mon Mar 02, 2020 8:24 pm

Hi, ptitSeb.

Thanks for the info. I will most likely try to compile the cursed edition sometime this week.

Return to “Gaming”