GemRB

IRIX and IRIX software discussion including open source and commerical offerings.
Forum rules
Any posts concerning pirated software or offering to buy/sell/trade commercial software are subject to removal.
User avatar
necron2600
Posts: 261
Joined: Tue May 26, 2015 10:38 pm
Location: Boston

Re: GemRB

Unread postby necron2600 » Tue Dec 06, 2016 4:08 pm

strace output: (near the end of it)
write(1, "\33[1m\33[37;40m", 12) = 12
write(1, "[", 1[) = 1
write(1, "PluginLoader", 12PluginLoader) = 12
write(1, "\33[1m\33[37;40m", 12) = 12
write(1, "]: ", 3]: ) = 3
write(1, "\33[0m\33[37;40m", 12) = 12
write(1, "Loaded plugin \"Effect opcodes f"..., 61Loaded plugin "Effect opcodes for core games" (FXOpcodes.so).) = 61
write(1, "\n", 1
) = 1
access("/usr/local/lib/gemrb/plugins/GUIScript.so", R_OK) = 0
open("/usr/local/lib/gemrb/plugins/GUIScript.so", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7ffeec80, 0x2, 0x3a208, 0x3a208) = 71417856
close(3) = 0
open("/usr/local/lib/gemrb/libpython2.7.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/nekoware/lib/libpython2.7.so", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7ffed5e0, 0x2, 0x183248, 0x183248) = 71909376
close(3) = 0
open("/usr/local/lib/gemrb/libCsup.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/nekoware/lib/libCsup.so", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib32/libCsup.so", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7ffecff0, 0x2, 0x5c8, 0x5c8) = 180355072
close(3) = 0
open("/usr/local/lib/gemrb/libC.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/nekoware/lib/libC.so.2", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib32/libC.so.2", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7ffecfe0, 0x2, 0x50a18, 0x50a18) = 181207040
close(3) = 0
open("/usr/local/lib/gemrb/libCio.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/nekoware/lib/libCio.so.1", O_RDONLY) = -1 ENOENT (No such file or directory)
open("/usr/lib32/libCio.so.1", O_RDONLY) = 3
read(3, "\177ELF\1\2\1\0\0\0\0\0\0\0\0\0\0"..., 512) = 512
syssgi(SGI_ELFMAP, 0x3, 0x7ffecfd0, 0x2, 0xd3bc8, 0xd3bc8) = 182255616
close(3) = 0
fcntl(0, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(1, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(2, F_GETFL) = 0x2 (flags O_RDWR)
fcntl(2, F_GETFL) = 0x2 (flags O_RDWR)
--- SIGBUS (Bus error) ---

User avatar
necron2600
Posts: 261
Joined: Tue May 26, 2015 10:38 pm
Location: Boston

Re: GemRB

Unread postby necron2600 » Tue Dec 06, 2016 8:29 pm

Through process of elimination .. GUIScript.so plugin is what is causing the core dump.
There are 41 plugins.. if I have 40 there.. and remove GUIScript.so.. gemrb loads all and then says it needs GUIscript but no core dump. If I only have 1 plugin available.. and the other 40 removed, gemrb core dumps (and tried different combos).

I noted that Dexter1 has a few more mods left on stricmp change to strcasecmp within GUIScript.cpp .. I'm trying those now. Strange that GCC didnt complain on compiling with stricmp.

lynx
Posts: 17
Joined: Fri Oct 14, 2016 9:15 am

Re: GemRB

Unread postby lynx » Wed Dec 07, 2016 3:07 am

ldexpf is C99 and maybe a glibc extension. BIKPlayer is only needed for iwd2 movies though. I'll just disable the whole plugin build if the function isn't available — too lazy to find a reliable standalone implementation (could be tricky, since floats are involved).

What was the problem with openal? You can disable it through ccmake or passing a flag.

We use strcasecmp everywhere but on windows (stricmp is its alias).

The GUIScript plugin is essential. Can you post your current "git diff" the next time?

User avatar
necron2600
Posts: 261
Joined: Tue May 26, 2015 10:38 pm
Location: Boston

Re: GemRB

Unread postby necron2600 » Wed Dec 07, 2016 6:45 am

git diff is attached.
my apologies for it being messy. Its size is mainly due to deleting a large chuck of BIKPlayer.cpp to get it to compile but have it do nothing/dummy. Also GemRB.cpp shows up as modified.. but it really was not.. i was testing things around where gdb was saying it was crashing at.
I also started adding in Dexter's changes you had listed at http://sprunge.us/TPJi?diff but so far I see no difference regarding the GUIScript plugin core dump.
Attachments
gemrb-irix-gitdiff.txt
git diff
(45.27 KiB) Downloaded 20 times

lynx
Posts: 17
Joined: Fri Oct 14, 2016 9:15 am

Re: GemRB

Unread postby lynx » Wed Dec 07, 2016 7:07 am

I've pushed some changes, so you don't have to hack BIKPlayer away anymore. Or CMakeLists.txt for the module stuff.

Are the FP constants really needed in both headers?

stricmp is just a macro, so WTF do you need to change the uses?
#ifndef WIN32
# define stricmp strcasecmp
# define strnicmp strncasecmp
#endif

you can run git checkout dir/asd/asd/file to reset your copy of a file to what is upstream. Do that for CMakeLists or you'll get conflicts when updating. So something like
git checkout CMakeLists.txt
git checkout gemrb/plugins/BIKPlayer/*
git stash
git pull
git stash pop

User avatar
necron2600
Posts: 261
Joined: Tue May 26, 2015 10:38 pm
Location: Boston

Re: GemRB

Unread postby necron2600 » Wed Dec 07, 2016 1:10 pm

So I did a fresh clone from GIT.. still a few things to adjust/mod but nothing serious (same things mentioned before). My git clone didnt seem to have BIKPlayer removed yet, but it could just be my doing.

Compile works. I was using -O3 before.. but I just tried with the default -O2 optimziation for Gemrb and same thing.

Gemrb loading GUIscript Plugin has the IRIX OS itself terminate gemrb as identified in the IRIX console:

ALERT: Process [gemrb] 487180 generated trap, but has signal 10 held or ignored
epc 0x617f98 ra 0xace67b4 badvaddr 0xfffffffffffffffd
process has been terminated to prevent infinite loop

If I remove GUIScript plugin from the plugins dir.. things load up promisingly .. even an SDL window, and loading BG data files... just needs GUIScript in the end.

What I can do is try with SGI's native MIPSPro Compiler as Dexter did earlier. Just that compiler can be pretty picky. Other than that, im running out of options.

lynx
Posts: 17
Joined: Fri Oct 14, 2016 9:15 am

Re: GemRB

Unread postby lynx » Wed Dec 07, 2016 1:45 pm

if you run "git log", what is the last commit? You definitely shouldn't need all the hacks from before.

User avatar
necron2600
Posts: 261
Joined: Tue May 26, 2015 10:38 pm
Location: Boston

Re: GemRB

Unread postby necron2600 » Wed Dec 07, 2016 10:37 pm

lynx.. dont use any diff files and info from this message to formally add to GemRB. I need more help on this one from Dexter or other more seasoned IRIX developers.

Ok. I am able to compile with MIPSPro Compiler. However the result is unresolvable symbols:

Code: Select all

[octane]:~ $ gemrb
559531:gemrb: rld: Error: unresolvable symbol in /usr/local/lib/gemrb/libgemrb_core.so.0.8.4-git: __dt__Q2_3std139_Deque_base__pt__119_Q3_5GemRB15GemMarkupParser14TextAttributesQ2_3std60allocator__pt__43_Q3_5GemRB15GemMarkupParser14TextAttributesXCUiL10Gv
559531:gemrb: rld: Error: unresolvable symbol in /usr/local/lib/gemrb/libgemrb_core.so.0.8.4-git: __dt__Q2_3std123_Deque_base__pt__103_Q3_5GemRB16ContentContainer6LayoutQ2_3std52allocator__pt__35_Q3_5GemRB16ContentContainer6LayoutXCUiL10Gv
559531:gemrb: rld: Error: unresolvable symbol in /usr/local/lib/gemrb/libgemrb_core.so.0.8.4-git: __dt__Q2_3std230_Deque_base__pt__210_Q2_3std78basic_string__pt__58_wQ2_3std20char_traits__pt__2_wQ2_3std18allocator__pt__2_wQ2_3std105allocator__pt__88_Q2_3std78basic_string__pt__58_wQ2_3std20char_traits__pt__2_wQ2_3std18allocator__pt__2_wXCUiL10Gv
559531:gemrb: rld: Fatal Error: this executable has unresolvable symbols
[octane]:~ $

I can find those symbols using 'nm' on libgemrb_core.so.0.8.4-git itself but they seem to be 000000 's? Maybe not built or linked right.

Below is more for Dexter.. when his holiday parties are over:
git clone git://github.com/gemrb/gemrb.git
apply patches from git-diff-mipspro.txt #see attached
Use cmake 2.8.6 or newer (the link to neko_cmake-2.8.6.tardist is earlier in this thread)
I created a custom inittypes.h for va_list:
diff -urp /usr/include/inttypes.h-ORIG /usr/include/intty
pes.h

Code: Select all

--- /usr/include/inttypes.h-ORIG        2016-01-07 18:44:31.626329680 -0500
+++ /usr/include/inttypes.h     2016-10-09 17:32:29.042193080 -0400
@@ -184,6 +184,12 @@ typedef unsigned long int  uintptr_t;
 #include <stdarg.h>
 #include <stdio.h>
 
+/* http://forums.nekochan.net/viewtopic.php?t=17626
+ * FIX FOR va_list not being defined when compiling
+ * this was done for doxbox .7x
+ */
+typedef char *va_list;
+
 extern int i_fprintf  ( FILE *stream, const char *format, ... );
 extern int i_vfprintf ( FILE *stream, const char *format, va_list va );
 extern int i_printf   ( const char *format, ... );

 


MIPSPRO ENVIRONMENT

Code: Select all

export CC=c99
export CXX=cc
export CFLAGS="-O2 -mips4 -n32 -I/usr/nekoware/include"
export CXXFLAGS="-O2 -mips4 -n32 -I/usr/nekoware/include"
export CPPFLAGS="-O2 -mips4 -n32 -I/usr/nekoware/include"
export LDFLAGS="-L/usr/nekoware/lib"
export PERL=/usr/nekoware/bin/perl
export GNUMAKE=/usr/nekoware/bin/gmake
export SED=/usr/nekoware/bin/sed


cd gemrb
mkdir build
cmake -DHAVE_LDEXPF=0 -DDISABLE_WERROR=1 ..
# Note that OpenAL bits are commented out as detailed in the DIFF file
gmake VERBOSE=1 install

It will fail later on linking CXX executable gemrb

I worked around this (probably part of the problem):
RUN (its part of the failed command.. this creates the relink.txt):
cd /tmp/gemrb2/gemrb/build/gemrb && /usr/nekoware/bin/cmake -E cmake_link_script CMakeFiles/gemrb.dir/relink.txt --verbose=1

edit CMakeFiles/gemrb.dir/link.txt to add in /usr/lib32/c++init.o -lc -lC -lCio -lSgm after "-o gemrb"
/usr/bin/cc -O3 -mips4 -n32 -I/usr/nekoware/include -O2 -L/usr/nekoware/lib CMakeFiles/gemrb.dir/GemRB.cpp.o -o gemrb /usr/lib32/c++init.o -lc -lC -lCio -lSgm core/libgemrb_core.so.0.8.4-git -lpthread -Wl,-rpath,/tmp/gemrb2/gemrb/build/gemrb/core
##I found all the missing symbols from c++init.o and -lc -lC -lCio -lSgm .. maybe these are incorrect?

gmake VERBOSE=1 install

builds to 100% but then link error

RUN (its part of the failed command.. this creates the relink.txt): cd /tmp/gemrb2/gemrb/build/gemrb && /usr/nekoware/bin/cmake -E cmake_link_script CMakeFiles/gemrb.dir/relink.txt --verbose=1

edit CMakeFiles/gemrb.dir/relink.txt to add in /usr/lib32/c++init.o -lc -lC -lCio -lSgm after "-o gemrb"

gmake VERBOSE=1 install # as root, or use DESTDIR=/tmp/blah
DONE

Thats the best I can get with MIPSPro..
Now, the changes listed in this message/DIFF file.. seem to make GCC not compile now. I did feel a bit closer to the end with GCC ;)

git-diff-mipspro.txt
(4.93 KiB) Downloaded 21 times

User avatar
dexter1
Moderator
Moderator
Posts: 2735
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Re: GemRB

Unread postby dexter1 » Sun Dec 11, 2016 5:12 pm

Holy cow, That is some material to sift through!

I have my O2 installed with neko_python-2.7.3 neko_sdl-1.2.13 and a fresh cmake 2.8.12.2 prepped for compiling gemRB this evening, so i'll start producing some stuff this week.
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP:

User avatar
dexter1
Moderator
Moderator
Posts: 2735
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Re: GemRB

Unread postby dexter1 » Mon Dec 19, 2016 7:23 am

I've started gemrb-0.8.4 compile on my O2 and found a solution for the Holder.h problem

lynx wrote:hey guys, gemrb dev here.
- what tripped you up in Holder.h?

Well, basically this:

Code: Select all

[  1%] Building CXX object gemrb/core/CMakeFiles/gemrb_core.dir/Animation.cpp.o
cc-3624 CC: WARNING File = /local/frank/gemrb-0.8.4/gemrb/core/Callback.h, Line = 37
  function "GemRB::VoidCallback::operator()()" is hidden by
          "GemRB::Callback<T>::operator()" -- virtual function override
          intended?

     virtual bool operator()(T target)=0;
                  ^

cc-1209 CC: WARNING File = /local/frank/gemrb-0.8.4/gemrb/core/Holder.h, Line = 35
  The controlling expression is constant.

     void release() { assert(RefCount && "Broken Held usage.");
                      ^
          A template was detected during header processing.
            instantiation of "void GemRB::Held<GemRB::VoidCallback>::release()"
                      at line 66
            instantiation of "GemRB::Holder<GemRB::VoidCallback>::~Holder()"
                      at line 62 of
                      "/local/frank/gemrb-0.8.4/gemrb/core/Callback.h"

cc-1367 CC: ERROR File = /local/frank/gemrb-0.8.4/gemrb/core/Holder.h, Line = 72
  A pointer to an incomplete class type is not allowed.

           ptr->acquire();
           ^
          A template was detected during header processing.
            instantiation of "GemRB::Holder<GemRB::SymbolMgr>::Holder(const
                      GemRB::Holder<GemRB::SymbolMgr> &)" at line 53 of
                      "/usr/include/CC/stl_construct.h"
            implicit generation of
                      "GemRB::Symbol::Symbol(const GemRB::Symbol &)" at line
                      53 of "/usr/include/CC/stl_construct.h"
            instantiation of "void std::construct(GemRB::Symbol *, const
                      GemRB::Symbol &)" at line 637 of
                      "/usr/include/CC/stl_vector.h"
            instantiation of "void std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::_M_insert_aux(std::vector
                      <GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::iterator, const
                      GemRB::Symbol &)"

cc-1367 CC: ERROR File = /local/frank/gemrb-0.8.4/gemrb/core/Holder.h, Line = 66
  A pointer to an incomplete class type is not allowed.

           ptr->release();
           ^
          A template was detected during header processing.
            instantiation of "GemRB::Holder<GemRB::SymbolMgr>::~Holder()" at
                      line 53 of "/usr/include/CC/stl_construct.h"
            implicit generation of
                      "GemRB::Symbol::Symbol(const GemRB::Symbol &)" at line
                      53 of "/usr/include/CC/stl_construct.h"
            instantiation of "void std::construct(GemRB::Symbol *, const
                      GemRB::Symbol &)" at line 637 of
                      "/usr/include/CC/stl_vector.h"
            instantiation of "void std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::_M_insert_aux(std::vector
                      <GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::iterator, const
                      GemRB::Symbol &)"

