-
Notifications
You must be signed in to change notification settings - Fork 21
Building externals on IRIX
As a retro-computing exercise, we can build externals on SGI's IRIX (the last release of which was in 2006).
This should work on any SGI workstation, like the Indy (1993-1997), the O2 (1996-2002) or the Octane (1997-2004).
I was using an Indy Virtual Machine for this experiment.
Using a VM is slow: While the Indy had a 100MHz processor (so not exactly fast by today's standards), the emulation eats 100% of one core of my i7-13700K (5.4GHz) machine, and still the Indy is slightly lagging. Also the emulator I am using (MAME-v0.284) is slightly buggy (not being able to print decimal numbers), which degrades its usefulness for Pd.
However, I know of at least one other person who is using this on real SGI hardware (an Octane), which apparently is quite fast and works correctly.
Neither pd-lib-builder nor Pd itself come with out-of-the-box support for building for IRIX. IRIX systems have been pretty much out of use for the last 2 decades, and accordingly the demand for Pd on IRIX has been very low since then.
So while it won't "just work", it should work with a little tweaking of command line arguments, as described in this document.
We need a compiler that is compatible with the GNU Compiler Collection (GCC). The SGI Freeware CDs include GCC-3.3 which you will need to (at least) to build.
Building won't work with SGI's MIPSpro compiler!
pd-lib-builder depends on GNU make >= 3.81.
The make that comes with IRIX/MIPSpro will not work!
The gmake that comes on the SGI Freeware CDs is GNU make 3.80 so it won't work either.
Download, compile and install a newer version of GNU make.
-
Download https://ftp.gnu.org/gnu/make/make-3.81.tar.gz (a newer version might do as well, but I haven't tried) and extract it
-
configure/build/install, e.g.:
cd make-3.81 ./configure --program-prefix=g ./build.sh ./make installI'm using the
gprefix here, so the installed binary will be available asgmake(and the originalmakewill still be the one from SGI). You can use whatever prefix you want (e.g. i was usingGNU, in order to not override thegmakefrom the Freeware CDs), but you need to remember what you did when you want to build. For the sake of simplicity, I'm assuming the prefix wasg(so all invocations below are forgmake)
obviously...
I assume that Pd was built for the n32 ABI, and with --external-extension=pd_irix6
gmake \
system=Linux \
CC=gcc \
warn.flags=-Wall \
extension=pd_irix6 \
disable-dependency-tracking=1 \
CPPFLAGS="-DLITTLE_ENDIAN=1234 -DBIG_ENDIAN=4321 -DBYTE_ORDER=4321"
CFLAGS=-std=gnu99 \
PDINCLUDEDIR=/usr/local/include-
system=Linux: pd-lib-builder does not have built-in support for IRIX (see issue#85). But the Linux system is close enough so we can use that (with some tweaks) -
CC=gcc: the MIPSpro compiler (which we cannot use) is installed ascc, and pd-lib-builder would pick that up automatically. So we force the compiler to GCC. If the external uses C++, you must also specifyCXX=g++ -
warn.flags=-Wall: by default, pd-lib-builder uses some flags that are only available on newer GCC. We strip this down to just-Wall, which somewhat reduces the amount of compiler warnings we get. -
extension=pd_irix6: That's the common short extension for IRIX/n32; it needs to match the file extension expected by Pd. -
CFLAGS=-std=gnu99: Pd>=0.54 uses an anonymous union in a struct, which is really only standardized since C11. Luckily the GNU-specific extensiongnu99also supports it.
-
CPPFLAGS="-DLITTLE_ENDIAN=1234 -DBIG_ENDIAN=4321 -DBYTE_ORDER=4321": code that relies on detecting the endianness, usually fails on Irix. these defines should properly setup endianness to "big endian" (which is what is used on IRIX/mips) -
PDINCLUDEDIR=/usr/local/include/: I installed Pd withgmake install, so the headers are in/usr/local/include; there the compiler will automatically find the headers, but pd-lib-builder does some sanity checks and prints a warning if I do not specifyPDINCLUDEDIR. If your Pd-headers (m_pd.h) are somewhere else, this is the place to pass the path. -
disable-dependency-tracking=1: This might be required, if C99-mode (as forced with theCFLAGS=-std=gnu99) is required for some included files (pd-lib-builder does some magic to track header-dependencies; and theCFLAGSare not passed in this stage; disabling dependency tracking will skip the magic). Also my Indy VM is very slow (esp. file-system access), and this can speed up compilation a bit. This flag is probably a bad idea while developing stuff, but for a one-off build there shouldn't be a difference (except the build time)...
If you are running IRIX64 but your Pd has been built for n32, you will need to additionally tell the compiler to use the n32 ABI, by adding -mabi=n32 to your CFLAGS (e.g. CFLAGS="-mabi=n32 -std=gnu99").
IRIX comes with 3 different ABIs (o32, n32, and - on newer systems - 64), which make the binaries incompatible between each other..
Pd uses different file extensions to distinguish between incompatible binaries, but doesn't know anything about IRIX specific extensions.
So here's the file extensions that I would suggest to use:
| precision | ABI | external extension
|
Pd configure flags | note |
|---|---|---|---|---|
| single | o32 | pd_irix5 |
--with-external-extension=pd_irix5 --with-deken-os=Irix --with-deken-cpu=mips |
this was used when Pd on IRIX was still a thing; probably not used anymore |
| single | n32 | pd_irix6 |
--with-external-extension=pd_irix6 --with-deken-os=Irix --with-deken-cpu=mipsn32 |
this was used when Pd on IRIX was still a thing; should be the default on IRIX6 |
| single | 64 | pd_irix64 |
--with-external-extension=pd_irix64 --with-deken-os=Irix --with-deken-cpu=mips64 |
could be used on IRIX64 |
| double | o32 | irix-mips-64.so |
--with-external-extension=irix-mips-64.so --with-deken-os=Irix --with-deken-cpu=mips |
should really not be used |
| double | n32 | irix-mipsn32-64.so |
--with-external-extension=irix-mipsn32-64.so --with-deken-os=Irix --with-deken-cpu=mipsn32 |
|
| double | 64 | irix-mips64-64.so |
--with-external-extension=irix-mips64-64.so --with-deken-os=Irix --with-deken-cpu=mips64 |
You have to pass these extensions manually to pd-lib-builder (see the extension column)
You also have to pass these extensions manually when building Pd itself (see the Pd configure flag column):
- the short extensions (e.g.
pd_irix6) ought to be passed to Pd's configure like--with-external-extension=pd_irix6 - the long extensions (e.g.
irix-mipsn32-64.so) need to be passed with--deken-os=Irix --deken-cpu=mipsn32- the rest is guessed automatically)