Compiling for SGI IRIX6.5

Hi there,

Just hoping to get some pointers on building the latest version of ioQuake3 from GitHub on SGI IRIX MIPS64. I am using the latest compiling tool chain ‘sgug-rse’ and this is what I get when running ‘make’:

[sgugshell stormy@OCTANE ioq3]$ make
make[1]: Entering directory ‘/usr/people/stormy/rpmbuild/GIT/ioq3’

Building in build/release-irix64-mips:
PLATFORM: irix64
ARCH: mips
VERSION: 1.36_GIT_84daa282-2021-12-08
COMPILE_PLATFORM: irix64
COMPILE_ARCH: IP30
HAVE_VM_COMPILED:
PKG_CONFIG: unknown-pkg-config
CC: c99

CFLAGS:
-Dstricmp=strcasecmp -Xcpluscomm -woff 1185 -I. -I/usr/include -DNO_VM_COMPILED -DNO_GZIP -Icode/zlib -DUSE_INTERNAL_JPEG
-Icode/jpeg-8c -DUSE_LOCAL_HEADERS -DPRODUCT_VERSION=“1.36_GIT_84daa282-2021-12-08” -Wformat=2 -Wno-format-zero-length
-Wformat-security -Wno-format-nonliteral -Wstrict-aliasing=2 -Wmissing-format-attribute -Wdisabled-optimization
-Werror-implicit-function-declaration -MMD -DNDEBUG -O3

CLIENT_CFLAGS:
-D_SGI_MP_SOURCE -I/usr/sgug/include/SDL2 -DUSE_OPENAL -DUSE_OPENAL_DLOPEN -DUSE_CURL -DUSE_CURL_DLOPEN -DUSE_VOIP -DUSE_CODEC_OPUS
-DOPUS_BUILD -DHAVE_LRINTF -DFLOATING_POINT -DFLOAT_APPROX -DUSE_ALLOCA -Icode/opus-1.2.1/include -Icode/opus-1.2.1/celt
-Icode/opus-1.2.1/silk -Icode/opus-1.2.1/silk/float -Icode/opusfile-0.9/include -DUSE_CODEC_VORBIS -Icode/libvorbis-1.3.6/include
-Icode/libvorbis-1.3.6/lib -Icode/libogg-1.3.3/include -DUSE_RENDERER_DLOPEN -DUSE_MUMBLE

SERVER_CFLAGS:
-DUSE_VOIP

TOOLS_CFLAGS:
-g -Wall -fno-strict-aliasing -DTEMPDIR="/tmp" -DSYSTEM="" -Icode/tools/lcc/src -Icode/tools/lcc/lburg -MMD

LDFLAGS:

LIBS:
-ldl -lm -lgen

CLIENT_LIBS:
-L/usr/X11/lib -L/usr/sgug/lib32 -lSDL2 -lX11 -lXext -lm

AUTOUPDATER_LIBS:
-ldl

Output:
ioq3ded.mips
ioquake3.mips
renderer_opengl1_mips.so
renderer_opengl2_mips.so
baseq3/cgamemips.so
baseq3/qagamemips.so
baseq3/uimips.so
missionpack/cgamemips.so
missionpack/qagamemips.so
missionpack/uimips.so

make[2]: Entering directory ‘/usr/people/stormy/rpmbuild/GIT/ioq3’
DED_CC code/server/sv_bot.c
gcc: error: 1185: No such file or directory
gcc: error: unrecognized command line option ‘-Xcpluscomm’
gcc: error: unrecognized command line option ‘-woff’
make[2]: *** [Makefile:2816: build/release-irix64-mips/ded/sv_bot.o] Error 1
make[2]: Leaving directory ‘/usr/people/stormy/rpmbuild/GIT/ioq3’
make[1]: *** [Makefile:1458: targets] Error 2
make[1]: Leaving directory ‘/usr/people/stormy/rpmbuild/GIT/ioq3’
make: *** [Makefile:1371: release] Error 2

I don’t know about building for IRIX. You could try removing the unrecognized arguments (-Xcpluscomm -woff 1185) from the Makefile though.

Hi Zack,

Thank you for your reply. I did some research and it seems those commands were MIPSPro Compiler specific - where-as I am using GCC9 (Using a modern compiler chain on IRIX called Sgug-RSE) So I removed them as you suggested and it started building.