cc-1367 CC: ERROR File = /local/frank/gemrb-0.8.4/gemrb/core/Holder.h, Line = 77
  A pointer to an incomplete class type is not allowed.

           rhs.ptr->acquire();
           ^
          A template was detected during header processing.
            instantiation of "GemRB::Holder<GemRB::SymbolMgr>
                      &GemRB::Holder<GemRB::SymbolMgr>::operator=(const
                      GemRB::Holder<GemRB::SymbolMgr> &)" at line 249 of
                      "/usr/include/CC/stl_algobase.h"
            implicit generation of "GemRB::Symbol
                      &GemRB::Symbol::operator=(const GemRB::Symbol &)" at
                      line 249 of "/usr/include/CC/stl_algobase.h"
            instantiation of "GemRB::Symbol
                      *std::__copy_backward(std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      GemRB::Symbol *, std::random_access_iterator_tag,
                      std::__copy_backward_dispatch<std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      GemRB::Symbol *,
                      __type_traits<std::iterator_traits<GemRB::Symbol
                      *>::value_type>::has_trivial_assignment_operator>::_Dista
                      nce *)" at line 272 of "/usr/include/CC/stl_algobase.h"
            instantiation of "GemRB::Symbol
                      *std::__copy_backward_dispatch<std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      GemRB::Symbol *,
                      __type_traits<std::iterator_traits<GemRB::Symbol
                      *>::value_type>::has_trivial_assignment_operator>::copy(s
                      td::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      GemRB::Symbol *)" at line 300 of
                      "/usr/include/CC/stl_algobase.h"
            instantiation of "GemRB::Symbol
                      *std::copy_backward(std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      GemRB::Symbol *)" at line 640 of
                      "/usr/include/CC/stl_vector.h"
            instantiation of "void std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::_M_insert_aux(std::vector
                      <GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::iterator, const
                      GemRB::Symbol &)"

