Building GDAL On IRIX

IRIX was Silicon Graphics' variant of System V for their MIPS-based workstations. More information can be found around the web about IRIX, its history and the types of workstations it ran on.


  • These machines are Big Endian. There might be some drivers that don't take endianess into consideration, so there might be occasions where there will be unexpected results in running your application.
  • IRIX's compilers are contankerous -- this is not necessarily a bad thing though. MIPSpro is extremely "anal" about correctness of code. One rule of thumb, is that if it will build safely on MIPSpro, it should build almost anywhere else.
  • IRIX's default maximum command line argument length is short. Very short. This has to be fixed.
  • By default, MIPSpro builds everything as though it were using the std namespace. This breaks just about everything, so CC must be passed the argument "-LANG:std=off:libc_in_namespace_std=off". Why SGI did this is unknown.


Hopefully by the time you're reading this, the fixes necessary to make GDAL build nicely on IRIX will be in place. However, as a few general rules, here's some things to watch out for:

  • GDAL is building C++. There are some drivers that assume C99 features will be available to them. This is an extremely poor assumption, as, technically speaking, C99 features are not actually supposed to be available. As such, there are many instances where you will crash and burn due to this. Common examples are the round() and a few odds and ends in the floating point libraries.
  • cassert, cmath, c[anything] as includes are forbidden. This is bad practice in general given how GDAL is written. Change them to <assert.h> <math.h> <stdlib.h>, etc.
  • iostream is evil and complicates things. Fortunately, only one driver (pcraster) included iostream, and removing said include is safe.
  • Since we're in a strict C++ mode, copysignf does not seem to exist. Use copysign instead.

Maximum Command Line Argument Length

The very tail end of the GDAL build process requires that a command line that is greater than the max IRIX command line by default (20k) is issues. One workaround for this is to set the parameters "ncargs" using systune to a greater value (perhaps 65535).
To do this:

  1. Log in as root
  2. in a command line prompt, run "systune ncargs 65535" (sets the Kernel max command line args buffer to 64k)
  3. in a command line prompt, run "autoconfig" (regenerates the Kernel and boot files)
  4. reboot your workstation (either via the Indigo Magic desktop or the "reboot" commands)
Last modified 10 years ago Last modified on Sep 14, 2007 7:33:20 PM