I then got some errors further down which stopped the process, could you advise on these? From memory there is a way I might be able to tell it not to stop on these errors, or perhaps they do need fixing. Hopefully you can advise, thank you:

code/sys/sys_unix.c: In function 'Sys_Mkfifo':
code/sys/sys_unix.c:297:8: error: implicit declaration of function 'fileno' [-Werror=implicit-function-declaration]
  297 |   fn = fileno( fifo );
      >        ^~~~~~
code/sys/sys_unix.c: In function 'Sys_SetEnv':
code/sys/sys_unix.c:906:3: error: implicit declaration of function 'setenv'; did you mean 'getenv'? [-Werror=implicit-function-declaration]
  906 |   setenv(name, value, 1);
      >   ^~~~~~
      >   getenv
code/sys/sys_unix.c:908:3: error: implicit declaration of function 'unsetenv'; did you mean 'fesetenv'? [-Werror=implicit-function-declaration]
  908 |   unsetenv(name);
      >   ^~~~~~~~
      >   fesetenv
code/sys/sys_unix.c: In function 'Sys_PIDIsRunning':
code/sys/sys_unix.c:928:9: error: implicit declaration of function 'kill'; did you mean 'killpg'? [-Werror=implicit-function-declaratio]
  928 |  return kill( pid, 0 ) == 0;
      >         ^~~~
      >         killpg
cc1: some warnings being treated as errors
make[2]: *** [Makefile:2828: build/release-irix64-mips/ded/sys_unix.o] Error 1
make[2]: Leaving directory '/usr/people/stormy/rpmbuild/GIT/ioq3'
make[1]: *** [Makefile:1458: targets] Error 2
make[1]: Leaving directory '/usr/people/stormy/rpmbuild/GIT/ioq3'
make: *** [Makefile:1371: release] Error 2```

Hi Zack,

Just letting you know I powered through and managed to get the latest ioQuake3 compiling on IRIX using GCC9.

I may need some advice on this specific issue, it doesn’t seem to be able to open an OpenGL display. I am using +set cl_renderer opengl1 but it makes no difference.

SDL using driver “x11”
Initializing OpenGL display
Display aspect: 1.250
…setting mode 6: 1024 768
Couldn’t get a visual
…WARNING: could not set the given mode (6)
Initializing OpenGL display
Display aspect: 1.250
…setting mode 6: 1024 768
Couldn’t get a visual
…WARNING: could not set the given mode (6)
Setting r_mode 6 failed, falling back on r_mode 3
Initializing OpenGL display
Display aspect: 1.250
…setting mode 3: 640 480
Couldn’t get a visual
…WARNING: could not set the given mode (3)
----- Client Shutdown (Client fatal crashed: GLimp_Init() - could not load OpenGL subsystem) -----
RE_Shutdown( 1 )
Hunk_Clear: reset the hunk ok

FYI I just tried with +set developer 1 and got:

Initializing OpenGL display
Display aspect: 1.250
…setting mode 3: 640 480
^1SDL_CreateWindow failed: Could not initialize OpenGL / GLES library

I don’t have a good guess for this. It seems like an issue in SDL. Though in the past you got it to create the window by setting r_fullscreen 0.

Hi Zack,

Thanks for reminding me. Yes in the previous attempt we were attempting to use a very hacked SDL2 which wasn’t quite ready for prime time. This time I have compiled under a supposedly working version of SDL2 but it seems it may not be the case. I am assuming since everything compiled A-Ok that any issues with opening an opengl window will lay squarely with our SDL2 and not ioQuake3 itself, would you say that is a fairly safe assumption? I have had a friend tell me that he also has not been able to generate an accelerated window with our SDL2 either in his own programs.

Besides all this, would you be interested in my making a list of all the little bits I had to change in order to let it compile? It wasn’t anything too major, just adding certain headers that were missing in certain files (probably these headers weren’t nessesary to be defined in modern operating systems but on irix they needed to be) and one section where I needed to add a compiler flag for the string tool.

Cheers
Steve

It’s likely an issue in your SDL2, yes. Knowing what changes were needed or integrating them into ioquake3 (without breaking MIPSPro Compiler) would be useful for other IRIX users.