cc-1367 CC: ERROR File = /local/frank/gemrb-0.8.4/gemrb/core/Holder.h, Line = 79
  A pointer to an incomplete class type is not allowed.

           ptr->release();
           ^
          A template was detected during header processing.
            instantiation of "GemRB::Holder<GemRB::SymbolMgr>
                      &GemRB::Holder<GemRB::SymbolMgr>::operator=(const
                      GemRB::Holder<GemRB::SymbolMgr> &)" at line 249 of
                      "/usr/include/CC/stl_algobase.h"
            implicit generation of "GemRB::Symbol
                      &GemRB::Symbol::operator=(const GemRB::Symbol &)" at
                      line 249 of "/usr/include/CC/stl_algobase.h"
            instantiation of "GemRB::Symbol
                      *std::__copy_backward(std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      GemRB::Symbol *, std::random_access_iterator_tag,
                      std::__copy_backward_dispatch<std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      GemRB::Symbol *,
                      __type_traits<std::iterator_traits<GemRB::Symbol
                      *>::value_type>::has_trivial_assignment_operator>::_Dista
                      nce *)" at line 272 of "/usr/include/CC/stl_algobase.h"
            instantiation of "GemRB::Symbol
                      *std::__copy_backward_dispatch<std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      GemRB::Symbol *,
                      __type_traits<std::iterator_traits<GemRB::Symbol
                      *>::value_type>::has_trivial_assignment_operator>::copy(s
                      td::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      GemRB::Symbol *)" at line 300 of
                      "/usr/include/CC/stl_algobase.h"
            instantiation of "GemRB::Symbol
                      *std::copy_backward(std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::value_type *,
                      GemRB::Symbol *)" at line 640 of
                      "/usr/include/CC/stl_vector.h"
            instantiation of "void std::vector<GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::_M_insert_aux(std::vector
                      <GemRB::Symbol,
                      std::allocator<GemRB::Symbol>>::iterator, const
                      GemRB::Symbol &)"

4 errors detected in the compilation of "/local/frank/gemrb-0.8.4/gemrb/core/Animation.cpp".
gmake[2]: *** [gemrb/core/CMakeFiles/gemrb_core.dir/Animation.cpp.o] Error 2
gmake[1]: *** [gemrb/core/CMakeFiles/gemrb_core.dir/all] Error 2
gmake: *** [all] Error 2

TLDR:
cc-1367 CC ERROR "A pointer to an incomplete class type is not allowed."
Initially i didn't know how to proceed, so i commented the problematic functions out. But working on this error message proved fruitful after a couple of hours. The problem lies with the definition of Symbol in gemrb/core/Interface.h :

Code: Select all

#ifdef _MSC_VER // No SFINAE
...
#include "SymbolMgr.h"
...
#endif

namespace GemRB {
...
class SymbolMgr;
...
struct Symbol {
   Holder<SymbolMgr> sm;
   char ResRef[8];
};
...

MIPSPro has its own way of instantiating templates. On occasions where people use forward declaration for classes and then trying to use them with templates produces compiler errors. This is because for template instantiation the class SymbolMgr is different from the class in the header file i.e. it won't see the class definition in the header file.

There are compiler options for remedying this, but why use forward declaration in the first place?
IIRC these are only needed for circular dependencies in class definitions. If it is not needed then don't use it.

I've re-enabled the headers by this diff:

Code: Select all

--- Interface.h.save    Mon Dec 19 11:50:15 2016
+++ Interface.h Mon Dec 19 12:00:10 2016
@@ -40,7 +40,7 @@
 #include <string>
 #include <vector>
 
-#ifdef _MSC_VER // No SFINAE
+#if defined(_MSC_VER) || defined(__sgi)
 #include "DataFileMgr.h"
 #include "MusicMgr.h"
 #include "SaveGame.h"
@@ -89,8 +89,8 @@
 class Sprite2D;
 class Store;
 class StringMgr;
-class SymbolMgr;
-class TableMgr;
+//class SymbolMgr;
+//class TableMgr;
 class TextArea;

and solved the compile problem.
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP:

lynx
Posts: 17
Joined: Fri Oct 14, 2016 9:15 am

Re: GemRB

Unread postby lynx » Mon Dec 19, 2016 8:44 am

If you don't want to use git, use the tarball from this url, so you'll have the latest changes:
https://github.com/gemrb/gemrb/archive/master.zip

I've committed a modified version of your diff — it's safe only for the cases from the first ifdef. Thanks!

User avatar
dexter1
Moderator
Moderator
Posts: 2735
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Re: GemRB

Unread postby dexter1 » Thu Dec 22, 2016 5:08 pm

lynx wrote:If you don't want to use git, use the tarball from this url, so you'll have the latest changes:
https://github.com/gemrb/gemrb/archive/master.zip

I've committed a modified version of your diff — it's safe only for the cases from the first ifdef. Thanks!

Thanks Lynx, i know git/mercurial so i've cloned the latest changeset. It does compile more cleanly with MIPSPro, although there are some IRIX mishaps which needs to be fixed manually.

Just giving you the heads up, i have solved all problems and compiled gemRB-0.8.4 with MIPSPro 7.4.4 on my O2 with 6.5.22m. Used vanilla tarball with my own patches, but i can give a diff of my patches to the git version. My first patch was way off especially the stricmp which proved to be a header booboo, so i hope the git version can be cleaned up if all those substitutions are committed.

There were some minor details with including Python c99-style headers and a nasty bug in /usr/include/unistd.h in combination with MIPSPro C++ compiler which makes compiling kind of a challenge. Nothing unsolvable, but i was stumped for a few days.

And oh yeah, attempted tp play Baldur's Gate II Demo windowed on that O2 (R5K@180MHz). It does work, but man that's slow. :o

I will wrap up the patch, show it here with a screenshot and something resembling a package.
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP:

User avatar
necron2600
Posts: 261
Joined: Tue May 26, 2015 10:38 pm
Location: Boston

Re: GemRB

Unread postby necron2600 » Thu Dec 22, 2016 6:53 pm

Awesome Dexter!
I cant wait! hurry hurry! ;)
I know this plays decently on a 400mhz UltraSPARC (Solaris) so Im hoping the same with a >400mhz SGI..

lynx
Posts: 17
Joined: Fri Oct 14, 2016 9:15 am

Re: GemRB

Unread postby lynx » Thu Dec 22, 2016 11:20 pm

Cool! The goal is to have it compile out of the box, so a diff vs HEAD would be great.

User avatar
dexter1
Moderator
Moderator
Posts: 2735
Joined: Thu Feb 20, 2003 6:57 am
Location: Zoetermeer, The Netherlands

Re: GemRB

Unread postby dexter1 » Mon Jan 02, 2017 5:33 am

necron2600 wrote:Awesome Dexter!
I cant wait! hurry hurry! ;)
I know this plays decently on a 400mhz UltraSPARC (Solaris) so Im hoping the same with a >400mhz SGI..

I've jumped the gun a bit of stating that i've solved all problems, sorry for that. There are many issues still needing to be resolved, but i do have played the game on my O2, and if it is not crashing, it works \o/

BG2intro.png

I've completed the nekoware package for gemrb version 0.8.4 and uploaded it to nekoware current. A direct link is ftp://ftp.nekochan.net/pub/downloads/Ne ... .4.tardist

It installs in /usr/nekoware and dependencies are moderate, but you'll need at least:

Code: Select all

neko_python.sw.eoe
neko_sdl.sw.lib
neko_sdl_mixer.sw.lib
neko_openal.sw.lib
neko_zlib.sw.lib
neko_libogg.sw.lib
neko_libvorbis.sw.lib
neko_libiconv.sw.lib

This is beta software because there are crashes and bugs. Beware!

Below are three files necessary for the compilation with MIPSPro 7.4.4m on a O2 with 6.5.22m. I've tried with gcc 4.7.1, but cmake complains about pthread headers, so i stuck with MIPSPro.
You need the latest cmake 2.8 version. I've made a cmake 2.8.12.2 myself in /usr/local and used that, since the neko_cmake versions are too old.

Release notes for the tardist :
neko_gemrb.txt
(2.98 KiB) Downloaded 15 times

patch to 0.8.4 source :
gemrb-0.8.4_irix.patch
(13.2 KiB) Downloaded 15 times

cmake cache file since it has a hard time finding python :
CMakeCache.txt
(20.76 KiB) Downloaded 12 times

For compiling with git HEAD i've made a patch as well
gemrb-git.patch :
gemrb-git_irix.patch
(1.46 KiB) Downloaded 13 times


strlcpy :
This C string function is an extension to the standard library and appears on many (BSD-like) systems. IRIX header files only has it in /usr/include/internal/string_core.h, however MIPSPro C++ doesn't see it possibly due to header bugs or not including C headers in C++ mode.
So it's best to predefine the header in the source, which i did.

/usr/include/unistd.h is a C header and the timeval struct is there as a stub, because its proper definition is in /usr/include/sys/time.h
When MIPSPro C++ compiler includes both it breaks on the stub, i believe it was in GUIScript.cpp when this popped up. The way to go for now is to hack the system unistd.h:

Code: Select all

--- /usr/include/unistd.h.save  Tue Dec 20 20:39:51 2016
+++ /usr/include/unistd.h       Tue Dec 20 21:24:27 2016
@@ -469,7 +469,7 @@
  * All other additions go here. These are non-POSIX/XOPEN
  */
 
-#if _SGIAPI || defined(_BSD_TYPES) || defined(_BSD_COMPAT)
+#if (_SGIAPI || defined(_BSD_TYPES) || defined(_BSD_COMPAT) ) && !(defined(_LANGUAGE_C_PLUS_PLUS))
 /* Need to use the same predicate as
  * types.h for inclusion of bsd_types.h/select.h
  */

This is probably needed for other code-projects.

The Demo Baldur's Gate zipfile doesn't work correctly, see the release notes. If someone has an idea, cfg file or hack, let us know in here.

I've included my config file :
BG2.txt
(12.47 KiB) Downloaded 11 times


I got Baldur's Gate 2 : Shadows of Ahn and Throne of Bhaal fom GoG source. You need to install it on a linux system with wine and copy over the entire directory to an IRIX system. Then fill in the path in the BG2.cfg file and start gemrb with:

Code: Select all

gemrb -c BG2.cfg


Inventory in ToB of my char:
BG2inv.png


There are still several problems with the program on IRIX, see the release notes. Doing a debug session with CVD (IRIX visual debugger) reveals thread issues with SDL and SIGSEGV's in certain malloc calls and new calls. This needs more testing and researching, possibly valgrinding the engine to look for leaks.

Happy New Year!
:Crimson: :PI: :Indigo: :O2: :Indy: :Indigo2: :Indigo2IMP:


Return to “IRIX and Software”

Who is online

Users browsing this forum: Google [Bot] and 2 guests